Repository navigation
Commit f0b5ba8
committed
perf(ci): pin crane deps in a Nix profile to persist across runs
The check, test, and native-build jobs recompiled the entire crate dependency
set (~3 min on the arm runner) on nearly every run, even though the deps
derivation is deterministic. The Blacksmith sticky disk persists the store but
trims it to GC roots on commit, and crane's cargoArtifacts is an unrooted
intermediate (referenced only at build time), so it was dropped and rebuilt.
Pin the deps into a Nix profile after they are built. Profiles are the one root
that survives the trim (confirmed by inspecting a restored disk and a CI A/B:
`nix flake check` dropped from ~184s to ~38s with zero dependency recompilation
on the warm run).
- new `pin-nix-deps` composite action: `nix-env --set` the cargoArtifacts path
into /nix/var/nix/profiles/ccusage-deps.
- check + test jobs pin the glibc deps (`.#ccusage.cargoArtifacts`).
- the Linux native build pins the musl deps (`.#ccusage-static.cargoArtifacts`);
re-expose them via passthru.
Each job has its own sticky disk, so each pins its own deps.1 parent f28fa45 commit f0b5ba8
4 files changed
Lines changed: 39 additions & 0 deletions
File tree
- .github
- actions
- build-linux-native-package
- pin-nix-deps
- workflows
- nix
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
65 | 71 | | |
66 | 72 | | |
67 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
75 | 82 | | |
76 | 83 | | |
77 | 84 | | |
| |||
0 commit comments