From 3c87dbb39169f527040e0751ec8c0df0af99e66c Mon Sep 17 00:00:00 2001 From: "claude@clouddev1" Date: Thu, 18 Jun 2026 21:24:34 +0000 Subject: [PATCH] fix(ci): create the profile dir so macOS nix prune keeps the toolchain warm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The prune step's profile path $HOME/.cache/rdbms-ci/toolchain had no parent dir, so `nix develop --profile` errored ("cannot read directory") and — swallowed by `|| true` — never created the profile/gc-root. With nothing rooting the toolchain, nix-collect-garbage deleted the whole closure every run (~3.8 GiB re-downloaded each dispatch; confirmed in the run-74 log). Add `mkdir -p` for the parent and drop the `|| true` on the profile realization so a future breakage fails loudly. The VM stays bounded as before, but the toolchain now persists across runs. release-macos.yaml is workflow_dispatch (runs from main's definition), so this takes effect on the next dispatch — the already-published v0.2.0 macOS binaries are unaffected. --- .gitea/workflows/release-macos.yaml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/release-macos.yaml b/.gitea/workflows/release-macos.yaml index 8f75829..628f29e 100644 --- a/.gitea/workflows/release-macos.yaml +++ b/.gitea/workflows/release-macos.yaml @@ -84,12 +84,21 @@ jobs: # The runner wipes the workspace each run, so cargo target/ never # accumulates. Bound the persistent nix store by generation: record the # current devShell as a generation of a persistent profile (in $HOME), - # keep the 2 newest, reclaim what older ones referenced. + # keep the 2 newest, reclaim what older ones referenced — so the + # toolchain stays *warm* across runs and only stale generations are GC'd. + # + # The profile's parent dir MUST exist first, or `nix develop --profile` + # errors ("cannot read directory …") and the profile/gc-root is never + # created — which made `nix-collect-garbage` delete the whole toolchain + # closure every run (re-downloaded ~3.8 GiB each time; the retention was + # silently broken by the swallowed `|| true`). No `|| true` on the + # profile realization now: a future breakage should fail loudly. if: always() run: | echo "--- disk before ---"; df -h / | tail -1 P="$HOME/.cache/rdbms-ci/toolchain" - nix develop --profile "$P" -c true || true + mkdir -p "$(dirname "$P")" + nix develop --profile "$P" -c true nix-env -p "$P" --delete-generations +2 || true nix-collect-garbage || true echo "--- disk after ---"; df -h / | tail -1