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