Skip to content
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

build script does not declare dependency on COMPILING_UNDER_CARGO_WEB #275

Closed
Nemo157 opened this issue Sep 9, 2020 · 3 comments
Closed
Labels
C-bug Category: bug in current code

Comments

@Nemo157
Copy link

Nemo157 commented Sep 9, 2020

> COMPILING_UNDER_CARGO_WEB=1 cargo build --target wasm32-unknown-unknown
[...]
error[E0433]: failed to resolve: use of undeclared type or module `wasm_bindgen`
[...]

> cargo build --target wasm32-unknown-unknown
[...]
error[E0433]: failed to resolve: use of undeclared type or module `wasm_bindgen`
[...]

> cargo clean

> cargo build --target wasm32-unknown-unknown
[...]
    Finished dev [unoptimized + debuginfo] target(s) in 41.81s

Build scripts must use cargo:rerun-if-env-changed to declare the environment variables they depend on, otherwise Cargo will use the previously cached run.

From discussion on the community discord https://discord.com/channels/273534239310479360/274215136414400513/753183573145681940

@jhpratt
Copy link
Member

jhpratt commented Sep 10, 2020

Ah, my bad. I was under the interpretation that the build script was always run unless there was a "rerun-if" emitted, in which case it would trigger only when necessary.

What's the proper thing to do here? Would pushing a release with an updated build script suffice, or does the change have to be reverted? I'd like to avoid reverting if possible, since the intent behind the switch to begin with was to avoid cfg conflicts with other crates.

@jhpratt jhpratt added the C-bug Category: bug in current code label Sep 10, 2020
@Nemo157
Copy link
Author

Nemo157 commented Sep 10, 2020

The default is to only rerun if any file changes, it doesn't track environment variables at all. A new release that prints the rerun-if line should work.

@jhpratt
Copy link
Member

jhpratt commented Sep 10, 2020

Ok, thanks. I'll get a release out later today or tomorrow, as I uncovered a couple other bugs while expanding test coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug in current code
Projects
None yet
Development

No branches or pull requests

2 participants