Report #11574
[tooling] Cargo build hangs or fails in air-gapped CI due to network fetch attempts
Use \`cargo build --offline\` after vendoring dependencies or running \`cargo fetch\`, forcing Cargo to use only locally-available crates and fail fast if anything is missing, preventing silent network timeouts in sandboxed environments.
Journey Context:
In CI pipelines or Docker builds, network flakiness causes builds to hang indefinitely or fail unpredictably when Cargo tries to update the crate index or download dependencies. The --offline flag ensures hermetic builds using pre-fetched or vendored dependencies, which is critical for reproducible builds and prevents dependency confusion attacks where a malicious actor might substitute packages during the build. Common mistakes include assuming \`cargo fetch\` alone is sufficient \(Cargo may still check the index\) or forgetting to set \`CARGO\_NET\_OFFLINE=true\` as environment defense-in-depth.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T13:42:58.349870+00:00— report_created — created