Don't error if no binaries were installed#10508
Merged
bors merged 3 commits intorust-lang:masterfrom Apr 1, 2022
Merged
Conversation
If we interpret `cargo install` and `cargo install --bins` as "install the binaries that are available", it should not be considered an error if no binaries ended up being installed due to required features. Instead, this should provide the user with a warning that this may not have been what they intended. Fixes rust-lang#10289.
|
r? @ehuss (rust-highfive has picked a reviewer for you, use r? to override) |
weihanglo
reviewed
Mar 31, 2022
Member
weihanglo
left a comment
There was a problem hiding this comment.
Look reasonable to me!
Only one thing left we need to handle: cargo-install can install binaries from example targets. You might want to check those conditions as well.
Contributor
Author
|
Good catch! Fixed in newest commit, and I added a bit to an existing test to exercise it. |
weihanglo
reviewed
Apr 1, 2022
Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com>
Member
|
Thanks! @bors r+ |
Contributor
|
📌 Commit 680eed6 has been approved by |
Contributor
Contributor
|
☀️ Test successful - checks-actions |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 6, 2022
Update cargo 5 commits in 1ef1e0a12723ce9548d7da2b63119de9002bead8..e2e2dddebe66dfc1403a312653557e332445308b 2022-03-31 00:17:18 +0000 to 2022-04-05 17:04:53 +0000 - Part 2 of RFC2906 -- allow inheriting from a different `Cargo.toml` (rust-lang/cargo#10517) - File Cache is valid if checkout or contents hasn't changed (rust-lang/cargo#10507) - Fix how scrape-examples handles proc macros (rust-lang/cargo#10533) - tools: update checkout action on CI (rust-lang/cargo#10521) - Don't error if no binaries were installed (rust-lang/cargo#10508)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR try to resolve?
Fixes #10289, which contains a thorough description of the problem.
Briefly, if we interpret
cargo installandcargo install --binsas "installthe binaries that are available", it should not be considered an error
if no binaries ended up being installed due to required features.
Instead, this should provide the user with a warning that this may not
have been what they intended.
Additional information
Given that #9576 seems to have stalled, I figured I'd try to land this first after all.