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

Fix build for wasm32/64-unknown-unknown without std #1528

Merged
merged 4 commits into from
Feb 15, 2024

Conversation

gshep
Copy link
Contributor

@gshep gshep commented Feb 15, 2024

fixes #1527

};
#![cfg_attr(not(std), no_std)]

extern crate alloc;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only need alloc conditionally imported here

Suggested change
extern crate alloc;
#[cfg(not(feature = "parallel"))]
extern crate alloc;

serde_json = "1.0"
serde_json = { version = "1.0", default-features = false, features = ["alloc"] }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually should be moved to [dev-dependencies], it's not being used by the library (hence why it compiles fine against wasm targets), only by the fibonacci_serialization example which does require std anyway.

@gshep gshep requested a review from Nashtare February 15, 2024 13:51
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link
Collaborator

@Nashtare Nashtare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for fixing this!

@Nashtare Nashtare merged commit 8753162 into 0xPolygonZero:main Feb 15, 2024
5 checks passed
@muraca
Copy link
Contributor

muraca commented Feb 15, 2024

I authored #1335 and I casually noticed this PR. I think maybe_rayon and all the other crates that should support wasm32 should be added to the CI checks.

@Nashtare
Copy link
Collaborator

Yeah I've been telling myself this as well seeing this behavior. Will do shortly.

@gshep gshep deleted the gshep/maybe_rayon-no_std branch February 15, 2024 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Failed to build for wasm32-unknown-unknown with no_std
3 participants