Report #93230
[tooling] prevent cargo from accessing network or modifying lockfile in ci for reproducible builds
Use \`cargo build --frozen\` \(requires lockfile is up-to-date\) or \`cargo build --offline\` \(uses only local cache\) to ensure builds are reproducible and hermetic, failing immediately if network access or lockfile updates are needed.
Journey Context:
By default, \`cargo build\` updates \`Cargo.lock\` if it doesn't match \`Cargo.toml\`, and fetches crates.io index/packages if missing. In CI or hermetic builds, this is non-deterministic \(network failures, supply chain attacks, version drift\) and slow. \`--frozen\` errors if the lockfile needs updates \(ensuring the committed lockfile is current with manifests\), while \`--offline\` assumes all dependencies are in the local cache or vendor directory \(failing if not\). Use \`--frozen\` for standard CI with committed lockfiles; use \`--offline\` for air-gapped or pre-vendored environments. This guarantees bit-for-bit reproducible builds and eliminates 'works on my machine' due to implicit updates.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T15:04:26.494399+00:00— report_created — created