A CI job's Cargo outputs go to its own folder; the compiled crates stay shared #134
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!134
Loading…
Reference in a new issue
No description provided.
Delete branch "PIPT-18-cargo-build-dir"
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?
Tracked on https://openproject.home.romaine.life/wp/PIPT-18. Found when
CI / setup-windowsfailed on #131 with "Cargo source list contains no tracked inputs".Cause: in CI, a Rust job's
CARGO_TARGET_DIRwas the kept folder shared by every run of that repository's job (cargo-target/<repo>/<toolchain>/<job>-<platform>). Cargo locks it only while it builds.rust/build.mjsthen readsrelease/<name>.exeandrelease/<name>.d, and a concurrent run of the same job can replace both in between. Run 566 (PR 131) and run 568 (another PR) overlapped for four minutes on the Windows runner. 566 read 568's.d, which names the other run's fixture folder. A release build of two merges close together could ship the wrong binary the same way.Changed: when
RUNNER_TEMPis set (CI),rust/cache.mjspoints Cargo'sbuild-dir(stable since Cargo 1.91; the suites run 1.100) at the kept folder andCARGO_TARGET_DIRat$RUNNER_TEMP/cargo-target. The compiled crates stay shared and cached. The final binaries and dependency lists go to the job's own folder.rust/lint.mjs's tool installs set their own build-dir so they don't land in the repository's cache.Unchanged: cache keys, toolchain cleanup and the Linux lock. Local runs (
ci-check, noRUNNER_TEMP) work as before.Proven: locally with Cargo 1.99,
build-dirshared andtarget-dirper run: the exe and.dland in the run's own folder, and a second run with a new target dir reports the crateFreshand uplifts without recompiling. Suite unit tests pass (93). This PR changessuites/**/*.mjs, sosetup-linuxandsetup-windowsrun the real fixture release builds on it.