-
Notifications
You must be signed in to change notification settings - Fork 2.7k
install fails earlier when no binaries can be found #9576
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
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -249,6 +249,8 @@ pub enum CompileFilter { | |
| }, | ||
| Only { | ||
| all_targets: bool, | ||
| /// Flag whether to warn when there are unmatched target filters, defaulting to true. | ||
| warn_unmatched: bool, | ||
| lib: LibRule, | ||
| bins: FilterRule, | ||
| examples: FilterRule, | ||
|
|
@@ -714,6 +716,7 @@ impl CompileFilter { | |
| { | ||
| CompileFilter::Only { | ||
| all_targets: false, | ||
| warn_unmatched: true, | ||
| lib: rule_lib, | ||
| bins: rule_bins, | ||
| examples: rule_exms, | ||
|
|
@@ -730,6 +733,7 @@ impl CompileFilter { | |
| pub fn new_all_targets() -> CompileFilter { | ||
| CompileFilter::Only { | ||
| all_targets: true, | ||
| warn_unmatched: true, | ||
| lib: LibRule::Default, | ||
| bins: FilterRule::All, | ||
| examples: FilterRule::All, | ||
|
|
@@ -738,6 +742,19 @@ impl CompileFilter { | |
| } | ||
| } | ||
|
|
||
| /// Construct a CompileFilter with default options for use by `cargo install` | ||
| pub fn new_bare_install() -> CompileFilter { | ||
| CompileFilter::Only { | ||
| all_targets: false, | ||
| warn_unmatched: false, | ||
| lib: LibRule::False, | ||
| bins: FilterRule::All, | ||
| examples: FilterRule::none(), | ||
| benches: FilterRule::none(), | ||
| tests: FilterRule::none(), | ||
| } | ||
| } | ||
|
|
||
| pub fn need_dev_deps(&self, mode: CompileMode) -> bool { | ||
| match mode { | ||
| CompileMode::Test | CompileMode::Doctest | CompileMode::Bench => true, | ||
|
|
@@ -796,6 +813,21 @@ impl CompileFilter { | |
| } | ||
| } | ||
|
|
||
| pub fn is_bare_install(&self) -> bool { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm a little unclear, why doesn't this just check for the |
||
| match *self { | ||
| CompileFilter::Default { .. } => false, | ||
| CompileFilter::Only { | ||
| bins: FilterRule::All, | ||
| ref examples, | ||
| .. | ||
| } => match examples { | ||
| FilterRule::All => false, | ||
| FilterRule::Just(ref targets) => targets.is_empty(), | ||
| }, | ||
| _ => !self.is_specific(), | ||
| } | ||
| } | ||
|
|
||
| pub fn is_all_targets(&self) -> bool { | ||
| matches!( | ||
| *self, | ||
|
|
@@ -1003,6 +1035,7 @@ fn generate_targets( | |
| ref examples, | ||
| ref tests, | ||
| ref benches, | ||
| .. | ||
| } => { | ||
| if *lib != LibRule::False { | ||
| let mut libs = Vec::new(); | ||
|
|
@@ -1158,14 +1191,15 @@ fn unmatched_target_filters( | |
| ) -> CargoResult<()> { | ||
| if let CompileFilter::Only { | ||
| all_targets, | ||
| lib: _, | ||
| warn_unmatched, | ||
| ref bins, | ||
| ref examples, | ||
| ref tests, | ||
| ref benches, | ||
| .. | ||
| } = *filter | ||
| { | ||
| if units.is_empty() { | ||
| if units.is_empty() && warn_unmatched { | ||
| let mut filters = String::new(); | ||
| let mut miss_count = 0; | ||
|
|
||
|
|
||
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
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.
Uh oh!
There was an error while loading. Please reload this page.