rust-compression icon indicating copy to clipboard operation
rust-compression copied to clipboard

no_std is broken

Open MarkSwanson opened this issue 6 years ago • 2 comments

Edit: actually, just try to compile the rust-compression crate will fail using: cargo build --target thumbv7m-none-eabi

Add compression to a no_std crate and compile for an arm micro controller like: cargo build --target thumbv7m-none-eabi

error[E0463]: can't find crate for std --> /home/mswanson/.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

Cargo.toml: [dependencies.compression] version = "0.1.4" default-features = false features = ["deflate"]

MarkSwanson avatar Oct 27 '19 21:10 MarkSwanson

It needs a note maybe, but this is fairly easy to fix. If you read the file name that actually causes the error, it's lazy_static. if you add lazy_static to your project, you can set the features to support no_std lazy_static = { version = "1.4.0", features = ["spin_no_std"] }

Pear0 avatar Apr 09 '20 09:04 Pear0

Could the feature perhaps be re-exported? cargo doesn't really have a great way of pinning sub-dependencies in order to do this cleanly.

Qix- avatar Aug 09 '23 14:08 Qix-