home-cache writes Cargo's and NuGet's shared config only when it differs (FZT2-10) #344

Merged
merge-queue merged 1 commit from FZT2-10-cargo-config-once into main 2026-12-01 02:09:42 -08:00
Owner

On a Windows runner, home-cache rewrote the runner user's ~/.cargo/config.toml (and %APPDATA%\NuGet\NuGet.Config) in every job. Two jobs starting together on one PC both rewrote it, and the second failed with the file in use: tuimail's arm64 release check failed this way on upstairspc (romaine-life/tuimail#72: The process cannot access the file 'C:\Users\upstairspc\.cargo\config.toml' because it is being used by another process).

  • Changed: both files go through Set-Shared, which writes only when the content differs, reading it in a way that allows another job's write handle. A PC that already has them never writes them again. Two jobs meeting on a PC's first write retry for up to two seconds.
  • Left alone: the files' content, Linux's branch, and tofu.tfrc (per job, in RUNNER_TEMP).
  • Checked: run against a file another process holds open for writing, the same content leaves it untouched with no error (the old Set-Content, and a plain ReadAllText, both fail there); changed content is written. This PR's home-cache-windows and setup-windows jobs run the step on a runner.

Work package: https://openproject.home.romaine.life/wp/FZT2-10

🤖 Generated with Claude Code

On a Windows runner, `home-cache` rewrote the runner user's `~/.cargo/config.toml` (and `%APPDATA%\NuGet\NuGet.Config`) in every job. Two jobs starting together on one PC both rewrote it, and the second failed with the file in use: tuimail's arm64 release check failed this way on upstairspc (https://forgejo.romaine.life/romaine-life/tuimail/pulls/72: `The process cannot access the file 'C:\Users\upstairspc\.cargo\config.toml' because it is being used by another process`). - Changed: both files go through `Set-Shared`, which writes only when the content differs, reading it in a way that allows another job's write handle. A PC that already has them never writes them again. Two jobs meeting on a PC's first write retry for up to two seconds. - Left alone: the files' content, Linux's branch, and `tofu.tfrc` (per job, in `RUNNER_TEMP`). - Checked: run against a file another process holds open for writing, the same content leaves it untouched with no error (the old `Set-Content`, and a plain `ReadAllText`, both fail there); changed content is written. This PR's `home-cache-windows` and `setup-windows` jobs run the step on a runner. Work package: https://openproject.home.romaine.life/wp/FZT2-10 🤖 Generated with [Claude Code](https://claude.com/claude-code)
home-cache writes Cargo's and NuGet's shared config only when it differs (FZT2-10)
All checks were successful
CI / home-cache-linux (pull_request) Successful in 34s
CI / cache-save (windows-latest) (pull_request) Has been skipped
Suite release / module (pull_request) Has been skipped
Suite release / check-build (none, ubuntu-latest) (ubuntu-latest, none) (pull_request) Has been skipped
Suite release / check-package (pull_request) Has been skipped
Suite release / publish (pull_request) Has been skipped
Suite release / deliver (pull_request) Has been skipped
Suite release / reserve (pull_request) Has been skipped
Suite release / reused-checks (pull_request) Has been skipped
Suite release / deploy-image (pull_request) Has been skipped
CI / check-fetches (pull_request) Has been skipped
Suite release / finalize (pull_request) Has been skipped
Suite release / check-manifest (pull_request) Has been skipped
CI / cache-save (ubuntu-latest) (pull_request) Has been skipped
CI / service-runtime (one) (pull_request) Has been skipped
Suite release / build (none, ubuntu-latest) (ubuntu-latest, none) (pull_request) Has been skipped
Suite release / deliver-prune (pull_request) Has been skipped
CI / release-version (pull_request) Has been skipped
CI / check-versions (pull_request) Has been skipped
CI / check-image-digests (pull_request) Has been skipped
Suite default / scope (pull_request) Successful in 31s
Suite default / check-rules (pull_request) Has been skipped
Suite default / check-logs (pull_request) Has been skipped
Suite release / scope (pull_request) Successful in 28s
CI / home-cache-windows (pull_request) Successful in 23s
Suite default / check-fetches (pull_request) Successful in 33s
Suite default / reused-checks (pull_request) Successful in 29s
CI / setup-linux (cluster) (pull_request) Successful in 4m56s
CI / setup-windows (pull_request) Successful in 8m38s
merge-queue landed on main
c75a90c39f
merge-queue deleted branch FZT2-10-cargo-config-once 2026-12-01 02:09:42 -08:00
Sign in to join this conversation.
No description provided.