-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
wasm-pack example doesn't compile #122333
Comments
Does it stil crash if you remove |
Hey @bjorn3, yes, it still crashes. Here is the repo I'm working with: https://github.com/tstachl/wasm-game-of-life Also, I'm using nix to setup the development environment for this project. |
A reproducer that doesn't involve Nix would really help in debugging this. |
The reproducer is actually quite brutally simple. With the following Rust code: fn main() {} So note it must be a binary, not a library... Run this: |
Yay, a cdylib also works! |
I think this ICEs on all targets that don't use gcc or clang as linker. And on non-apple targets that use gcc or clang as linker I think it will result in the linker giving an error about an unsupported flag. |
My understanding of frameworks and deployment targets is that macOS hosts should be making the frameworks they pass dependent on their actual build/deployment target (which may differ from the host's Apple SDK!), so it would make sense to also avoid passing in frameworks when building for wasm. I think thus that the rejection is not a bug but the ICE is, as we need to issue actual diagnostics instead. |
This is common in that part of the compiler. There are 6 And there are 2 in |
I suppose one could argue "that should be handled earlier" so things like my "try to get |
I slept on this twice. I initially persuaded myself that "yeah, we should check for frameworks and stop this before it even gets that far". But then I thought about the "real issue" here: the real issue is that you may ask for us to use a linker that can't support the target's demands. In this case, the target also asks for a specific linker by default, but I think if someone makes a really interesting set of demands, they will manage to find a way to slip through our "defenses", thus it's fine to let the linker-driver impl sort this out. |
Code
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: