fix: build Cargo-minimal.lock with min deps
What changed, and why it matters
This commit is a routine build-maintenance change. It tightens how the project tests against the oldest allowed versions of its dependencies, and refreshes a checked-in lock file so those oldest versions are actually used in CI. There is no product bug fix, no change to the library code users run, and no security issue being patched.
No security action needed. Review as normal build/CI hygiene if desired.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change updates contrib/update-lock-files.sh to use Cargo nightly’s -Z direct-minimal-versions and -Z minimal-versions flags in sequence, then copies the resulting Cargo.lock to Cargo-minimal.lock. The Cargo-minimal.lock diff only shows dependency versions being pinned to lower/minimum allowed versions (e.g., arrayvec 0.7.4 -> 0.7.2, bitcoin-io 0.1.3 -> 0.1.1, libc 0.2.155 -> 0.2.143, etc.). No source code, API, or behavior of rust-bitcoin is modified.
Changed components
contrib/update-lock-files.shCargo-minimal.lockInspect captured patch +48 / −29
diff --git a/Cargo-minimal.lock b/Cargo-minimal.lock
index f8631a94..1e4900e1 100644
--- a/Cargo-minimal.lock
+++ b/Cargo-minimal.lock
@@ -10,9 +10,9 @@ checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223"
[[package]]
name = "arrayvec"
-version = "0.7.4"
+version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"
+checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6"
[[package]]
name = "base58ck"
@@ -96,9 +96,9 @@ dependencies = [
[[package]]
name = "bitcoin-io"
-version = "0.1.3"
+version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b47c4ab7a93edb0c7198c5535ed9b52b63095f4e9b45279c6736cec4b856baf"
+checksum = "17e5b76b88667412087beea1882980ad843b660490bbf6cce0a6cfc999c5b989"
[[package]]
name = "bitcoin-io"
@@ -154,7 +154,7 @@ version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16"
dependencies = [
- "bitcoin-io 0.1.3",
+ "bitcoin-io 0.1.1",
"hex-conservative 0.2.0",
]
@@ -263,15 +263,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libc"
-version = "0.2.155"
+version = "0.2.143"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
+checksum = "edc207893e85c5d6be840e969b496b53d94cec8be2d501b214f50daa97fa8024"
[[package]]
name = "memmap2"
-version = "0.9.4"
+version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322"
+checksum = "deaba38d7abf1d4cca21cc89e932e542ba2b9258664d2a9ef0e61512039c9375"
dependencies = [
"libc",
]
@@ -284,18 +284,18 @@ checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea"
[[package]]
name = "proc-macro2"
-version = "1.0.101"
+version = "1.0.74"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de"
+checksum = "2de98502f212cfcea8d0bb305bd0f49d7ebdd75b64ba0a68f937d888f4e0d6db"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
-version = "1.0.40"
+version = "1.0.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d"
+checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
dependencies = [
"proc-macro2",
]
@@ -378,24 +378,24 @@ dependencies = [
[[package]]
name = "semver"
-version = "1.0.17"
+version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed"
+checksum = "76b5842e81eb9bbea19276a9dbbda22ac042532f390a67ab08b895617978abf3"
[[package]]
name = "serde"
-version = "1.0.219"
+version = "1.0.195"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
+checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
-version = "1.0.219"
+version = "1.0.195"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
+checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c"
dependencies = [
"proc-macro2",
"quote",
@@ -424,9 +424,9 @@ dependencies = [
[[package]]
name = "syn"
-version = "2.0.106"
+version = "2.0.46"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6"
+checksum = "89456b690ff72fddcecf231caedbe615c59480c93358a93dfae7fc29e3ebbf0e"
dependencies = [
"proc-macro2",
"quote",
@@ -435,9 +435,9 @@ dependencies = [
[[package]]
name = "unicode-ident"
-version = "1.0.8"
+version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4"
+checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee"
[[package]]
name = "wasi"
diff --git a/contrib/update-lock-files.sh b/contrib/update-lock-files.sh
index 90b18650..d0b45a30 100755
--- a/contrib/update-lock-files.sh
+++ b/contrib/update-lock-files.sh
@@ -1,11 +1,30 @@
#!/usr/bin/env bash
#
-# Update the minimal/recent lock file
+# Update the minimal and recent lock files.
set -euo pipefail
-for file in Cargo-minimal.lock Cargo-recent.lock; do
- cp -f "$file" Cargo.lock
- cargo check
- cp -f Cargo.lock "$file"
-done
+NIGHTLY=$(cat nightly-version)
+
+# The `direct-minimal-versions` and `minimal-versions` dependency
+# resolution strategy flags each have a little quirk. `direct-minimal-versions`
+# allows transitive versions to upgrade, so we are not testing against
+# the actual minimum tree. `minimal-versions` allows the direct dependency
+# versions to resolve upward due to transitive requirements, so we are
+# not testing the manifest's versions. Combo'd together though, we
+# can get the best of both worlds to ensure the actual minimum dependencies
+# listed in the crate manifests build.
+
+# Check that all explicit direct dependency versions are not lying,
+# as in, they are not being bumped up by transitive dependency constraints.
+rm -f Cargo.lock && cargo +"$NIGHTLY" check -Z direct-minimal-versions
+# Now that our own direct dependency versions can be trusted, check
+# against the lowest versions of the dependency tree which still
+# satisfy constraints. Use this as the minimal version lock file.
+rm -f Cargo.lock && cargo +"$NIGHTLY" check -Z minimal-versions
+cp -f Cargo.lock Cargo-minimal.lock
+
+# Conservatively bump of recent dependencies.
+cp -f Cargo-recent.lock Cargo.lock
+cargo check
+cp -f Cargo.lock Cargo-recent.lock
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.