Skip to content
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

asm.js binaries in bin/ and wasm binaries in wasm/ #39

Merged
merged 2 commits into from
Jul 17, 2020

Conversation

cameel
Copy link
Member

@cameel cameel commented Jul 17, 2020

Depends on on #38. Part of ethereum/solidity#9258.

Currently bin/ contains a mix of wasm and asm.js binaries. This makes it hard to determine where an older release downloaded from github would go. This PR moves all wasm binaries from bin/ to wasm/ and adds symlinks in their place.

This required changing the update script to make it not ignore the newly added symlinks.

@cameel cameel requested review from ekpyron and chriseth July 17, 2020 00:15
@cameel cameel self-assigned this Jul 17, 2020
@cameel
Copy link
Member Author

cameel commented Jul 17, 2020

Here's the script I used to separate the files:

#!/usr/bin/env bash

set -e

is_wasm() {
    # Just a heuristic but it does match the expected release versions in solc-bin so far.
    grep --fixed-strings --silent 'var wasmBinaryFile="data:application/octet-stream;base64,AGFzbQEA' "$@" && return 0
    return 1
}

for src_dir in bin wasm; do
    cd "$src_dir"
    for binary_name in $(find * -regex 'soljson-v[0-9.]+\+commit\..*\.js' -type f | sort); do
        full_version=$(echo "$binary_name" | sed -r 's/soljson-(v[0-9.]+\+commit\..*)\.js/\1/')

        if is_wasm "$binary_name"; then
            if [[ $src_dir == bin ]]; then
                echo "Moving wasm binary bin/${binary_name} to wasm/"
                dst_dir="wasm"
            else
                continue
            fi
        else
            if [[ $src_dir == wasm ]]; then
                echo "Moving asm.js binary wasm/${binary_name} to bin/"
                dst_dir="bin"
            else
                continue
            fi
        fi

        if [[ -e "../${dst_dir}/${binary_name}" ]]; then
            [[ -L "../${dst_dir}/${binary_name}" ]] || { echo "ERROR: File ${dst_dir}/${binary_name} already exists and is not a symbolic link"; exit 1; }
            rm "../${dst_dir}/${binary_name}"
        fi

        mv "$binary_name" "../${dst_dir}/${binary_name}"
        ln --symbolic "../${dst_dir}/${binary_name}" "$binary_name"
    done
    cd ..
done

@cameel cameel mentioned this pull request Jul 17, 2020
- This makes it a bit easier to automate release download/verification because it makes it clear where each binary type should end up in
@cameel cameel force-pushed the missing-wasm-symlink-for-release-0.6.11 branch from 0bd1197 to ab796ae Compare July 17, 2020 00:48
@cameel cameel force-pushed the only-asmjs-binaries-in-bin branch from 10409a6 to 4d114fd Compare July 17, 2020 00:48
@chriseth chriseth changed the base branch from missing-wasm-symlink-for-release-0.6.11 to gh-pages July 17, 2020 09:15
@chriseth chriseth merged commit 36f7a33 into gh-pages Jul 17, 2020
@cameel cameel deleted the only-asmjs-binaries-in-bin branch July 17, 2020 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants