-
Notifications
You must be signed in to change notification settings - Fork 67
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
Unable build to wasm32-unknown-unknown target on macos #93
Comments
There's a long discussion at mlua-rs/mlua#23 . basically, c bindings crates cannot be compiled to wasm. so, the best alternative is to wait for a pure rust impl of JS like |
Yes, also some discussions on Tracking issue for the unstable "wasm" ABI. The |
are there any public benchmarks for Boa? |
unofficial benchmark boa-dev/boa#1924 (comment) And the same benchmark for quickjs here https://bellard.org/quickjs/bench.html |
Sorry, are you saying that rquickjs doesn't work with Wasm at all? I'm using another QuickJS bindings crate and it works with Wasm, though is more immature. I was in the process of switching to rquickjs and just ran into this. Please help me understand. |
As But, you can probably compile this to Both idk what quickjs bindings you were using in the past though. if you were targeting |
We are in a non-browser wasm32-wasi environment, currently using https://crates.io/crates/quickjs-wasm-rs Are you staying that rquickjs could be used in place of quickjs-wasm-rs now or in the future? We have everything working, we just want to swap out bindings for rquickjs. |
It should be possible to use rquickjs on wasm32-wasi. But it would probably be hard to get it setup for the first time. you will need to see how quickjs-wasm-rs people build quickjs https://github.com/bytecodealliance/javy/blob/main/crates/quickjs-wasm-sys/build.rs and try to do the same for rquickjs. |
I added WASI support here #245 |
WASI support is now merged, but we won't support wasm-unknown-unknown for the foreseeable future as there is no way to link a libc required for QuickJS. I'll leave this issue open for if this ever changes but mark it as won't fix for now. |
The following warnings were emitted during compilation:
warning: /workspace/quickjs-binding/target/wasm32-unknown-unknown/debug/build/rquickjs-sys-4f6d692d8e0606a0/out/libregexp.c:24:10: fatal error: 'stdlib.h' file not found
warning: #include <stdlib.h>
warning: ^~~~~~~~~~
warning: 1 error generated.
error: failed to run custom build command for
rquickjs-sys v0.1.7
Caused by:
process didn't exit successfully:
/workspace/quickjs-binding/target/debug/build/rquickjs-sys-0833c19788412099/build-script-build
(exit status: 1)--- stdout
cargo:rerun-if-changed=build.rs
cargo:rerun-if-env-changed=CARGO_FEATURE_EXPORTS
cargo:rerun-if-env-changed=CARGO_FEATURE_BINDGEN
cargo:rerun-if-env-changed=CARGO_FEATURE_UPDATE_BINDINGS
cargo:rerun-if-env-changed=CARGO_FEATURE_DUMP_BYTECODE
cargo:rerun-if-env-changed=CARGO_FEATURE_DUMP_GC
cargo:rerun-if-env-changed=CARGO_FEATURE_DUMP_GC_FREE
cargo:rerun-if-env-changed=CARGO_FEATURE_DUMP_FREE
cargo:rerun-if-env-changed=CARGO_FEATURE_DUMP_LEAKS
cargo:rerun-if-env-changed=CARGO_FEATURE_DUMP_MEM
cargo:rerun-if-env-changed=CARGO_FEATURE_DUMP_OBJECTS
cargo:rerun-if-env-changed=CARGO_FEATURE_DUMP_ATOMS
cargo:rerun-if-env-changed=CARGO_FEATURE_DUMP_SHAPES
cargo:rerun-if-env-changed=CARGO_FEATURE_DUMP_MODULE_RESOLVE
cargo:rerun-if-env-changed=CARGO_FEATURE_DUMP_PROMISE
cargo:rerun-if-env-changed=CARGO_FEATURE_DUMP_READ_OBJECT
Appliyng patch patches/check_stack_overflow.patch
patching file quickjs.c
Appliyng patch patches/infinity_handling.patch
patching file quickjs.c
Hunk #1 succeeded at 10235 (offset 44 lines).
Hunk #2 succeeded at 41732 (offset 168 lines).
Hunk #3 succeeded at 47839 (offset 168 lines).
Appliyng patch patches/atomic_new_class_id.patch
patching file quickjs.c
Hunk #1 succeeded at 3371 (offset 18 lines).
Appliyng patch patches/read_module_exports.patch
patching file quickjs.c
Hunk #1 succeeded at 27254 (offset 93 lines).
patching file quickjs.h
Hunk #1 succeeded at 1039 (offset 4 lines).
TARGET = Some("wasm32-unknown-unknown")
OPT_LEVEL = Some("0")
HOST = Some("x86_64-apple-darwin")
CC_wasm32-unknown-unknown = None
CC_wasm32_unknown_unknown = None
TARGET_CC = None
CC = None
CFLAGS_wasm32-unknown-unknown = None
CFLAGS_wasm32_unknown_unknown = None
TARGET_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
running: "clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "--target=wasm32-unknown-unknown" "-Wall" "-D_GNU_SOURCE" "-DCONFIG_VERSION="2020-01-19"" "-DCONFIG_BIGNUM" "-DCONFIG_MODULE_EXPORTS" "-o" "/workspace/quickjs-binding/target/wasm32-unknown-unknown/debug/build/rquickjs-sys-4f6d692d8e0606a0/out/libregexp.o" "-c" "/workspace/quickjs-binding/target/wasm32-unknown-unknown/debug/build/rquickjs-sys-4f6d692d8e0606a0/out/libregexp.c"
cargo:warning=/workspace/quickjs-binding/target/wasm32-unknown-unknown/debug/build/rquickjs-sys-4f6d692d8e0606a0/out/libregexp.c:24:10: fatal error: 'stdlib.h' file not found
cargo:warning=#include <stdlib.h>
cargo:warning= ^~~~~~~~~~
cargo:warning=1 error generated.
exit status: 1
--- stderr
error occurred: Command "clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "--target=wasm32-unknown-unknown" "-Wall" "-D_GNU_SOURCE" "-DCONFIG_VERSION="2020-01-19"" "-DCONFIG_BIGNUM" "-DCONFIG_MODULE_EXPORTS" "-o" "/workspace/quickjs-binding/target/wasm32-unknown-unknown/debug/build/rquickjs-sys-4f6d692d8e0606a0/out/libregexp.o" "-c" "/workspace/quickjs-binding/target/wasm32-unknown-unknown/debug/build/rquickjs-sys-4f6d692d8e0606a0/out/libregexp.c" with args "clang" did not execute successfully (status code exit status: 1).
warning: build failed, waiting for other jobs to finish...
Process finished with exit code 101
The text was updated successfully, but these errors were encountered: