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

bump treewide clap to 4.2.1 #110077

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 12 additions & 87 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ dependencies = [
"cargo-test-macro",
"cargo-test-support",
"cargo-util",
"clap 4.2.1",
"clap",
"crates-io",
"curl",
"curl-sys",
Expand Down Expand Up @@ -691,31 +691,14 @@ dependencies = [
"winapi",
]

[[package]]
name = "clap"
version = "3.2.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23b71c3ce99b7611011217b366d923f1d0a7e07a92bb2dbf1e84508c673ca3bd"
dependencies = [
"atty",
"bitflags",
"clap_derive 3.2.18",
"clap_lex 0.2.2",
"indexmap",
"once_cell",
"strsim",
"termcolor",
"textwrap",
]

[[package]]
name = "clap"
version = "4.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "046ae530c528f252094e4a77886ee1374437744b2bff1497aa898bbddbbb29b3"
dependencies = [
"clap_builder",
"clap_derive 4.2.0",
"clap_derive",
"once_cell",
]

Expand All @@ -728,7 +711,7 @@ dependencies = [
"anstream",
"anstyle",
"bitflags",
"clap_lex 0.4.1",
"clap_lex",
"once_cell",
"strsim",
"terminal_size",
Expand All @@ -740,20 +723,7 @@ version = "4.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10861370d2ba66b0f5989f83ebf35db6421713fd92351790e7fdd6c36774c56b"
dependencies = [
"clap 4.2.1",
]

[[package]]
name = "clap_derive"
version = "3.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65"
dependencies = [
"heck",
"proc-macro-error",
"proc-macro2",
"quote",
"syn 1.0.102",
"clap",
]

[[package]]
Expand All @@ -768,15 +738,6 @@ dependencies = [
"syn 2.0.8",
]

[[package]]
name = "clap_lex"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5538cd660450ebeb4234cfecf8f2284b844ffc4c50531e66d584ad5b91293613"
dependencies = [
"os_str_bytes",
]

[[package]]
name = "clap_lex"
version = "0.4.1"
Expand All @@ -787,7 +748,7 @@ checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1"
name = "clippy"
version = "0.1.70"
dependencies = [
"clap 4.2.1",
"clap",
"clippy_lints",
"clippy_utils",
"compiletest_rs",
Expand Down Expand Up @@ -818,7 +779,7 @@ name = "clippy_dev"
version = "0.0.1"
dependencies = [
"aho-corasick",
"clap 4.2.1",
"clap",
"indoc",
"itertools",
"opener",
Expand Down Expand Up @@ -2766,7 +2727,7 @@ name = "installer"
version = "0.0.0"
dependencies = [
"anyhow",
"clap 3.2.20",
"clap",
"flate2",
"lazy_static",
"num_cpus",
Expand Down Expand Up @@ -2899,7 +2860,7 @@ name = "jsondoclint"
version = "0.1.0"
dependencies = [
"anyhow",
"clap 4.2.1",
"clap",
"fs-err",
"rustc-hash",
"rustdoc-json-types",
Expand Down Expand Up @@ -3165,7 +3126,7 @@ dependencies = [
"ammonia",
"anyhow",
"chrono",
"clap 4.2.1",
"clap",
"clap_complete",
"elasticlunr-rs",
"env_logger 0.10.0",
Expand Down Expand Up @@ -3551,12 +3512,6 @@ dependencies = [
"winapi",
]

[[package]]
name = "os_str_bytes"
version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64"

[[package]]
name = "output_vt100"
version = "0.1.3"
Expand Down Expand Up @@ -3880,30 +3835,6 @@ dependencies = [
"log",
]

[[package]]
name = "proc-macro-error"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
dependencies = [
"proc-macro-error-attr",
"proc-macro2",
"quote",
"syn 1.0.102",
"version_check",
]

[[package]]
name = "proc-macro-error-attr"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
dependencies = [
"proc-macro2",
"quote",
"version_check",
]

[[package]]
name = "proc-macro-hack"
version = "0.5.19"
Expand Down Expand Up @@ -4181,7 +4112,7 @@ dependencies = [
name = "rustbook"
version = "0.1.0"
dependencies = [
"clap 4.2.1",
"clap",
"env_logger 0.10.0",
"mdbook",
]
Expand Down Expand Up @@ -4278,7 +4209,7 @@ name = "rustc-workspace-hack"
version = "1.0.0"
dependencies = [
"bstr 0.2.17",
"clap 3.2.20",
"clap",
"getrandom",
"hashbrown 0.12.3",
"libc",
Expand Down Expand Up @@ -5589,7 +5520,7 @@ dependencies = [
"anyhow",
"bytecount",
"cargo_metadata 0.14.0",
"clap 3.2.20",
"clap",
"derive-new",
"diff",
"dirs",
Expand Down Expand Up @@ -6248,12 +6179,6 @@ dependencies = [
"term",
]

[[package]]
name = "textwrap"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb"

[[package]]
name = "thin-vec"
version = "0.2.12"
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rust-installer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ remove_dir_all = "0.5"

[dependencies.clap]
features = ["derive"]
version = "3.1"
version = "4.2.1"

[target."cfg(windows)".dependencies]
lazy_static = "1"
Expand Down
4 changes: 2 additions & 2 deletions src/tools/rustc-workspace-hack/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ features = [

[dependencies]
bstr = { version = "0.2.17", features = ["default"] }
clap = { version = "3.1.1", features = ["derive", "clap_derive"]}
clap = { version = "4.2.1", features = ["derive"] }
curl-sys = { version = "0.4.13", features = ["http2", "libnghttp2-sys"], optional = true }
# Ensure `extra_traits` of libc, which is used transitively by Cargo.
libc = { version = "0.2", features = ["extra_traits"] }
Expand All @@ -91,7 +91,7 @@ rand = { version = "0.8.5" }

# Ensure features of `hashbrown`, `smallvec`, and `once_cell`,
# which are used transitively by Cargo (via `gix`).
hashbrown = { version = "0.12.3", default-features = false, features = ["inline-more"] }
hashbrown = { version = "0.12.3", default-features = false, features = ["inline-more", "raw"] }
once_cell = { version = "1.16.0", default-features = false, features = ["unstable"] }
smallvec = { version = "1.10.0", features = ["write"] }

Expand Down
2 changes: 1 addition & 1 deletion src/tools/rustfmt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ annotate-snippets = { version = "0.9", features = ["color"] }
anyhow = "1.0"
bytecount = "0.6"
cargo_metadata = "0.14"
clap = { version = "3.1", features = ["derive"] }
clap = { version = "4.2.1", features = ["derive"] }
Copy link
Member

Choose a reason for hiding this comment

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

@rust-lang/rustfmt Are you OK with this landing upstream? It seems like there's some changes to code here as well so maybe we should go through PR to rustfmt?

Copy link
Contributor

Choose a reason for hiding this comment

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

Adding clap 3.1 gave us some trouble rust-lang/rustfmt#5395, but I think bumping to 4.2.1 upstream should be fine. I've gone ahead and tested the 4.2.1 changes locally. There are some slight changes in the --help output, but I also think that's fine. @calebcartwright what are your thoughts?

3.1

Screen Shot 2023-04-09 at 12 43 26 PM

4.2.1

Screen Shot 2023-04-09 at 12 45 03 PM

Copy link
Member

Choose a reason for hiding this comment

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

In general I don't think subtrees should be updated in tree unless absolutely necessary (e.g. rustc_ast updates requiring corresponding updates in clippy, rustfmt, etc.). I understand the benefit of making a broad update like this in tree, but I don't particularly like it (we run a reduced test suite here, lockfile considerations can complicate subtree syncs, etc.)

Suppose we can let this one slide (thanks Yacin for taking a closer look), but in the future would really want to see something like this come directly to the rustfmt repo and then make its way in-tree here via the usual sync process

derive-new = "0.5"
diff = "0.1"
dirs = "4.0"
Expand Down
6 changes: 3 additions & 3 deletions src/tools/rustfmt/src/cargo-fmt/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ use std::path::{Path, PathBuf};
use std::process::Command;
use std::str;

use clap::{AppSettings, CommandFactory, Parser};
use clap::{CommandFactory, Parser};

#[path = "test/mod.rs"]
#[cfg(test)]
mod cargo_fmt_tests;

#[derive(Parser)]
#[clap(
global_setting(AppSettings::NoAutoVersion),
disable_version_flag = true,
bin_name = "cargo fmt",
about = "This utility formats all bin and lib files of \
the current crate using rustfmt."
Expand All @@ -45,7 +45,7 @@ pub struct Opts {
short = 'p',
long = "package",
value_name = "package",
multiple_values = true
num_args = 1..
)]
packages: Vec<String>,

Expand Down