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

wasm-bindgen no longer works with feature resolver version 1 #4304

Open
dtolnay opened this issue Nov 30, 2024 · 7 comments
Open

wasm-bindgen no longer works with feature resolver version 1 #4304

dtolnay opened this issue Nov 30, 2024 · 7 comments
Labels

Comments

@dtolnay
Copy link

dtolnay commented Nov 30, 2024

$ cargo +stable new repro --edition=2018
$ cd repro
$ cargo +stable add wasm-bindgen@=0.2.96   # =0.2.95 works
$ cargo +stable check
...
error[E0554]: `#![feature]` may not be used on the stable release channel
 --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasm-bindgen-macro-0.2.96/src/lib.rs:4:5
  |
4 |     feature(allow_internal_unstable),
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
For more information about this error, try `rustc --explain E0554`.
error: could not compile `wasm-bindgen-macro` (lib) due to 1 previous error

$ rustc +stable --version --verbose
rustc 1.83.0 (90b35a623 2024-11-26)
binary: rustc
commit-hash: 90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf
commit-date: 2024-11-26
host: x86_64-unknown-linux-gnu
release: 1.83.0
LLVM version: 19.1.1
@dtolnay dtolnay added the bug label Nov 30, 2024
@dtolnay
Copy link
Author

dtolnay commented Nov 30, 2024

Bisects to 83c9deb (#4284). @daxpedda

@daxpedda
Copy link
Collaborator

I added a CI check so this doesn't happen again.
Fixed in #4306.

@daxpedda
Copy link
Collaborator

So I had to dig into this a bit more, because apparently no [target.'cfg(...)'.dependencies] table worked correctly unless specifying the target. So that means no target_feature and no cfg flag. I found out that the issue can be solved by just using resolver = "2".

While I was working in #4306 to fix this issue without requiring resolver = "2", there are some interactions that can't be easily addressed and overall it makes the situation much worse. So I'm tending towards just requiring resolver = "2".

Any input would be appreciated!

@daxpedda daxpedda pinned this issue Nov 30, 2024
@daxpedda daxpedda changed the title Wasm-bindgen-macro no longer compiles on stable Rust wasm-bindgen no longer works with feature resolver version 1 Nov 30, 2024
andrei-ng added a commit to plotly/plotly.rs that referenced this issue Nov 30, 2024
 - bump edition to 2021 (implies default resolver 2)
   - also implies resolver 2 to bypass latest wasm-bindgen bug: rustwasm/wasm-bindgen#4304
 - remove patch versioning from all dependencies

Signed-off-by: Andrei Gherghescu <[email protected]>
andrei-ng added a commit to plotly/plotly.rs that referenced this issue Nov 30, 2024
 - bump edition to 2021
   - set resolver to 2 to bypasses latest wasm-bindgen bug: rustwasm/wasm-bindgen#4304
 - remove patch versioning from all dependencies

Signed-off-by: Andrei Gherghescu <[email protected]>
andrei-ng added a commit to plotly/plotly.rs that referenced this issue Nov 30, 2024
 - bump edition to 2021
   - set resolver to 2 to bypasses latest wasm-bindgen bug: rustwasm/wasm-bindgen#4304
 - remove patch versioning from all dependencies

Signed-off-by: Andrei Gherghescu <[email protected]>
andrei-ng added a commit to plotly/plotly.rs that referenced this issue Nov 30, 2024
 - bump edition to 2021
   - set resolver to 2 to bypasses latest wasm-bindgen bug: rustwasm/wasm-bindgen#4304
 - remove patch versioning from all dependencies

Signed-off-by: Andrei Gherghescu <[email protected]>
andrei-ng added a commit to plotly/plotly.rs that referenced this issue Nov 30, 2024
 - bump edition to 2021
   - set resolver to 2 to bypasses latest wasm-bindgen bug: rustwasm/wasm-bindgen#4304
 - remove patch versioning from all dependencies

Signed-off-by: Andrei Gherghescu <[email protected]>
andrei-ng added a commit to plotly/plotly.rs that referenced this issue Nov 30, 2024
 - bump edition to 2021
   - set resolver to 2 to bypasses latest wasm-bindgen bug: rustwasm/wasm-bindgen#4304
 - remove patch versioning from all dependencies

Signed-off-by: Andrei Gherghescu <[email protected]>
andrei-ng added a commit to plotly/plotly.rs that referenced this issue Nov 30, 2024
 - bump edition to 2021
   - set resolver to 2 to bypasses latest wasm-bindgen bug: rustwasm/wasm-bindgen#4304
 - remove patch versioning from all dependencies

Signed-off-by: Andrei Gherghescu <[email protected]>
andrei-ng added a commit to plotly/plotly.rs that referenced this issue Nov 30, 2024
 - bump edition to 2021
   - set resolver to 2 to bypasses latest wasm-bindgen bug: rustwasm/wasm-bindgen#4304
 - remove patch versioning from all dependencies

Signed-off-by: Andrei Gherghescu <[email protected]>
@mxsrm
Copy link

mxsrm commented Dec 1, 2024

You are breaking a lot of crates that depend on things like chrono (which depend on you), if the crates are using resolver version 1. Please revert the changes and publish a new hotfixed version that does not break ecosystemwide crates?

v0.2.97 is still affected:

❯ cargo build --release
warning: no edition set: defaulting to the 2015 edition while the latest is 2021
   Compiling wasm-bindgen-shared v0.2.97
   Compiling log v0.4.22
   Compiling bumpalo v3.16.0
   Compiling wasm-bindgen v0.2.97
   Compiling rav1e v0.7.1
   Compiling syn v2.0.90
   Compiling getrandom v0.2.15
   Compiling wasm-bindgen-backend v0.2.97
   Compiling thiserror-impl v1.0.69
   Compiling serde_derive v1.0.215
   Compiling profiling-procmacros v1.0.16
   Compiling arg_enum_proc_macro v0.3.4
   Compiling num-derive v0.4.2
   Compiling zerocopy-derive v0.7.35
   Compiling thiserror-impl v2.0.3
   Compiling displaydoc v0.2.5
   Compiling wasm-bindgen-macro-support v0.2.97
   Compiling profiling v1.0.16
   Compiling zerocopy v0.7.35
   Compiling thiserror v1.0.69
   Compiling pest v2.7.14
   Compiling wasm-bindgen-macro v0.2.97
error[E0554]: `#![feature]` may not be used on the stable release channel
 --> /home/max/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasm-bindgen-macro-0.2.97/src/lib.rs:4:5
  |
4 |     feature(allow_internal_unstable),
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0554`.
error: could not compile `wasm-bindgen-macro` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

@ozabalaferrera
Copy link

I'm not sure I fully understand what's going on here, but it seems like this is also the cause for this failed test/build:
https://github.com/cloudevents/sdk-rust/actions/runs/12123953925/job/33800591907
Does that seem right? Any updates on this issue?

@smoelius
Copy link

smoelius commented Dec 3, 2024

@ozabalaferrera
Copy link

@smoelius, I don't think that worked for me. I also had tried setting resolver="2". here is the commit and test results: ozabalaferrera/cloudevents-sdk-rust@0972757

meili-bors bot added a commit to meilisearch/meilisearch-rust that referenced this issue Dec 3, 2024
623: Use resolver = "2" r=Kerollmops a=dureuill

Fixes `cargo test` on stable

Context: rustwasm/wasm-bindgen#4304

Co-authored-by: Louis Dureuil <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants