-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Consistently default to --lib --bins when --all-targets is not given #5146
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