Skip to content

Commit 26910cf

Browse files
authored
Merge pull request #49 from ethereum/make-update-script-create-wasm-symlinks
Creating wasm/ symlinks in the update script
2 parents d10fac3 + a6aff48 commit 26910cf

File tree

1 file changed

+28
-11
lines changed

1 file changed

+28
-11
lines changed

update

+28-11
Original file line numberDiff line numberDiff line change
@@ -207,31 +207,48 @@ function processDir (dir, listCallback) {
207207

208208
const DIRS = [
209209
'/bin',
210-
'/wasm',
211-
'/emscripten-asmjs',
212210
'/linux-amd64',
213211
'/macosx-amd64',
214212
'/windows-amd64'
215213
]
216214

217215
DIRS.forEach(function (dir) {
218-
if (dir !== '/wasm') {
216+
if (dir !== '/bin') {
219217
processDir(dir)
220218
} else {
221219
processDir(dir, function (parsedList) {
222-
// Any new releases added to wasm/ need to be linked in emscripten-wasm32/ first.
223-
// Only then can we start processing emscripten-wasm32/.
224-
// We don't need to do this for emscripten-asmjs/ because we don't build asm.js releases any more.
220+
// Any new releases added to bin/ need to be linked in other directories before we can start processing them.
225221
parsedList.forEach(function (release) {
226222
if (release.prerelease === undefined) {
227-
updateSymlinkSync(
228-
path.join('/emscripten-wasm32', 'solc-emscripten-wasm32-v' + release.longVersion + '.js'),
229-
path.join('..', 'wasm', release.path)
230-
)
223+
// Starting with 0.6.2 we no longer build asm.js releases and the new builds added to bin/ are all wasm.
224+
if (semver.gt(release.version, '0.6.1')) {
225+
updateSymlinkSync(
226+
path.join('/wasm', release.path),
227+
path.join('..', 'bin', release.path)
228+
)
229+
} else {
230+
updateSymlinkSync(
231+
path.join('/emscripten-asmjs', 'solc-emscripten-asmjs-v' + release.longVersion + '.js'),
232+
path.join('..', 'bin', release.path)
233+
)
234+
}
231235
}
232236
})
233237

234-
processDir('/emscripten-wasm32')
238+
processDir('/emscripten-asmjs')
239+
processDir('/wasm', function (parsedList) {
240+
// Any new releases added to wasm/ need to be linked in emscripten-wasm32/ first.
241+
parsedList.forEach(function (release) {
242+
if (release.prerelease === undefined) {
243+
updateSymlinkSync(
244+
path.join('/emscripten-wasm32', 'solc-emscripten-wasm32-v' + release.longVersion + '.js'),
245+
path.join('..', 'wasm', release.path)
246+
)
247+
}
248+
})
249+
250+
processDir('/emscripten-wasm32')
251+
})
235252
})
236253
}
237254
})

0 commit comments

Comments
 (0)