-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cargo build --all --all-features in a non-virtual workspace ignores features not present in the root crate #5518
Comments
I've filed rust-lang/cargo#5518 about this as the previous command worked as expected in Rust 1.25.0. It's probably not a bad idea to be more specific though.
I've filed rust-lang/cargo#5518 about this as the previous command worked as expected in Rust 1.25.0. It's probably not a bad idea to be more specific though.
Thanks for the report! Would it be possible to minimize this a bit perhaps to be easier to investigate? @ehuss you may also be interested in this issue |
Yes, I've uploaded a minimal example repository here. Running it (with cargo versions unchanged from what I gave above):
|
This fixes an accidental regression introduced in rust-lang#5012 where the `--all-features` CLI flag was only propagated to the "main crate" as opposed to all workspace packages. This behavior has [already been deemed][pr] as "basically not what you want", but for now it's best to avoid the regression. Closes rust-lang#5518 [pr]: rust-lang#5353
Ok thanks for the reduction! I can indeed reproduce this locally now. I've bisected this regression to 7de30dd (part of #5012, cc @infinity0) I believe this should be fixed in #5556 |
Sorry about that, thanks for catching. In general I think it's an anti-pattern to have enums with options like |
Copy `--all-features` request to all workspace members This fixes an accidental regression introduced in #5012 where the `--all-features` CLI flag was only propagated to the "main crate" as opposed to all workspace packages. This behavior has [already been deemed][pr] as "basically not what you want", but for now it's best to avoid the regression. Closes #5518 [pr]: #5353
This fixes an accidental regression introduced in rust-lang#5012 where the `--all-features` CLI flag was only propagated to the "main crate" as opposed to all workspace packages. This behavior has [already been deemed][pr] as "basically not what you want", but for now it's best to avoid the regression. Closes rust-lang#5518 [pr]: rust-lang#5353
I just pulled and built 22c0f22 and can confirm it doesn't have the issue, thanks! |
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 anffi-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 runcargo +nightly build --release --all --all-features
, that doesn't work, butcargo +nightly build --release --all --all-features -Z package-features
does.My current version of cargo is:
Running with the 1.25.0 toolchain:
Running with nightly:
The text was updated successfully, but these errors were encountered: