-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Internal compiler error: building dynamic library is unsupported on Emscripten #67782
Comments
Seems like this is just a panic that should instead be a fatal error |
@jonas-schievink hmm, but does that mean if I'd like to use a lib which specifies itself as a dynamic lib using |
No, only the cases causing the ICE will instead report a normal error. But it looks like the panic was never supposed to be reached in the first place, so there might be an additional bug. |
Ah, OK, makes sense. Thanks for the clarification! |
triage: P-medium, at least to get rid of the ICE and have it signal a fatal error instead. (But the note about there being a potential additional bug does make me wonder what else may be happening here.) |
@pnkfelix @jonas-schievink If it's not a nuisance to you guys, with some mentoring/guidance, I'd be more than happy than to dig in into the compiler and narrow down the cause and, hopefully, help out in providing a fix for this. |
This is happening to me when building the instant crate for wasm32-unknown-emscripten. What should crate authors do for portability to emscripten? |
This is happening to me as well in a project that creates both a binary and libraries. The definition in cargo.toml is like this:
Is there any way to tell |
There's an implicit dependency to instant, which in turn requires a patch to work around rust-lang/rust#67782
This seems to have been fixed (or at least changed) via #71804 so that it no longer errors. |
Triage: No error at all, or just no ICE? Would be great if someone could provide update step-by-step instructions on how to reproduce. When I try I get unrelated build errors: git clone https://github.com/kubkon/wasmtime.git wasmtime-kubkon
cd wasmtime-kubkon
git checkout origin/js-poly
cd crates/wasi-common/js-polyfill
./build.sh
|
You probably need to do |
Hi, I won't be of much help sadly as I have effectively moved on from Wasm and directed my focus elsewhere. I am happy to leave the issue open however given that more folks have also experienced this issue. |
Hello, no worries! I totally understand. I agree that the ideal way forward is to keep this issue open until the underlying problem is fixed (or confirmed fixed already) and a regression test has been added (or confirmed added already). However, without a way to reproduce the original ICE, there is no feasible way to bisect/investigate. Thanks to the hint from bjorn3 I got a bit longer in running ./build.sh: docker run -it ubuntu:23.04
What adjustments do I need to make to the above commands to reproduce the original ICE? Use an older nightly I suppose, but which one, and configured how? ./build.sh also needs to be changed because now it is hardcoded to use When I run the above commands I get a bunch of errors but no ICE. The first errors are:
|
Triage: Closing as not reproducible. Feel free to reopen if a way for others to reproduce is found! |
Apologies if this is a duplicate, but I couldn't find a similar issue. Anyhow, the issue appears to be caused when trying to build for
wasm32-unknown-emscripten
target and including a lib crate withcrate-type = ["rlib", "staticlib", "cdylib"]
causes the following compiler panic:After further investigation, removing the
cdylib
fromcrate-type
removes the error.The weird thing is that this issue only seems to appear when building the main crate with
cargo rustc
instead ofcargo build
(the reason here involved passing in additional compiler flags). Also, the issue seems to concern all toolchains: 1.40.0-stable, 1.41.0-beta and 1.42.0-nightly.Anyhow, the error can be replicated by running a
build.sh
script in wasmtime/crates/wasi-common/js-polyfill crate. For reference, the PR introducing this bit of functionality intowasmtime
is bytecodealliance/wasmtime#720.The text was updated successfully, but these errors were encountered: