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

Re-enable multiple values for package arg #127

Merged
merged 2 commits into from
Jan 21, 2022

Conversation

aganders3
Copy link
Contributor

I think this may have been dropped in the Clap update. I only noticed because the pyo3 CI uses it and is pinned to 0.1.11.

See here for the error: https://github.com/PyO3/pyo3/runs/4829748531?check_suite_focus=true

Hopefully this is another quick merge, but I'm also happy to close and fix there if this was intentionally removed.

@aganders3
Copy link
Contributor Author

It might also be good to check the tests match for both arg configs. I can work on that later if you think it would add value.

@aganders3
Copy link
Contributor Author

I guess this has a chance of breaking where people are using --package or --exclude along with a positional arg. I do think the feature is useful but we could also add/enforce comma as a delimiter.

@taiki-e
Copy link
Owner

taiki-e commented Jan 21, 2022

Thanks for the PR. To be honest, I'm a bit confused about clap's behavior here.

As of cargo-llvm-cov 0.1.0, I thought I had explicitly dropped this behavior: e1199da
This is to make it consistent with the cargo behavior:

$ cargo build --package "crossbeam-channel crossbeam-deque"
error: invalid character ` ` in pkgid: `crossbeam-channel crossbeam-deque`, characters must be Unicode XID characters (numbers, `-`, `_`, or most letters)

$ cargo build --package crossbeam-channel crossbeam-deque
error: Found argument 'crossbeam-deque' which wasn't expected, or isn't valid in this context

And the clap documentation at the time said the following:

https://docs.rs/clap/3.0.0-beta.4/clap/struct.Arg.html#method.multiple_occurrences

For example, --opt val1 --opt val2 is allowed, but --opt val1 val2 is not.

However, from the changes in the help message, it seems that it was actually implemented in clap 3.0.0-rc.3: ab9832f

As a result, this became a regression that was introduced in cargo-llvm-cov 0.1.13.

Copy link
Owner

@taiki-e taiki-e left a comment

Choose a reason for hiding this comment

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

So I think it makes sense to support this in cargo-llvm-cov 0.1.x for compatibility, but would like to remove it in cargo-llvm-cov 0.2.0.

bors r+

@taiki-e
Copy link
Owner

taiki-e commented Jan 21, 2022

I guess this has a chance of breaking where people are using --package or --exclude along with a positional arg.

We don't have any positional arguments, so I think this is fine.

@bors
Copy link
Contributor

bors bot commented Jan 21, 2022

Build succeeded:

@bors bors bot merged commit 58c59e8 into taiki-e:main Jan 21, 2022
@aganders3
Copy link
Contributor Author

Thanks! I agree the clap docs are/were confusing on this feature. It seems there were a number of changes to it through the beta.

bors bot added a commit that referenced this pull request Feb 6, 2022
133: Remove support of multiple values in --package and --exclude r=taiki-e a=taiki-e

Reverts #127

Co-authored-by: Taiki Endo <te316e89@gmail.com>
bors bot added a commit that referenced this pull request Feb 6, 2022
133: Remove support of multiple values in --package and --exclude r=taiki-e a=taiki-e

Reverts #127

Co-authored-by: Taiki Endo <te316e89@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants