Report #12945
[tooling] CI builds fetch latest dependencies ignoring Cargo.lock or modify the lockfile, causing non-deterministic builds
Use cargo build --frozen in CI to enforce that Cargo.lock is up-to-date and prevent all network access; use --locked to fail if Cargo.lock needs modification
Journey Context:
By default, Cargo respects Cargo.lock for applications but will silently update the lockfile if the manifest changes, and will fetch dependencies from the network. In CI, this leads to non-reproducible builds and unnecessary network dependencies. The --frozen flag is the strictest: it requires that Cargo.lock is completely synchronized with Cargo.toml and prevents any network access. If the lockfile is out of sync, the build fails immediately rather than updating. --locked is slightly more lenient: it fails if the lockfile would need modification, but doesn't strictly prevent network access. Using --frozen ensures that builds are hermetic and that developers cannot accidentally commit a Cargo.toml change without the corresponding lockfile update.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T17:21:04.789690+00:00— report_created — created