Skip to content

Commit

Permalink
feat!: Update binaryen to version_108 (#62)
Browse files Browse the repository at this point in the history
chore: Add automatic binaryen.js building to CI
chore!: Change js_of_ocaml binding to Binaryen
chore!: Avoid building tools
chore: Rebuild binaryen.es5.js

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
phated and github-actions[bot] committed Jun 24, 2022
1 parent 669354c commit 1e69a07
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 67 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/js.yml
@@ -0,0 +1,60 @@
name: Generate Binaryen.js
on:
- push

jobs:
build:
name: "Build with emsdk"
runs-on: ubuntu-latest

steps:
- name: Setup node.js
uses: actions/setup-node@v2.1.2
with:
node-version: '16'
check-latest: true

- name: "Set up emsdk"
run: |
mkdir $HOME/emsdk
git clone --depth 1 https://github.com/emscripten-core/emsdk.git $HOME/emsdk
$HOME/emsdk/emsdk update-tags
$HOME/emsdk/emsdk install tot
$HOME/emsdk/emsdk activate tot
echo "$HOME/emsdk" >> $GITHUB_PATH
- name: "Set up CMake"
run: |
mkdir $HOME/cmake
wget -qO- https://github.com/Kitware/CMake/releases/download/v3.21.4/cmake-3.21.4-Linux-x86_64.tar.gz | tar -xzC $HOME/cmake --strip-components 1
echo "$HOME/cmake/bin" >> $GITHUB_PATH
- name: Checkout project
uses: actions/checkout@v2
with:
submodules: 'recursive'

- name: "Build binaryen.es5.js"
run: |
mkdir ./binaryen/build
cd ./binaryen/build
source $HOME/emsdk/emsdk_env.sh
emcc --version
emcmake cmake .. -DCMAKE_BUILD_TYPE=Release -DJS_OF_OCAML=ON -DBUILD_TOOLS=OFF -DBUILD_TESTS=OFF
emmake make -j2 binaryen_js
cd ../..
mv ./binaryen/build/bin/binaryen_js.js binaryen.es5.js
# Setup a "bot" name & email for our commit step
# using the GitHub Actions bot user: https://github.community/t/github-actions-bot-email-address/17204/6
- name: Configure git
run: |
git config --global user.name github-actions[bot]
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
# Only commit if there's a change. Ref https://stackoverflow.com/a/8123841
- name: Commit binaryen.es5.js
run: |
git add binaryen.es5.js
git diff-index --quiet HEAD || git commit -m 'chore: Rebuild binaryen.es5.js'
git push
2 changes: 1 addition & 1 deletion binaryen
Submodule binaryen updated 76 files
+2 −0 .github/workflows/create_release.yml
+7 −0 CHANGELOG.md
+44 −7 CMakeLists.txt
+5 −4 scripts/fuzz_opt.py
+1 −0 scripts/gen-s-parser.py
+0 −8 scripts/wasm2js.js
+0 −3 src/asmjs/asm_v_wasm.cpp
+2 −3 src/binaryen-c.cpp
+11 −3 src/gen-s-parser.inc
+0 −2 src/ir/abstract.h
+4 −0 src/ir/branch-utils.h
+6 −0 src/js/binaryen.jsoo-extern-pre.js
+3 −5 src/literal.h
+0 −1 src/passes/ConstHoisting.cpp
+0 −2 src/passes/FuncCastEmulation.cpp
+4 −20 src/passes/InstrumentLocals.cpp
+5 −1 src/passes/Print.cpp
+9 −0 src/passes/SignaturePruning.cpp
+11 −7 src/passes/StackCheck.cpp
+58 −66 src/tools/fuzzing/fuzzing.cpp
+0 −6 src/tools/fuzzing/heap-types.cpp
+0 −3 src/tools/spec-wrapper.h
+0 −5 src/tools/wasm-reduce.cpp
+12 −10 src/wasm-binary.h
+4 −3 src/wasm-builder.h
+1 −3 src/wasm-interpreter.h
+1 −0 src/wasm-s-parser.h
+4 −7 src/wasm-type.h
+5 −0 src/wasm.h
+1 −19 src/wasm/literal.cpp
+45 −23 src/wasm/wasm-binary.cpp
+10 −7 src/wasm/wasm-s-parser.cpp
+5 −4 src/wasm/wasm-stack.cpp
+2 −15 src/wasm/wasm-type.cpp
+4 −7 src/wasm/wasm-validator.cpp
+9 −9 test/binaryen.js/kitchen-sink.js.txt
+2 −2 test/ctor-eval/bad-indirect-call3.wast.out
+7 −7 test/example/c-api-kitchen-sink.txt
+2 −2 test/example/stack-utils.cpp
+3 −4 test/example/type-builder-nominal.cpp
+4 −4 test/example/type-builder-nominal.txt
+0 −1 test/example/type-builder.cpp
+4 −19 test/example/typeinfo.cpp
+4 −9 test/example/typeinfo.txt
+11 −11 test/gtest/type-builder.cpp
+27 −0 test/lit/binary/prototype-nominal-format.test
+ test/lit/binary/prototype-nominal-format.test.wasm
+18 −18 test/lit/fuzz-types/isorecursive.test
+13 −15 test/lit/fuzz-types/nominal.test
+14 −16 test/lit/fuzz-types/structural.test
+18 −22 test/lit/passes/flatten_all-features.wast
+7 −13 test/lit/passes/instrument-locals_all-features_disable-typed-function-references.wast
+4 −4 test/lit/passes/optimize-instructions-gc.wast
+18 −0 test/lit/passes/signature-refining.wast
+93 −0 test/lit/passes/stack-check-memory64.wast
+18 −0 test/lit/ref-cast-nop.wast
+1 −1 test/lld/basic_safe_stack.s
+1 −1 test/multi-table.wast.from-wast
+1 −1 test/multi-table.wast.fromBinary
+1 −1 test/multi-table.wast.fromBinary.noDebugInfo
+5 −5 test/multivalue.wast.from-wast
+6 −6 test/multivalue.wast.fromBinary
+6 −6 test/multivalue.wast.fromBinary.noDebugInfo
+6 −6 test/passes/precompute_all-features.txt
+4 −4 test/passes/simplify-globals_all-features.txt
+1 −1 test/passes/simplify-locals_all-features.txt
+2 −2 test/passes/sparse_matrix_liveness.bin.txt
+0 −0 test/passes/sparse_matrix_liveness.passes
+ test/passes/sparse_matrix_liveness.wasm
+4 −4 test/passes/strip-target-features_roundtrip_print-features_all-features.txt
+26 −36 test/passes/translate-to-fuzz_all-features_metrics_noprint.txt
+49 −51 test/reference-types.wast.from-wast
+48 −50 test/reference-types.wast.fromBinary
+89 −91 test/reference-types.wast.fromBinary.noDebugInfo
+ test/unit/input/gc_target_feature.wasm
+5 −5 test/unit/test_features.py
101 changes: 37 additions & 64 deletions binaryen.es5.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dune
Expand Up @@ -41,6 +41,7 @@
"Unix Makefiles"
-DCMAKE_CXX_FLAGS=-Wno-unused-variable
-DBUILD_TESTS=OFF
-DBUILD_TOOLS=OFF
-DBUILD_STATIC_LIB=ON
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=binaryen)
Expand All @@ -67,6 +68,7 @@
"Unix Makefiles"
-DCMAKE_CXX_FLAGS=-Wno-unused-variable
-DBUILD_TESTS=OFF
-DBUILD_TOOLS=OFF
-DBUILD_STATIC_LIB=OFF
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=binaryen)
Expand Down Expand Up @@ -95,6 +97,7 @@
"Unix Makefiles"
-DCMAKE_CXX_FLAGS=-Wno-unused-variable
-DBUILD_TESTS=OFF
-DBUILD_TOOLS=OFF
-DBUILD_STATIC_LIB=OFF
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=binaryen)
Expand All @@ -121,6 +124,7 @@
"Unix Makefiles"
-DCMAKE_CXX_FLAGS=-Wno-unused-variable
-DBUILD_TESTS=OFF
-DBUILD_TOOLS=OFF
-DCMAKE_SHARED_LIBRARY_PREFIX_CXX=lib
-DBUILD_STATIC_LIB=OFF
-DCMAKE_BUILD_TYPE=Release
Expand Down
4 changes: 2 additions & 2 deletions test/types.js
@@ -1,5 +1,5 @@
//Provides: caml_binaryen_type_none
//Requires: binaryen
//Requires: Binaryen
function caml_binaryen_type_none() {
return binaryen.none;
return Binaryen.none;
}

0 comments on commit 1e69a07

Please sign in to comment.