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

Can't compile in no std environment #49

Closed
samuel-schuepbach opened this issue Apr 11, 2020 · 4 comments · Fixed by #50
Closed

Can't compile in no std environment #49

samuel-schuepbach opened this issue Apr 11, 2020 · 4 comments · Fixed by #50

Comments

@samuel-schuepbach
Copy link

samuel-schuepbach commented Apr 11, 2020

I tried using the graphlib on a embedded project I'm working on, but failed to compile it due to dependencies to the std crate.

For reproducibility, I set up the environment the same as described in the embedded rust book: https://docs.rust-embedded.org/book/start/qemu.html

The std features should be disabled:

[dependencies]
graphlib = {version = "0.6.1", features = ["no_std"]}

When compiled with:

cargo +nightly build --target thumbv7m-none-eabi

I got the following error:

   Compiling lazy_static v1.4.0
   Compiling hex v0.4.2
   Compiling num_cpus v1.12.0
   Compiling ahash v0.2.18
error[E0463]: can't find crate for `std`
  |
  = note: the `thumbv7m-none-eabi` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error[E0463]: can't find crate for `std`
  |
  = note: the `thumbv7m-none-eabi` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: could not compile `hex`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: could not compile `num_cpus`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error[E0463]: can't find crate for `std`
 --> /Users/schuepbs/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/inline_lazy.rs:9:1
  |
9 | extern crate std;
  | ^^^^^^^^^^^^^^^^^ can't find crate
  |
  = note: the `thumbv7m-none-eabi` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: could not compile `lazy_static`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed

I believe that this is due to a dependency in the hashbrow crate.
Do you know anything about this?

@samuel-schuepbach
Copy link
Author

samuel-schuepbach commented Apr 12, 2020

Update

This problem has been discussed in the hashbrown issue page: rust-lang/hashbrown#124

@octavonce
Copy link
Contributor

@rockresu Thank you for opening this! This should be fixed by simply updating the hashbrown crate. I will do this in the next few days.

@octavonce
Copy link
Contributor

@samuel-schuepbach I have just published a new release which fixes this issue.

@samuel-schuepbach
Copy link
Author

@octavonce Great! Thank you for the quick fix!

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 a pull request may close this issue.

2 participants