Skip to content

per-package-target unifies features which can conflict with other targets #9521

Description

@MarkSwanson

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bugS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.S-needs-mentorStatus: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.Z-per-package-targetNightly: per-package-target

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions