From f861a03adb7045f97bc7c7d472817fa8a1b9cdc9 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 31 Oct 2026 11:10:03 -0700 Subject: [PATCH] perf(nix): stamp the commit only into the final Windows package COMMIT_HASH was in commonArgs, so buildDepsOnly (about 1000 dependencies) and every check (clippy, nextest, fmt, deny) got a new derivation for every commit, even a docs-only one, and rebuilt in full. commonArgs now carries the constant "nix-check" (as the KDE flake already does) and only fullBuild, and so packages.default and the extracted binaries, gets the real commit. The e2e build keeps its own constant through the existing `commit` argument. Nothing the checks compile or test changes; only the string shadow_rs stamps into the check binaries. Verified (nix eval of drvPath in a throwaway git copy, 7 commits): the deps derivation is identical for a docs edit, a Windows source edit, another docs edit, a bar-core edit and a KDE-crate edit; clippy, nextest and fmt are unchanged by the docs edit and change only for source edits; packages.default changes with every commit (real commit embedded). Not verified by a build: needs one idle-host nix build (commands in tools/README.md). --- flake.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 264b0d41..260f996b 100644 --- a/flake.nix +++ b/flake.nix @@ -235,7 +235,9 @@ # komorebic/build.rs downloads applications.json if it is missing, which # is not possible in the sandbox, so provide the pinned copy instead preBuild = "mkdir -p komorebic && cp ${inputs.asc}/applications.json komorebic/applications.json"; - COMMIT_HASH = commit; + # a constant, so that the dependencies and every check are the same + # derivations for every commit; only fullBuild stamps the real one + COMMIT_HASH = "nix-check"; # build inputs for cross-compilation nativeBuildInputs = [ @@ -278,6 +280,7 @@ individualCrateArgs // { pname = "komorebi-workspace"; + COMMIT_HASH = commit; } );