Do not ignore --features when --all-features is present#10337
Do not ignore --features when --all-features is present#10337bors merged 2 commits intorust-lang:masterfrom
--features when --all-features is present#10337Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ehuss (or someone else) soon. Please see the contribution instructions for more information. |
|
CI seems to fail due to changes in cli help formatting, but I didn't change anything there 🤔 |
|
for fixing broken tests on CI, rebase to master 😄 ref: #10336 |
09ed620 to
3d74ad8
Compare
This allows to specify dependency features when using `--all-features`, for example: ```shell $ cargo run --package a --example example --all-features --features="tracing/log" ```
|
@weihanglo thanks! |
alexcrichton
left a comment
There was a problem hiding this comment.
Looks reasonable to me! Can you add a test for this feature as well?
| └── foo v0.1.0 ([ROOT]/foo) | ||
| └── foo feature \"a\" (command-line) | ||
| ├── foo feature \"a\" (command-line) | ||
| └── foo feature \"default\" (command-line) |
There was a problem hiding this comment.
While I don't think that this is a bug with this PR per-se I think that this is a bug because neither of the packages here actually have a feature called default, so I don't think that this should be printed. I think this could probably be fixed by conditionally inserting the feature "default" in cargo tree depending on whether the package actually has that feature.
There was a problem hiding this comment.
Should I open an issue about this?
There was a problem hiding this comment.
Hm yeah I think it's probably orthogonal-enough from this PR it's best to fix later, and yeah if you wouldn't mind opening an issue that'd be great!
|
@alexcrichton I've added a test |
|
@bors: r+ Thanks! |
|
📌 Commit b7e5186 has been approved by |
|
⌛ Testing commit b7e5186 with merge bb3d4e1c3ed75f32057d2e858f042f9fa00da94d... |
|
💔 Test failed - checks-actions |
|
@bors: retry |
|
☀️ Test successful - checks-actions |
Update cargo 10 commits in 1c034752de0df744fcd7788fcbca158830b8bf85..25fcb135d02ea897ce894b67ae021f48107d522b 2022-01-25 22:36:53 +0000 to 2022-02-01 01:32:48 +0000 - fix(install): Keep v1 file formatting the same (rust-lang/cargo#10349) - fix(vendor): Use tables for sample config (rust-lang/cargo#10348) - Add bash completion for `cargo clippy` (rust-lang/cargo#10347) - Do not ignore `--features` when `--all-features` is present (rust-lang/cargo#10337) - test: Fix compatibilty with new toml_edit (rust-lang/cargo#10350) - extra-link-arg-etc: support all link types (credit `@davidhewitt)` (rust-lang/cargo#10274) - Make clippy happy (rust-lang/cargo#10340) - Update publishing link for semver rules. (rust-lang/cargo#10338) - Normalize --path when install bin outside current workspace (rust-lang/cargo#10335) - Bump clap to v3.0.13 (rust-lang/cargo#10336)
This allows to specify dependency features when using
--all-features, for example:$ cargo run --example example --all-features --features="tracing/log"You can test this in this repository: https://github.com/WaffleLapkin/cargo_all_some_features, it contains an example with
required-features = [..., "tracing/log"]that is impossible to run with--all-featureswithout this patch.An attempt to fix #10333