-
Notifications
You must be signed in to change notification settings - Fork 416
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
Error for missing wasm32-unknown-unknown on non-rustup environments can be improved #579
Comments
looks like this is a bug in the new, not quite yet released version of wasm-pack! thanks for filing i will get right on it! |
i just ran this on my machine with the current tagged 0.7.0 (which due to some clumsiness on my part may not be the version 0.7.0 that you have @gotcha ) and got this, which is the expected behavior:
i think you are using a faulty release that i made last night/this morning. if you can give me a few minutes there should be a new one. if you uninstall and reinstall you should be all set. i'll come back here and comment when the new release is posted. |
@ashleygwilliams In the meanwhile, I checked my setup and found a mix of rust installed via |
@gotcha that's very helpful info! that being said, this release is supposed to support non-rustup setups, tho we may not have considered the multiple rusts scenario - we definitely don't want the error you got, even in the env you had, so we should try to reproduce and make sure it works. do let me know if updating your env helps! that'll be useful. either way, thanks so much for filing! |
@ashleygwilliams BTW, the script at https://rustwasm.github.io/wasm-pack/installer/ fails because it references a 0.6.1 release that does not exist. |
@ashleygwilliams With a fresh rust setup (1.33.0) with rustup, I manage to build the project. |
@ashleygwilliams This is fixed. I guess you will update https://rustwasm.github.io/ to mention 0.7.0. |
@gotcha yeah there is a small lag between when i make a release and when the installer works because of latency! glad to hear you were able to build the project! i'm going to leave this open because i want to make sure that we can work when someone has both a brew installed and rustup installed rust(s)! thanks for your diligence here and glad you got it to work! |
I reinstalled rust via |
@gotcha yup! i just had a conversation with @drager in the #wg-wasm channel on the rust discord. i will need to actually dive into the code to confirm, but my suspicion is this is what happens:
so fundamentally we are not currently guaranteeing that the rust we check for the target is the rust we use to build the project. this is because we didn't account for folks who have 2 rust setups on their machine (an edge case likely, but one we should do our best to account for)! to fix this, the user can manually install the wasm32 target, and it should work! but hopefully we can tighten up this process so we don't have to offer a manual remedy. thanks for filing this issue- it's a really interesting problem! |
Thanks for the very gentle followup ! |
Is it expected that wasm-pack only work on 32bit and 32bit compatible systems? I'm attempting to build on a system that has dropped 32bit support and is 64bit only and also does not have rustup support. I tried building off commit badbe1c, as well as off the 0.6.0 tag and the 0.7.0 tag, all failed. This was as well with the hello world example. In order: 0.6.0, 0.7.0, master zach@dev03 ~/wasm-pack-template> wasm-pack build |
@strangelittlemonkey nope- or at least i do not believe so. this seems like a different situation than this thread tho- would you mind filing a new issue? |
(i might be wrong... but just in case! don't want to lose track of it!) |
Sure, I'll make a new thread. |
For posterity sake, I'll update this with a discovery from another issue here, which is that wasm is presently 32bit and requires a 32bit system, whether that be the host or the compatibility layer, one or both must be 32bit for wasm at this time. |
@strangelittlemonkey Yes, the wasm runtime is 32-bits, but the wasm runtime is in the browser. And 64-bit browsers run 32-bit wasm runtimes natively, since that is mandated by the W3C spec. I believe that is true even on 64-bit only systems. The issue you are getting is during compile time, long before running in the browser. So I don't think it's related to the 32-bitness of wasm. |
FWIW I think this is an expected error and one that we probably want to just improve the error message in the long-term perhaps. @gotcha sounds like you had a mixup of brew-install-rust as well as rustup-installed-rust at the beginning, and I believe what happened here was that you brew-installed-rust was first in PATH which meant that the wasm target wasn't already installed and wasm-pack deduced it couldn't install it, giving an error message. What we probably want to do in this case is to improve the error message to indicate:
|
I've gone ahead and retitled this issue as well to describe what I think the issue is |
I'm currently working on a PR to improve the error message and docs for this as suggested by @alexcrichton. |
🐛 Bug description
As a newbie I am following the tutorial at https://rustwasm.github.io/book/game-of-life/hello-world.html and get errors
🤔 Expected Behavior
When building the project with
wasm-pack build
I expect no errors.👟 Steps to reproduce
then type
wasm-game-of-life
🌍 Your environment
Include the relevant details of your environment.
wasm-pack version: 0.7.0
rustc version: 1.31.0
MacOS Sierra
The text was updated successfully, but these errors were encountered: