embedded-websocket icon indicating copy to clipboard operation
embedded-websocket copied to clipboard

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

Open jackxl opened this issue 1 year ago • 2 comments

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 avatar Nov 14 '22 13:11 jackxl

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

jackxl avatar Nov 15 '22 13:11 jackxl

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.

ninjasource avatar Nov 15 '22 20:11 ninjasource