From 086fb7f31305f18878be4bc0f03ff73b38db9583 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Mon, 2 Sep 2024 21:55:59 +0000 Subject: [PATCH 1/4] rust: Specify minimum dependency versions These are the minimum versions so the source compiles. Verified with: cargo +nightly update -Zminimal-versions --offline --verbose cargo update -p regex-syntax --precise=0.6.25 cargo check --- Cargo.toml | 6 +++--- bch_bindgen/Cargo.toml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 25a42e501..73dccbad9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,16 +16,16 @@ fuse = [] log = { version = "0.4", features = ["std"] } clap = { version = "4.0.32", features = ["derive", "wrap_help"] } clap_complete = "4.3.2" -anyhow = "1.0" +anyhow = "1.0.1" libc = "0.2.69" udev = "0.7.0" uuid = "1.2.2" -errno = "0.2" +errno = "0.2.7" either = "1.5" bch_bindgen = { path = "bch_bindgen" } strum = { version = "0.26", features = ["derive"] } strum_macros = "0.26" -zeroize = { version = "1", features = ["std", "zeroize_derive"] } +zeroize = { version = "1.5.5", features = ["std", "zeroize_derive"] } rustix = { version = "0.38.34", features = ["termios"] } owo-colors = "4" diff --git a/bch_bindgen/Cargo.toml b/bch_bindgen/Cargo.toml index 2a819bb52..fa7851c6c 100644 --- a/bch_bindgen/Cargo.toml +++ b/bch_bindgen/Cargo.toml @@ -17,5 +17,5 @@ bitflags = "1.3.2" paste = "1.0.11" [build-dependencies] -pkg-config = "0.3" -bindgen = "0.69.4" +pkg-config = "0.3.7" +bindgen = "0.69.5" From 2e0e49145947876e6871d4963e4d75fdfcf6ca63 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Mon, 2 Sep 2024 22:14:39 +0000 Subject: [PATCH 2/4] Update to bitflags 2 bch_bindgen -> bindgen already requires bitflags 2, so this can eliminate a duplicate dependency. --- Cargo.lock | 12 +++--------- bch_bindgen/Cargo.toml | 2 +- bch_bindgen/src/btree.rs | 4 ++-- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 28bb2eee6..b08621ecb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -95,7 +95,7 @@ dependencies = [ "anyhow", "bindgen", "bitfield", - "bitflags 1.3.2", + "bitflags", "paste", "pkg-config", "uuid", @@ -107,7 +107,7 @@ version = "0.69.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" dependencies = [ - "bitflags 2.6.0", + "bitflags", "cexpr", "clang-sys", "itertools", @@ -130,12 +130,6 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - [[package]] name = "bitflags" version = "2.6.0" @@ -480,7 +474,7 @@ version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ - "bitflags 2.6.0", + "bitflags", "errno 0.3.9", "libc", "linux-raw-sys", diff --git a/bch_bindgen/Cargo.toml b/bch_bindgen/Cargo.toml index fa7851c6c..aaf899fa6 100644 --- a/bch_bindgen/Cargo.toml +++ b/bch_bindgen/Cargo.toml @@ -13,7 +13,7 @@ crate-type = ["lib"] anyhow = "1.0" uuid = "1.2.2" bitfield = "0.14.0" -bitflags = "1.3.2" +bitflags = "2" paste = "1.0.11" [build-dependencies] diff --git a/bch_bindgen/src/btree.rs b/bch_bindgen/src/btree.rs index 337911782..abc9e55b8 100644 --- a/bch_bindgen/src/btree.rs +++ b/bch_bindgen/src/btree.rs @@ -71,7 +71,7 @@ impl<'t> BtreeIter<'t> { iter.as_mut_ptr(), btree, pos, - flags.bits as u32, + flags.bits().into(), ); BtreeIter { @@ -156,7 +156,7 @@ impl<'t> BtreeNodeIter<'t> { pos, locks_want, depth, - flags.bits as u32, + flags.bits().into(), ); BtreeNodeIter { From 19848da8ede736f27192a388bd9d780d00dfd822 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Mon, 2 Sep 2024 22:16:44 +0000 Subject: [PATCH 3/4] Upgrade to errno 0.3 No impact. We could also pick the 0.2-0.3 range to help distributions, but debian already has 0.3. We already require errno 0.3 through rustix, so this can eliminate a duplicate dependency. --- Cargo.lock | 56 ++---------------------------------------------------- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 55 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b08621ecb..ce1781f12 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -76,7 +76,7 @@ dependencies = [ "clap_complete", "either", "env_logger", - "errno 0.2.8", + "errno", "libc", "log", "owo-colors", @@ -136,15 +136,6 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" -[[package]] -name = "cc" -version = "1.1.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" -dependencies = [ - "shlex", -] - [[package]] name = "cexpr" version = "0.6.0" @@ -242,17 +233,6 @@ dependencies = [ "log", ] -[[package]] -name = "errno" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" -dependencies = [ - "errno-dragonfly", - "libc", - "winapi", -] - [[package]] name = "errno" version = "0.3.9" @@ -263,16 +243,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "glob" version = "0.3.1" @@ -475,7 +445,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ "bitflags", - "errno 0.3.9", + "errno", "libc", "linux-raw-sys", "windows-sys 0.52.0", @@ -583,28 +553,6 @@ dependencies = [ "rustix", ] -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-sys" version = "0.52.0" diff --git a/Cargo.toml b/Cargo.toml index 73dccbad9..312476ee7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ anyhow = "1.0.1" libc = "0.2.69" udev = "0.7.0" uuid = "1.2.2" -errno = "0.2.7" +errno = "0.3" either = "1.5" bch_bindgen = { path = "bch_bindgen" } strum = { version = "0.26", features = ["derive"] } From c749ce9939c0cff457dad779fbdb50a12c903bc5 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Sun, 8 Sep 2024 09:40:20 +0000 Subject: [PATCH 4/4] Remove unnecessary dependency Found with cargo-machete. --- Cargo.lock | 1 - Cargo.toml | 1 - 2 files changed, 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ce1781f12..503fa67fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -82,7 +82,6 @@ dependencies = [ "owo-colors", "rustix", "strum", - "strum_macros", "udev", "uuid", "zeroize", diff --git a/Cargo.toml b/Cargo.toml index 312476ee7..ed7c7c06a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,6 @@ errno = "0.3" either = "1.5" bch_bindgen = { path = "bch_bindgen" } strum = { version = "0.26", features = ["derive"] } -strum_macros = "0.26" zeroize = { version = "1.5.5", features = ["std", "zeroize_derive"] } rustix = { version = "0.38.34", features = ["termios"] } owo-colors = "4"