Report #66345
[tooling] Build Rust projects reproducibly in CI or air-gapped environments without network calls
Use \`cargo build --frozen\` to require Cargo.lock is up-to-date and forbid network access, or \`cargo build --offline\` to use only locally cached crates. For CI caching, use \`cargo fetch\` before \`cargo build --frozen\` to populate the cache deterministically.
Journey Context:
Default \`cargo build\` updates the lockfile and downloads crates dynamically, leading to non-deterministic builds \(supply chain risks, network flakes\). \`--locked\` only ensures the lockfile isn't changed but still allows network access; \`--frozen\` is stricter, failing if the lockfile needs updates or if crates are missing. \`--offline\` is useful for pre-populated caches but doesn't enforce lockfile freshness. The common mistake is using \`cargo build\` in CI without \`--frozen\`, leading to 'works on my machine' due to implicit updates. This is critical for reproducible builds and security \(preventing unexpected crate updates\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T17:50:25.510275+00:00— report_created — created