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

no-std compilation breaks if target actually doesn't have std #493

Closed
lvella opened this issue May 26, 2023 · 6 comments
Closed

no-std compilation breaks if target actually doesn't have std #493

lvella opened this issue May 26, 2023 · 6 comments

Comments

@lvella
Copy link
Contributor

lvella commented May 26, 2023

Tried to build with all features disabled ("std" among them) for target riscv32imc-unknown-none-elf, which actually doesn't have std, and compilation fails in many libraries that does require std.

I may be missing something, but I don't think there is a point in having a library supporting #![no-std] if their mandatory dependencies are only available on std-enabled targets, so I guess this is a bug?

@rakita
Copy link
Member

rakita commented May 26, 2023

tried it and it does fail.

All libs have no_std but for some reason the compiler does include core traits by default.

Do you have maybe solution for this?

@rakita
Copy link
Member

rakita commented May 26, 2023

ruint does not have support for no_std, it is being worked on to support it.

@lvella
Copy link
Contributor Author

lvella commented May 26, 2023

I have spent some time trying to track down the origin of std dependency, and the following command was helpful:

cargo tree --target=riscv32imc-unknown-none-elf -e features,normal

It seems the libraries with std feature enabled were included by the dependency paths:

  • revm-interpreterrevm-primitivesruint→...
  • revm-precompileonce_cell

Unfortunately this analysis relied on crates having an std feature. It sounds simple enough, but I couldn't find a command/tool to follow the dependency tree and actually tell if each library was built with #![no-std] or not.

@lvella
Copy link
Contributor Author

lvella commented Aug 28, 2023

It seems that ruint does have no-std support now.

@rakita
Copy link
Member

rakita commented Aug 28, 2023

It seems that ruint does have no-std support now.

Here is transition to alloy that uses newest ruint lib: #617

@rakita
Copy link
Member

rakita commented Sep 28, 2023

fixed in multiple transitions but last PR was this #669

@rakita rakita closed this as completed Sep 28, 2023
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

No branches or pull requests

2 participants