-
Notifications
You must be signed in to change notification settings - Fork 734
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Imports from "env" getting into Wasm artifact #2345
Comments
This is a symptom of not linking the C code, as these functions are defined in C. This might be because you are using an old version of wasm_bindgen? Or maybe we are using too old of a wasm_bindgen in CI and if we upgraded ours then we'd have the same issue? |
Which version of Rust are and which version of wasm-bindgen are you using? Could you try different versions and report back? |
Using Rust 1.80.1 and |
Did you set TARGET_CC to a wasm32-capable compiler? |
Ok, I tried inside a docker container and it works fine actually. It seems that this is an issue with my distro being weird. Sorry for the noise and thank you for the guidance. |
Thanks for reporting back! |
Found in mthom/scryer-prolog#2819.
Compiling any crate with dependencies on
ring
(withwasm32_unknown_unknown_js
feature) towasm32-unknown-unknown
leaves 2 functions imported from"env"
.wasm-tools print artifact.wasm | grep '"env"'
gives:I found both functions in the code. The problem seems to be that it links with an assembly version if it exists, and with the current
#[cfg]
attributes it seems to think thatwasm32
has an assembly implementation of both of these. Adding atarget_arch = "wasm32"
term to the relevant attributes seems to fix this.I have no idea why this isn't caught by CI.
The text was updated successfully, but these errors were encountered: