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 #![no_std] #30

Merged
merged 1 commit into from
Oct 31, 2023
Merged

add #![no_std] #30

merged 1 commit into from
Oct 31, 2023

Conversation

AlexErrant
Copy link
Contributor

Hi, total Rust noobie here; please assume the worst.

Does it make sense to add #![no_std] to this lib? Adding this doesn't seem to make any tests in this lib to fail, and there seems to be previous discussions in this repo suggesting that no_std is a goal.

The reason I ask is because I'm getting the following error in a downstream dep, Burn:

  = note: `std` is required by `const_random` because it does not declare `#![no_std]`

Cloning constrandom to my local machine, updating Burn's Cargo.toml to

const-random = { path = "../constrandom" }

and running the failing CI's command (cargo build -p burn --no-default-features --target wasm32-unknown-unknown --color=always) works on my local machine (when previously I could replicate the failure locally).

@AlexErrant
Copy link
Contributor Author

Rearranging the deps in Burn resolved my error, but leaving this open in case it's still useful...?

@sleffler
Copy link

sleffler commented Oct 24, 2023

I'm trying to deal with fallout from this too.

Commit 4ef07e25a8b08153d527db84dd7f02d398ea1040 is what broke no_std support. This in turn broke my no_std usage of the hashbrown crate because I use ahash with the compile-time-rng feature which brings in const-random. (ahash pins const-random to 0.1.12 but because the maintainers yanked that version it appears the dep floats to the latest rev.)

The commit in question appears to be a cleanup so reverting it until there's a proper fix would seem to make sense. Otherwise restoring the old crate versions should work (dunno why they were purged).

@tkaitchuck tkaitchuck mentioned this pull request Oct 31, 2023
@tkaitchuck tkaitchuck merged commit 30e01d4 into tkaitchuck:master Oct 31, 2023
1 check passed
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.

3 participants