google / j2cl

Java to Closure JavaScript transpiler
Apache License 2.0
1.23k stars 144 forks source link

Wasm sample broken #179

Closed sdeleuze closed 1 year ago

sdeleuze commented 1 year ago

When I try to compile the Wasm sample with bazel run samples/wasm/src/main/java/com/google/j2cl/samples/wasm:jsapp_dev_server, I get the following error:

ERROR: /home/seb/wasm/j2cl/samples/wasm/src/main/java/com/google/j2cl/samples/wasm/BUILD:38:19: Compiling to WASM (stage 1) failed: (Exit 1): binaryen failed: error executing command bazel-out/k8-opt-exec-2B5CBBC6/bin/third_party/binaryen --enable-exception-handling --enable-gc --enable-reference-types --enable-sign-ext --enable-strings --enable-nontrapping-float-to-int --nominal ... (remaining 11 arguments skipped)
Unknown option '--closed-world'

Binarien 111 which is the latest version seems to be used as expected:

bazel-out/k8-opt-exec-2B5CBBC6/bin/third_party/binaryen --version
wasm-opt version 111

Any chance this could be fixed?

rluble commented 1 year ago

I think --closed-world is not in the latest released version of binaryen and was added to the binaryen later. You can either build binaryen from source or remove the flag from j2wasm_application.bzl:219.

See #174

sdeleuze commented 1 year ago

Thanks for your feedback.

The sampe has been fixed by Binaryen 112 kindly released by @kripken after this discussion on Twitter.

As a consequence, I close this issue.