Skip to content

Creating wasm/ symlinks in the update script #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 28 additions & 11 deletions update
Original file line number Diff line number Diff line change
Expand Up @@ -207,31 +207,48 @@ function processDir (dir, listCallback) {

const DIRS = [
'/bin',
'/wasm',
'/emscripten-asmjs',
'/linux-amd64',
'/macosx-amd64',
'/windows-amd64'
]

DIRS.forEach(function (dir) {
if (dir !== '/wasm') {
if (dir !== '/bin') {
processDir(dir)
} else {
processDir(dir, function (parsedList) {
// Any new releases added to wasm/ need to be linked in emscripten-wasm32/ first.
// Only then can we start processing emscripten-wasm32/.
// We don't need to do this for emscripten-asmjs/ because we don't build asm.js releases any more.
// Any new releases added to bin/ need to be linked in other directories before we can start processing them.
parsedList.forEach(function (release) {
if (release.prerelease === undefined) {
updateSymlinkSync(
path.join('/emscripten-wasm32', 'solc-emscripten-wasm32-v' + release.longVersion + '.js'),
path.join('..', 'wasm', release.path)
)
// Starting with 0.6.2 we no longer build asm.js releases and the new builds added to bin/ are all wasm.
if (semver.gt(release.version, '0.6.1')) {
updateSymlinkSync(
path.join('/wasm', release.path),
path.join('..', 'bin', release.path)
)
} else {
updateSymlinkSync(
path.join('/emscripten-asmjs', 'solc-emscripten-asmjs-v' + release.longVersion + '.js'),
path.join('..', 'bin', release.path)
)
}
}
})

processDir('/emscripten-wasm32')
processDir('/emscripten-asmjs')
processDir('/wasm', function (parsedList) {
// Any new releases added to wasm/ need to be linked in emscripten-wasm32/ first.
parsedList.forEach(function (release) {
if (release.prerelease === undefined) {
updateSymlinkSync(
path.join('/emscripten-wasm32', 'solc-emscripten-wasm32-v' + release.longVersion + '.js'),
path.join('..', 'wasm', release.path)
)
}
})

processDir('/emscripten-wasm32')
})
})
}
})
Expand Down