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

Add wasm32v1-none support #541

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

daxpedda
Copy link

@daxpedda daxpedda commented Nov 21, 2024

Changes:

  • Add default-features = false to the js-sys and wasm-bindgen-test dependencies, enabling no_std support.
  • The crate feature std now enabled std crate features of wasm-bindgen, js-sys and wasm-bindgen-test.
  • Use any(target_os = "unknown", target_os = "none") instead of target_os = "unknown".
  • thread_local! is only supported with std, so a fallback to static with once_cell::unsync::Lazy is added. This is safe because Wasm doesn't support threads without target_feature = "atomics".
  • When detecting target_feature = "atomics" without feature = "std", use #[thread_local].
  • Now wasm32-unknown-unknown is properly supported without pulling in std.

I was unable to add actual no_std tests without some ugly modifications to it. Especially because of the whole harness = false thing. Let me know how you want me to proceed.

This depends on rustwasm/wasm-bindgen#4277 and a new wasm-bindgen release.

@daxpedda daxpedda force-pushed the wasm32v1-none branch 4 times, most recently from 6002c05 to 48d38ce Compare November 21, 2024 11:56
@daxpedda
Copy link
Author

Current CI failure is unrelated.

@newpavlov
Copy link
Member

The CI failures are fixed in #542.

@daxpedda daxpedda force-pushed the wasm32v1-none branch 3 times, most recently from b432d3d to f18f3b3 Compare November 25, 2024 07:48
@daxpedda
Copy link
Author

Hm, CI still has an unrelated failure.

@newpavlov
Copy link
Member

newpavlov commented Nov 25, 2024

Yes, see rust-lang/rust#133401. We may disable the GNU/Hurd job since it's not the first time the std breaks this target.

UPD: Fixed in #543.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants