Skip to content

Update to clap 4. #2380

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

Merged
merged 3 commits into from
Jan 12, 2023
Merged

Update to clap 4. #2380

merged 3 commits into from
Jan 12, 2023

Conversation

qwandor
Copy link
Contributor

@qwandor qwandor commented Jan 4, 2023

Most other crates (including cxx) use clap 4 by now, and bindgen using clap 3 results in multiple versions needing to be maintained in projects which vendor dependencies.

@pvdrz
Copy link
Contributor

pvdrz commented Jan 5, 2023

Hi @qwandor thanks for you PR!

Is some functionality missing from the current version of clap that you need? I'm a bit reluctant (but open) to raise the MSRV for bindgen because of this change

@qwandor
Copy link
Contributor Author

qwandor commented Jan 5, 2023

Hi, sorry, I've added a description. The context in my case is that I'm working on Android, where we vendor all dependencies into our tree, and require that there is only a single version of each crate. We would like to update to clap 4, as the latest version of a number of other crates that we use depend on it, and would also like to use some features from it in our own code. However, we also use bindgen, which currently still depends on clap 3, which is blocking the update.

I could patch bindgen downstream in our vendored version, but given the relatively large number of changes that's going to make maintenance a real pain, so I'd much rather get this update in upstream if possible.

@pvdrz
Copy link
Contributor

pvdrz commented Jan 5, 2023

Oh ok yeah, that sounds like a hassle.

I'm not sure but maybe we can raise the MSRV for bindgen-cli only which is the crate that depends on clap. Although you shouldn't have to vendor bindgen-cli if you're not using it. I guess that's a consequence of the repo being a workspace instead of a bunch of standalone crates.

I'll try to figure out something so we can merge this ASAP.

@qwandor
Copy link
Contributor Author

qwandor commented Jan 5, 2023

Thanks!

We are using bindgen-cli, as part of our build system I think. We generally import crates from crates.io rather than git, so being a workspace vs. standalone crates doesn't matter too much.

@pvdrz
Copy link
Contributor

pvdrz commented Jan 5, 2023

Thanks!

We are using bindgen-cli, as part of our build system I think. We generally import crates from crates.io rather than git, so being a workspace vs. standalone crates doesn't matter too much.

huh, interesting. So you actually need to pull the bindgen-cli code.

@qwandor
Copy link
Contributor Author

qwandor commented Jan 5, 2023

Right, you can see it here if you're curious.

@bors-servo
Copy link

☔ The latest upstream changes (presumably 5875949) made this pull request unmergeable. Please resolve the merge conflicts.

@qwandor
Copy link
Contributor Author

qwandor commented Jan 9, 2023

umbrella The latest upstream changes (presumably 5875949) made this pull request unmergeable. Please resolve the merge conflicts.

Done.

Copy link
Member

@amanjeev amanjeev left a comment

Choose a reason for hiding this comment

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

Thank you for working on this and opening this PR.

Comment on lines -330 to +354
.multiple_occurrences(true),
.action(ArgAction::SetTrue),
Copy link
Member

Choose a reason for hiding this comment

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

Ah! this is neat. It seems we were using multiple_occurrences incorrectly. Thank you! ❤️

@amanjeev
Copy link
Member

r+

@amanjeev amanjeev merged commit ed2d06e into rust-lang:master Jan 12, 2023
@qwandor qwandor deleted the clap4 branch January 13, 2023 11:43
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.

4 participants