Skip to content

Commit 29b14a0

Browse files
feat!: Upgrade to Binaryen v127 (#155)
* feat!: Upgrade to Binaryen v128 * chore: Rebuild binaryen.es5.js * chore: try to fix windows ci error * chore: Scope git diff to `./binaryen.es5.js` * chore: Update opam jsoo version --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent a338977 commit 29b14a0

44 files changed

Lines changed: 1184 additions & 969 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/esy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ concurrency:
99
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}
1010
cancel-in-progress: true
1111

12+
env:
13+
ESY__PREFIX: ${{ github.workspace }}/.esy/
14+
1215
jobs:
1316
build:
1417
name: Build and test

.github/workflows/js.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,17 @@ jobs:
4040
with:
4141
submodules: "recursive"
4242

43+
- name: Patch binaryen
44+
run: |
45+
git apply ./binaryen.patch
46+
4347
- name: "Build binaryen.es5.js"
4448
run: |
4549
mkdir ./binaryen/build
4650
cd ./binaryen/build
4751
source $HOME/emsdk/emsdk_env.sh
4852
emcc --version
49-
emcmake cmake .. -DCMAKE_BUILD_TYPE=Release -DJS_OF_OCAML=ON -DBUILD_TOOLS=OFF -DBUILD_TESTS=OFF
53+
emcmake cmake .. -DCMAKE_BUILD_TYPE=Release -DEMSCRIPTEN_ENABLE_SINGLE_FILE=ON -DJS_OF_OCAML=ON -DBUILD_TOOLS=OFF -DBUILD_TESTS=OFF
5054
emmake make -j2 binaryen_js
5155
cd ../..
5256
mv ./binaryen/build/bin/binaryen_js.js binaryen.es5.js
@@ -62,5 +66,5 @@ jobs:
6266
- name: Commit binaryen.es5.js
6367
run: |
6468
git add binaryen.es5.js
65-
git diff-index --quiet HEAD || git commit -m 'chore: Rebuild binaryen.es5.js'
69+
git diff-index --quiet HEAD -- ./binaryen.es5.js || git commit -m 'chore: Rebuild binaryen.es5.js'
6670
git push

binaryen

Submodule binaryen updated 293 files

binaryen.es5.js

Lines changed: 374 additions & 399 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

binaryen.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--- a/binaryen/CMakeLists.txt
2+
+++ b/binaryen/CMakeLists.txt
3+
@@ -550,8 +550,8 @@ if(EMSCRIPTEN)
4+
if(JS_OF_OCAML)
5+
# js_of_ocaml needs a specified variable with special comment to provide the library to consumer
6+
target_link_libraries(binaryen_js PRIVATE "--extern-pre-js=${CMAKE_CURRENT_SOURCE_DIR}/src/js/binaryen.jsoo-extern-pre.js")
7+
- # Currently, js_of_ocaml can only process ES5 code
8+
- target_link_libraries(binaryen_js PRIVATE optimized "--closure-args=\"--language_out=ECMASCRIPT5\"")
9+
+ # js_of_ocaml does not support top level await
10+
+ target_link_libraries(binaryen_js PRIVATE "-sWASM_ASYNC_COMPILATION=0")
11+
else()
12+
target_link_libraries(binaryen_js PRIVATE "-sEXPORT_ES6")
13+
endif()

dune

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,5 @@
138138
-DCMAKE_INSTALL_PREFIX=binaryen)
139139
(run cmake --build binaryen --config Release -- -j4)
140140
(copy binaryen/bin/libbinaryen.dll dllbinaryen.dll)))))
141+
142+
(data_only_dirs node_modules)

0 commit comments

Comments
 (0)