Skip to content

cargo build --all --all-features in a non-virtual workspace ignores features not present in the root crate #5518

@Ortham

Description

@Ortham

I've got a couple of projects (example) that are workspaces with a root crate and another member in an ffi subdirectory. The ffi member has an ffi-headers feature that uses cbindgen to generate C/C++ headers.

I expect to be able to run cargo build --release --all --all-features and have all crates in the workspace built with all their features. This was working in Rust 1.25.0, I was able to run that command and see C/C++ headers get generated.

I upgraded to the Rust 1.26.0 release and now the above command no longer generates headers, it's as if the feature in the ffi crate is being ignored (the issue title may be a little inaccurate, I haven't verified this is what's actually happening). If I run cargo +1.25.0 build --release --all --all-features, everything works as expected.

This might be related to #5362 and #5364, but they're more about --package than --all so I thought I'd file a new issue. If I run cargo +nightly build --release --all --all-features, that doesn't work, but cargo +nightly build --release --all --all-features -Z package-features does.

My current version of cargo is:

> cargo --version
cargo 1.26.0 (0e7c5a931 2018-04-06)

Running with the 1.25.0 toolchain:

> cargo +1.25.0 --version
cargo 0.26.0 (41480f5cc 2018-02-26)

Running with nightly:

> cargo +nightly --version
cargo 1.27.0-nightly (9e53ac6e6 2018-05-07)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions