Skip to content

Commit c918263

Browse files
committed
ci: scope the Blacksmith sticky-disk Nix store per job
The sticky-disk key was shared across every Linux job of the same arch. A sticky disk clones the last committed snapshot and re-commits on completion, so jobs that realize different Nix closures (a full dev shell vs. a single `nix build`) overwrote each other's store on the shared key, forcing cold re-downloads from cache.nixos.org — the source of the large run-to-run variance in pkg-pr-new (149s vs 388s). Key the disk by `github.job` so each closure stays warm independently.
1 parent 68cb372 commit c918263

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • .github/actions/setup-linux-blacksmith-sticky-disk

‎.github/actions/setup-linux-blacksmith-sticky-disk/action.yaml‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ runs:
2424
if: steps.blacksmith.outputs.enabled == 'true'
2525
uses: useblacksmith/stickydisk@2b7a836cbb2b48f4780ae76a7b6fd79d545fb54a # v1.3.0
2626
with:
27-
key: ${{ github.repository }}-nix-${{ runner.os }}-${{ runner.arch }}
27+
# Scope the disk per job: a sticky disk clones the last committed
28+
# snapshot and re-commits on completion, so jobs that realize different
29+
# Nix closures (e.g. a full dev shell vs. a single `nix build`) would
30+
# otherwise overwrite each other's store on a shared key and force cold
31+
# re-downloads. Keying by job keeps each closure warm independently.
32+
key: ${{ github.repository }}-nix-${{ runner.os }}-${{ runner.arch }}-${{ github.job }}
2833
path: /nix
2934

3035
- name: Prepare mounted Nix store ownership

0 commit comments

Comments
 (0)