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

Emscripten releases #40

Merged
merged 4 commits into from
Jul 17, 2020
Merged

Emscripten releases #40

merged 4 commits into from
Jul 17, 2020

Conversation

cameel
Copy link
Member

@cameel cameel commented Jul 17, 2020

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

This PR puts those emscripten releases that already exist in the repo into a new directory structure:

  • I created symlinks from the new directories to bin/ and wasm/ and not the other way around because otherwise excluding the new directories from Jekyll config would result in errors (link targets would not exist in the rendered version).
  • There are no soljson versions on github release pages that would not already be in solc-bin - so this PR just adds links.
  • In two cases files in the repo and on the release pages differ:
    1. asm.js builds of v0.2.0, v0.2.1 and v0.4.11 are not byte-for-byte identical and the sizes differ slightly.
    2. asm.js and wasm builds of v0.4.11, v0.5.9 and v0.5.11 come from a different commit than the ones on the release page (as reported in Version build discrepancy vs. canonical list (v0.5.11 and others) solidity#7512).

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

cameel commented Jul 17, 2020

Here's the one-off script I used to create symlinks and verify that each directory contains the right 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 bin_dir in bin wasm; do
    cd "$bin_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 [[ $bin_dir == wasm ]]; then
            is_wasm "$binary_name" || { echo "ERROR: Found non-wasm binary in wasm/: ${bin_dir}/${binary_name}"; exit 1; }
            link_location="emscripten-wasm32/solc-emscripten-wasm32-${full_version}.js"
        else
            ! is_wasm "$binary_name" || { echo "ERROR: Found non-asm.js binary in bin/: ${bin_dir}/${binary_name}"; exit 1; }
            link_location="emscripten-asmjs/solc-emscripten-asmjs-${full_version}.js"
        fi

        mkdir -p "$(dirname "../$link_location")"
        ln --symbolic "../${bin_dir}/${binary_name}" "../$link_location"
        printf "%-40s -> %s\n" "$link_location" "${bin_dir}/${binary_name}"
    done
    cd ..
done

@chriseth chriseth changed the base branch from only-asmjs-binaries-in-bin to gh-pages July 17, 2020 09:24
@chriseth chriseth merged commit 310d3ad into gh-pages Jul 17, 2020
@cameel cameel deleted the emscripten-releases 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