Repository navigation
build: compile build-script C in parallel; forbid pinned codegen-units = 1 (#3253) - #3255
Conversation
A pinned single codegen unit works around a bug instead of fixing it (forge-ci/soldr#4014); cargo picks the unit count itself.
7ca5b10 to
8494568
Compare
zackees
left a comment
There was a problem hiding this comment.
Coordinator review: cc's parallel feature uses cargo's jobserver, so the C compiles stay within -j. That keeps them within the shared-machine limits in docs/ci-tooling.md, with no extra oversubscription. Both ratchets walk every workspace manifest, including nested profile.*.package.* tables and cc under all three dependency tables, so a later codegen-units = 1 or a serial cc can't slip back in. The PR body should include a before/after cold-build time for obs-c-oracle, since the docstring claims it took tens of minutes. No blocking findings.
|
More evidence from a normal worker build: |
What
cccompiles build-script C in parallel. obs-c-oracle, obs-data and obs-util now enablecc'sparallelfeature on their build-dependency, so their build scripts compile C files concurrently through the cargo jobserver. Workspace dependencies carry no features (ci/test_workspace_dependencies.py), so each crate enables it itself. Before, onlyobs-buildenabled it, and feature unification never reached the oracle's graph (cargo tree -i ccshowed onlydefault), so obs-c-oracle's 225+ translation units compiled one at a time on every cold rebuild.codegen-units = 1.ci/test_cargo_release_profile.pynow fails if any profile in the root,rust/*ordylints/*manifests pinscodegen-units = 1. A pin works around a bug instead of fixing it, so cargo chooses the unit count. That is the maintainer's decision; the soldr side is Remove pinned codegen-units = 1 (zccache amalgamation, release): fix the fan-out bug, select codegen units automatically forge-ci/soldr#4014. I checked the rustc command line of a release build: soldr injects nocodegen-units, so we get cargo's default.RED → GREEN
ci/test_cc_parallel.pyfails on master withrust/obs-c-oracle/Cargo.toml [build-dependencies] cc lacks the parallel feature, and the same for obs-data and obs-util.parallel, and the test passes../lintpasses, includingtest_workspace_dependencies.py, which failed CI on the first push.Measurement
A cold
soldr cargo build -p obs-c-oracle(debug), with a freshCARGO_TARGET_DIRandZCCACHE_DISABLE=1so nothing comes from cache, on a 16-thread Ryzen 7 3700X with load average 14-22 from other workers:cc)parallel)Cargo.lockis unchanged, sincejobserverandlibcwere already locked throughobs-build.Test cost: two
ci/Python checks that read TOML, about 1 ms each.Fixes #3253. Refs #3249.