Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MoskalykA
Copy link
Contributor

What does this PR try to resolve?

Information is available in the following issue #12978

Additional information

Closes #12978

@rustbot
Copy link
Collaborator

rustbot commented Oct 31, 2024

r? @ehuss

rustbot has assigned @ehuss.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-cli Area: Command-line interface, option parsing, etc. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 31, 2024
Copy link
Member

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.

Comment on lines +693 to +696
let package = self._values_of("package");
if w && !package.is_empty() {
all = false;
}
Copy link
Member

Choose a reason for hiding this comment

The 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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 --package <package> & --workspace / --all would be good for this issue? I have the impression that the fact that the package doesn't exist doesn't change anything.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can create a workspace and test it out. Before this patch, cargo b -p foo --workspace works without error. After this, it reports foo matching nothing. This should be a warning first, not a hard error.

@ehuss
Copy link
Contributor

ehuss commented Nov 8, 2024

@rustbot author

Also, we recently updated our CI configuration, and this will need to be rebased on the latest master.

@rustbot rustbot added S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Area: Command-line interface, option parsing, etc. S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

With package selection, --package <non-existent> --workspace doesn't warn or error
4 participants