-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Switching between WASM and host target forces rebuild #8662
Comments
I was just about to file an issue for the same problem :-) It seems that we share the same "target" directory or something like that. I build with WASM and then without and compared the contents and there is a host of differences. I suppose in the past the assumption was that switching compilations targets is a rare thing (I can mostly think of cross compilation), but with WASM that changes, I'd say. Also, this is REALLY annoying if you have |
Can you set |
I think (created on not exactly the smallest crate, let me know if you need a more isolated trace on a minimal example) |
So I looked at this output and it seems as if the change in Rust flags is the issue (at least for me). I removed |
Seems to be a similar issue for me. I compile with Guess there's no easy way to fix this except for removing the flag? |
Mine now looks like: [target.'cfg(all(not(target_arch = "wasm32")), not(debug_assertions))']
rustflags = ["-C", "target-cpu=native"] For me it's sufficient because 1) so far debug build performance has been sufficient and 2) all my release builds have
anyway, so they rebuild fully regardless. But yeah, ideally having such a setting wouldn't have such a unintended consequences :-| |
Maybe Cargo could at least emit a message if such a rebuild occurs? |
Diagnosing rebuilds is the subject of #2904 |
I'm going to close this in favor of #8716, where I've summarized the state of rebuild handling of rustflags. |
Problem
I have a workspace that contains both a wasm crate and a "regular" crate. The latter includes and runs the wasm binary.
Steps
wasm-bin
andwasm-runner
Additionally there's a
.cargo/config
file in thewasm-bin
folder withI run
make wasm-runner
the first time. Both crates build.I run
make wasm-runner
a second time. Both crates rebuild even though no code has changed.Notes
cargo version
:cargo 1.47.0-beta (51b66125b 2020-08-19)
The text was updated successfully, but these errors were encountered: