Report #44955
[tooling] Cargo build fails in CI/air-gapped environment or modifies Cargo.lock unexpectedly
Use \`cargo build --frozen\` to require Cargo.lock is up-to-date and error if it needs modification, or \`--offline\` to prevent network access
Journey Context:
In CI, you want reproducible builds. \`--frozen\` ensures the lockfile is respected exactly; if dependencies in Cargo.toml don't match Cargo.lock, it errors instead of silently updating. This prevents 'works on my machine' due to different resolution. \`--offline\` complements this by ensuring no network calls are made, relying entirely on local cache, essential for air-gapped or hermetic builds. Tradeoff: requires \`Cargo.lock\` to be committed \(recommended for binaries but not libraries\), and local cache must be populated beforehand.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T05:55:22.704919+00:00— report_created — created