rust: Avoid modification to lockfile during build
What changed, and why it matters
This change is purely a build-process improvement. It makes the Rust package manager (Cargo) use the existing dependency lockfile instead of silently updating it during builds, and updates two lockfiles to match what the project already needs. There is no user-facing or security-relevant code change.
No security action needed. Treat as normal build hygiene/maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit adds CARGOFLAGS=–locked in CI and propagates that flag through CMake into cargo build and rustc invocations. The –locked flag tells Cargo to fail rather than modify Cargo.lock if the manifest has changed. The Cargo.lock files for simulator-graphical and simulator-graphical-bb03 are updated to include already-used dependencies (bitbox-framed-serial-link, time, deranged, num-conv, powerfmt, time-core) so the lockfiles stay in sync with the manifests. This is a deterministic-build/reproducibility guard, not a vulnerability fix.
Changed components
CI workflow (.github/workflows/ci-common.yml)src/CMakeLists.txttest/simulator-graphical/CMakeLists.txttest/simulator-graphical/Cargo.locktest/simulator-graphical-bb03/CMakeLists.txttest/simulator-graphical-bb03/Cargo.lockInspect captured patch +93 / −2
diff --git a/.github/workflows/ci-common.yml b/.github/workflows/ci-common.yml
index b50a8f1..9ddb59a 100644
--- a/.github/workflows/ci-common.yml
+++ b/.github/workflows/ci-common.yml
@@ -14,6 +14,7 @@ on:
required: true
type: string
env:
+ CARGOFLAGS: "--locked"
RUSTFLAGS: "-Dwarnings"
CFLAGS: "-Werror"
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c1f5fdf..6214877 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -403,6 +403,7 @@ foreach(type ${RUST_LIBS})
rustc
$<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:-vv>
--offline
+ $ENV{CARGOFLAGS}
--features target-${type}$<$<OR:$<STREQUAL:${CMAKE_BUILD_TYPE},DEBUG>,$<STREQUAL:${type},factory-setup>>:,rtt>
--manifest-path ${LIBBITBOX02_RUST_SOURCE_DIR}/Cargo.toml
--target-dir ${RUST_BINARY_DIR}/feature-${type}
diff --git a/test/simulator-graphical-bb03/CMakeLists.txt b/test/simulator-graphical-bb03/CMakeLists.txt
index 39422a3..7d45281 100644
--- a/test/simulator-graphical-bb03/CMakeLists.txt
+++ b/test/simulator-graphical-bb03/CMakeLists.txt
@@ -39,7 +39,7 @@ add_custom_command(
RUSTFLAGS=${RUSTFLAGS}
CFLAGS=${CFLAGS}
RUSTC_BOOTSTRAP=1
- cargo build --manifest-path ${CMAKE_CURRENT_SOURCE_DIR}/Cargo.toml --target-dir ${RUST_BINARY_DIR} --target=${LLVM_HOST_TUPLE} --release
+ cargo build $ENV{CARGOFLAGS} --manifest-path ${CMAKE_CURRENT_SOURCE_DIR}/Cargo.toml --target-dir ${RUST_BINARY_DIR} --target=${LLVM_HOST_TUPLE} --release
COMMAND
${CMAKE_COMMAND} -E copy
${RUST_BINARY_DIR}/${LLVM_HOST_TUPLE}/release/simulator-graphical-bb03
diff --git a/test/simulator-graphical-bb03/Cargo.lock b/test/simulator-graphical-bb03/Cargo.lock
index affa721..b09ab5a 100644
--- a/test/simulator-graphical-bb03/Cargo.lock
+++ b/test/simulator-graphical-bb03/Cargo.lock
@@ -323,6 +323,14 @@ dependencies = [
"zeroize",
]
+[[package]]
+name = "bitbox-framed-serial-link"
+version = "0.1.0"
+dependencies = [
+ "crc",
+ "util",
+]
+
[[package]]
name = "bitbox02"
version = "0.1.0"
@@ -384,6 +392,7 @@ version = "0.1.0"
dependencies = [
"bip39",
"bitbox-aes",
+ "bitbox-framed-serial-link",
"bitbox02",
"bitbox02-noise",
"bitbox02-rust",
@@ -917,6 +926,15 @@ version = "0.7.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb"
+[[package]]
+name = "deranged"
+version = "0.5.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587"
+dependencies = [
+ "powerfmt",
+]
+
[[package]]
name = "digest"
version = "0.10.7"
@@ -1822,6 +1840,12 @@ dependencies = [
"num-traits",
]
+[[package]]
+name = "num-conv"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050"
+
[[package]]
name = "num-derive"
version = "0.4.2"
@@ -2261,6 +2285,12 @@ dependencies = [
"universal-hash",
]
+[[package]]
+name = "powerfmt"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
+
[[package]]
name = "ppv-lite86"
version = "0.2.21"
@@ -2940,6 +2970,24 @@ dependencies = [
"zune-jpeg 0.4.21",
]
+[[package]]
+name = "time"
+version = "0.3.46"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9da98b7d9b7dad93488a84b8248efc35352b0b2657397d4167e7ad67e5d535e5"
+dependencies = [
+ "deranged",
+ "num-conv",
+ "powerfmt",
+ "time-core",
+]
+
+[[package]]
+name = "time-core"
+version = "0.1.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca"
+
[[package]]
name = "tiny-skia"
version = "0.11.4"
@@ -3140,6 +3188,7 @@ dependencies = [
"hex",
"num-bigint",
"sha2",
+ "time",
"zeroize",
]
diff --git a/test/simulator-graphical/CMakeLists.txt b/test/simulator-graphical/CMakeLists.txt
index 87b0f70..fa5fd4a 100644
--- a/test/simulator-graphical/CMakeLists.txt
+++ b/test/simulator-graphical/CMakeLists.txt
@@ -39,7 +39,7 @@ add_custom_command(
RUSTFLAGS=${RUSTFLAGS}
CFLAGS=${CFLAGS}
RUSTC_BOOTSTRAP=1
- cargo build --manifest-path ${CMAKE_CURRENT_SOURCE_DIR}/Cargo.toml --target-dir ${RUST_BINARY_DIR} --target=${LLVM_HOST_TUPLE} --release
+ cargo build $ENV{CARGOFLAGS} --manifest-path ${CMAKE_CURRENT_SOURCE_DIR}/Cargo.toml --target-dir ${RUST_BINARY_DIR} --target=${LLVM_HOST_TUPLE} --release
COMMAND
${CMAKE_COMMAND} -E copy
${RUST_BINARY_DIR}/${LLVM_HOST_TUPLE}/release/simulator-graphical
diff --git a/test/simulator-graphical/Cargo.lock b/test/simulator-graphical/Cargo.lock
index 017bc47..22aebd1 100644
--- a/test/simulator-graphical/Cargo.lock
+++ b/test/simulator-graphical/Cargo.lock
@@ -885,6 +885,15 @@ version = "0.7.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb"
+[[package]]
+name = "deranged"
+version = "0.5.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587"
+dependencies = [
+ "powerfmt",
+]
+
[[package]]
name = "digest"
version = "0.10.7"
@@ -1790,6 +1799,12 @@ dependencies = [
"num-traits",
]
+[[package]]
+name = "num-conv"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050"
+
[[package]]
name = "num-derive"
version = "0.4.2"
@@ -2216,6 +2231,12 @@ dependencies = [
"universal-hash",
]
+[[package]]
+name = "powerfmt"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
+
[[package]]
name = "ppv-lite86"
version = "0.2.21"
@@ -2892,6 +2913,24 @@ dependencies = [
"zune-jpeg",
]
+[[package]]
+name = "time"
+version = "0.3.46"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9da98b7d9b7dad93488a84b8248efc35352b0b2657397d4167e7ad67e5d535e5"
+dependencies = [
+ "deranged",
+ "num-conv",
+ "powerfmt",
+ "time-core",
+]
+
+[[package]]
+name = "time-core"
+version = "0.1.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca"
+
[[package]]
name = "tiny-skia"
version = "0.11.4"
@@ -3126,6 +3165,7 @@ dependencies = [
"hex",
"num-bigint",
"sha2",
+ "time",
"zeroize",
]
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.