Consistently default to --lib --bins when --all-targets is not given#5146
Consistently default to --lib --bins when --all-targets is not given#5146infinity0 wants to merge 6 commits intorust-lang:masterfrom
Conversation
cargo build --help says:
--all-targets Build all targets (lib and bin targets by default)
but the old default behaviour was actually doing --all-targets. This meant that
--avoid-dev-deps was only effectively if one gave --lib --bins explicitly. With
this commit, `cargo build --avoid-dev-deps` with no other flags, will build lib
and bins and avoid installing dev-dependencies.
This reverts commit d46db71.
|
r? @matklad (rust_highfive has picked a reviewer for you, use r? to override) |
|
r? @alexcrichton based on #4400 cc @behnam |
|
Thanks for the PR! I do think though that I also think that we'd probably want to fix the behavior with |
|
☔ The latest upstream changes (presumably #5152) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Yes, there is a test that After resolving conflicts and fixing a minor bug from #5152, I've additionally added a commit that makes |
|
The tests are failing but I'm pretty sure it's not a problem with my code. If you manually create the example from I'll dig further, hints welcome. |
|
It looks like Currently many of cargo's own tests implicitly depend on the fact that invocations like Alternatively, it may be possible to switch TL;DR I'd suggest dropping 1d31d9f from this PR and abandoning the current suggestion to have |
|
☔ The latest upstream changes (presumably #5176) made this pull request unmergeable. Please resolve the merge conflicts. |
|
There was a simpler way of achieving what I wanted and I misunderstood how the existing code handles |
Fixes #5134