ci: cap CARGO_BUILD_JOBS at nproc/2 in both build workflows #30
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/cargo-build-jobs-nproc-half"
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?
Problem
Both
build-binary.ymlandbuild-binary-windows.ymlsetCARGO_BUILD_JOBSto fullnproc((sys cpu | length)), so the 32-CPU runner builds withCARGO_BUILD_JOBS=32and oversubscribes the host. The Linux workflow's "one build per runner" comment was the stated assumption behind using the full host; that assumption does not hold for the runner fleet.Fix
Cap at
nproc / 2, matching the dynamic formula in governanceCI.md-> "Concurrency cap" ((sys cpu | length) / 2 | into int). On the 32-CPU runner that yieldsCARGO_BUILD_JOBS=16; it scales with whatever host the job lands on. Concurrency across jobs is managed at the runner level, not in the workflow, so the cap is unconditional rather than keyed on how many builds happen to share a host.The Dockerfile default (
ARG CARGO_BUILD_JOBS=2) is unchanged, per governance, so ad-hoc local builds stay conservative.Notes
Workflow-only change; no Rust code touched. Independent of the open Windows OpenSSL PR (different lines).