per-package-target unifies features which can conflict with other targets · Issue #9521 · rust-lang/cargo (original) (raw)

Problem
'cargo build --verbose' seems to indicate that rustc is compiling for the wrong target.

Steps

  1. git clone https://github.com/MarkSwanson/build-failed1.git
  2. cargo build --verbose
    3.Note the rustc error compiling the void (1.0.2) crate
    ...
    std is required by void because it does not declare #![no_std]

Partial Workaround

  1. cd into each workspace package individually and 'cargo build'. For some reason cargo works perfectly this way.
    However, this doesn't work with vscode.
  2. remove "rpi4" from Cargo.toml workspace members.
    Sadly then I can't build the raspberry pi 4 target.

Notes
It seems positive that all build targets (x86, thumbv7em-none-eabihf, thumbv7m-none-eabi, armv7-unknown-linux-musleabihf) work perfectly if I run 'cargo build' from their respective workspace package dirs. (slight graph miscalculation when compiled from the root of the workspace?)

I note that the void crate is designed to work with std and no-std. However, the rustc error might indicate that rustc needs to have a slightly more robust check to detect how the void crate uses cfg or cfg_attr to support both environments?

Output of cargo version:
cargo 1.54.0-nightly (e931e47 2021-05-24)