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

std is required by sha1 because it does not declare #![no_std] #15

Open
jackxl opened this issue Nov 14, 2022 · 2 comments
Open

std is required by sha1 because it does not declare #![no_std] #15

jackxl opened this issue Nov 14, 2022 · 2 comments

Comments

@jackxl
Copy link

jackxl commented Nov 14, 2022

Having the following issue trying to compile the bare minimum:

Error:

   Compiling generic-array v0.14.6
   Compiling generic-array v0.12.4
   Compiling generic-array v0.13.3
   Compiling sha1 v0.6.1
error[E0463]: can't find crate for `std`
  |
  = note: the `thumbv7em-none-eabi` target may not support the standard library
  = note: `std` is required by `sha1` because it does not declare `#![no_std]`
  = help: consider building the standard library from source with `cargo build -Zbuild-std

For more information about this error, try `rustc --explain E0463`.
error: could not compile `sha1` due to previous error
warning: build failed, waiting for other jobs to finish...

Even though I've set the dependency of embedded-websocket as instructed in the readme.
Also as far as I can see sha1 does declare #![no_std] but the error says no.

note: importing sha1 in my project (with default-features = false) and removing embedded-websocket does not produce the error.

What is going on here and what would be the proper way to resolve this issue?

rustc --version: rustc 1.66.0-nightly (758f19645 2022-10-24)
Cargo.toml:

[package]
name = "sandbox"
version = "0.1.0"
edition = "2021"

[dependencies]
embedded-websocket = { version = "0.8.0", default-features = false }

.cargo/config.toml:

[build]
target = "thumbv7em-none-eabi"

src/main.rs:

#![no_std]
fn main() {
    //println!("Hello, world!");
}

Kind regards,

Jack

@jackxl
Copy link
Author

jackxl commented Nov 15, 2022

Cloning the source and defining the dependency with a local path works fine. Perhaps there is an issue with the version on crates.io

@ninjasource
Copy link
Owner

ninjasource commented Nov 15, 2022

Hi Jack, yes it appears so. I plan to update crates.io as soon as I have finalized the async stuff which has been a little tricky to implement. Soon! I'll try to add a no_std build target to the examples so that the build breaks if this sort of thing happens again.

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