Overlapping runs of one Rust job build in separate copies of its folder #333
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
queue
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
romaine-life/pipeline-templates!333
Loading…
Reference in a new issue
No description provided.
Delete branch "PIPT-91-cargo-slots"
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?
Two runs of the same Rust job in one repository (another pull request's, or a matrix entry) shared one kept Cargo build folder. Cargo's lock covers a build, not reading its outputs afterwards, so rustdoc could link an
.rlibthe other run was replacing: at-terminal PR #63'scheck-test-linuxfailed withextern location for rio_window does not existwhile PR #64's same job ran in the same folder.What changes, in
suites/rust/cache.mjs:<job>.2,<job>.3and on. An overlapping run builds at once in its own copy instead of waiting, and a run with no overlap keeps today's warm folder, so no cache goes cold.flock -n -s <toolchain>.lock flock -n -E 75 -x <copy>.lock, so the copy is held for the whole job and released when it ends. Exit 75 means another run holds the copy, so it tries the next.<copy>.claimfile holding its process id, created exclusively and removed when the process exits. A claim whose process is gone is renamed away before it's taken over, so two runs can't both take it.CARGO_BUILD_BUILD_DIR/CARGO_TARGET_DIRand theCI_CARGO_LOCKEDtest bypass are unchanged.cargoCachetakes the toolchain as an optional second argument so tests needn't run rustc.Proof:
cargoCachethat overlap, check they get different folders, and check that a third, started after the first ends, gets the first's folder. The claim test covers a held claim and taking over a gone one. They pass on Windows (pull-request check, suite-tests-windows); suite-tests-linux runs them through the flock path.flockcalls were checked on Linux (util-linux 2.34): 75 while the copy is held, the command's own exit code otherwise, 0 again after release.Work package: PIPT-91
🤖 Generated with Claude Code
merge-queue stopped this at
5e13985: CI failed: CI / suite-tests-windows (pull_request). Push a fix. A failure fixed on main lands once thequeuelabel is removed and added again: the queue merges main in and CI runs on the new head.merge-queue stopped this at
5e13985: CI failed: CI / setup-windows (pull_request), CI / suite-tests-linux (pull_request), CI / suite-tests-windows (pull_request). Push a fix. A failure fixed on main lands once thequeuelabel is removed and added again: the queue merges main in and CI runs on the new head.5e139856817ebb98c07c