-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Fix --package <non-existent> --workspace #14755
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -688,7 +688,14 @@ Run `{cmd}` to see possible targets." | |
workspace: Option<&Workspace<'_>>, | ||
profile_checking: ProfileChecking, | ||
) -> CargoResult<CompileOptions> { | ||
let spec = self.packages_from_flags()?; | ||
let w = self.flag("workspace"); | ||
let mut all = w || self.flag("all"); | ||
let package = self._values_of("package"); | ||
if w && !package.is_empty() { | ||
all = false; | ||
} | ||
Comment on lines
+693
to
+696
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. This changes the behavior and is not even proposed in the original issue. I would recommend starting with a warning first. 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. here I am again, sorry for my lack of seriousness, i have a small question. issuing an error when the user uses 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. You can create a workspace and test it out. Before this patch, |
||
|
||
let spec = Packages::from_flags(all, self._values_of("exclude"), package)?; | ||
let mut message_format = None; | ||
let default_json = MessageFormat::Json { | ||
short: false, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We suggest a PR coming with some tests to show how the behavior changed. It is better if we can have a commit capturing the current behavior, followed by the fix and the test change with CI passing.