From 6d2dc5ff1a713189edeb62315149a7b5ff3daf1b Mon Sep 17 00:00:00 2001 From: rob thijssen Date: Mon, 18 May 2026 17:26:29 +0300 Subject: [PATCH] fix(ci): give fmt/clippy/test distinct CARGO_TARGET_DIR to avoid races After the candle deps were added, cargo builds run long enough that the parallel fmt/clippy/test jobs (all on the `rust` runner label, which appears to use act in host-executor mode) start racing each other's intermediate temp files under /root/.cache/act//hostexecutor/target/debug/deps/ Concretely the test job hit: error: No such file or directory at path "target/debug/deps/.tmprlicL7" Compiling unicode-ident because another job's cargo invocation cleaned up the temp file mid-compile. fmt and clippy happened to finish without their own target races landing fatally, so only test failed visibly. Set CARGO_TARGET_DIR=target-${{ github.job }} at the workflow level so each job writes to its own target directory. sccache still backs the actual rustc cache, so the rebuild penalty is just metadata not full recompiles. Co-Authored-By: Claude Opus 4.7 (1M context) --- .gitea/workflows/ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index e51ab68..5917fce 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -16,6 +16,13 @@ env: SCCACHE_S3_USE_SSL: "false" AWS_ACCESS_KEY_ID: ${{ secrets.SCCACHE_S3_ACCESS_KEY }} AWS_SECRET_ACCESS_KEY: ${{ secrets.SCCACHE_S3_SECRET_KEY }} + # fmt, clippy, and test all run in parallel on the same `rust` runner + # and would otherwise share /root/.cache/act//hostexecutor/target/, + # racing each other's cargo temp files (.tmpXXXXXX) and failing builds + # mid-compile. Give each job its own target directory so the invocations + # don't collide. sccache still backs the actual rustc cache, so the + # rebuild penalty is small. + CARGO_TARGET_DIR: target-${{ github.job }} jobs: fmt: