embassy-rs / nrf-softdevice

Apache License 2.0
254 stars 74 forks source link

macro/dep: disable uuid default features #218

Closed mammothbane closed 6 months ago

mammothbane commented 6 months ago

The nrf-softdevice-macro crate pulls in uuid's std feature in dependent projects because it doesn't disable default-features.

E.g. if I have this:

# Cargo.toml

[dependencies]
uuid = { version = "*", default-features = false } # intending to disable `std`
nrf-softdevice-macro = "*"

I end up with a compiler error because of the way features are resolved:

$ cargo build
... 
   Compiling uuid v1.6.1
error[E0463]: can't find crate for `std`
    |
222 | extern crate std;
    | ^^^^^^^^^^^^^^^^^ can't find crate
    |
    = note: the `thumbv7em-none-eabi` target may not support the standard library
    = help: consider building the standard library from source with `cargo build -Zbuild-std`

This patch sets default-features = false for this dep.

mammothbane commented 6 months ago

Never mind, I was being dumb — red herring.

Problem was that workspace dependencies seem to need to set default-features = false in the workspace.dependencies section before that'll be applied in member crates.