fix: cap amd64 build memory to fit Forgejo runner budget #56
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/amd64-build-oom-mitigation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Refs #53.
Diagnosis
The amd64 container-image job has been failing deterministically inside Kaniko's
cargo buildstep (signal: 9, SIGKILL) with no log surfaced through the Forgejo Actions API. Two pieces of evidence pointed at OOM:The Forgejo amd64 runner appears to have a similar memory ceiling. Kaniko's runner cleanup also wipes the task log artifacts, which is why the API has been returning
task with job_id N and attempt 0: resource does not existfor these failed runs — the OOM happens during the longest step, the runner gets killed, the log never flushes.Fix
Cap memory pressure inside the Dockerfile so the build no longer needs runner-side swap:
CARGO_BUILD_JOBS=1— only one rustc at a time, eliminating the multiplicative peak from parallel codegen on a 4-8 core runner.CARGO_PROFILE_RELEASE_CODEGEN_UNITS=256— smaller codegen units mean a lower per-unit memory peak when the linker pulls them in. With jobs=1 the wall-clock impact is small.--verbose— if it still crashes, rustc's progress shows up in the Forgejo log.uname / nproc / free -h / df -hprinted before and after the build so the next failure tells us the runner envelope without UI log access.Why this doesn't change the released binary
codegen-unitscontrols the compile-time chunking of crate code, not the optimizer's behavior on the resulting code.opt-levelis unchanged from the release default (3). LTO is off (default). The output binary is functionally and performance-equivalent.Validation
Local Rust CI matrix on uvm:
cargo fmt --check— clean.cargo test --locked— 86 passed, 3 ignored (kernel-WG, expected).cargo clippy --locked --all-targets -- -D warnings— clean.CI will need a tag push to actually exercise the container-image workflow. After this PR merges I will push a temporary
v0.0.0-debug-amd64tag, watch the workflow, and either close #53 (if amd64 succeeds) or attach the new error signature for further work.