From aec2d51e7e6f4dfaff23725e847f70f412a0f531 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Thu, 11 Sep 2025 15:24:44 +0200 Subject: [PATCH] ci/eval: fix local full eval The change to use `builtins.storePath` was good - for when the store path *is* already part of the nix store. In all my tests so far, that was already the case, because I was iterating on the solution and the Eval results stayed the same. But when this is run on a entirely new commit, these the values for `afterDir` and `combinedDir` are *not* in the store, yet. As part of running `eval.full` on a new commit they will be created. `eval.full` is linked up, so that the values passed around there will actually be derivations, which might not be realized, yet. Checking whether the input is a path or not fixes this for both cases. (cherry picked from commit b9d4098221f2321bc4a0af93d515848ed40cce4b) --- ci/eval/compare/default.nix | 7 ++++++- ci/eval/diff.nix | 9 +++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ci/eval/compare/default.nix b/ci/eval/compare/default.nix index 293877036e2f..1c83ea891630 100644 --- a/ci/eval/compare/default.nix +++ b/ci/eval/compare/default.nix @@ -13,7 +13,12 @@ byName ? false, }: let - combined = builtins.storePath combinedDir; + # Usually we expect a derivation, but when evaluating in multiple separate steps, we pass + # nix store paths around. These need to be turned into (fake) derivations again to track + # dependencies properly. + # We use two steps for evaluation, because we compare results from two different checkouts. + # CI additionalls spreads evaluation across multiple workers. + combined = if lib.isDerivation combinedDir then combinedDir else lib.toDerivation combinedDir; /* Derivation that computes which packages are affected (added, changed or removed) between two revisions of nixpkgs. diff --git a/ci/eval/diff.nix b/ci/eval/diff.nix index d22090601d30..692e2ec60194 100644 --- a/ci/eval/diff.nix +++ b/ci/eval/diff.nix @@ -11,8 +11,13 @@ }: let - before = builtins.storePath beforeDir; - after = builtins.storePath afterDir; + # Usually we expect a derivation, but when evaluating in multiple separate steps, we pass + # nix store paths around. These need to be turned into (fake) derivations again to track + # dependencies properly. + # We use two steps for evaluation, because we compare results from two different checkouts. + # CI additionalls spreads evaluation across multiple workers. + before = if lib.isDerivation beforeDir then beforeDir else lib.toDerivation beforeDir; + after = if lib.isDerivation afterDir then afterDir else lib.toDerivation afterDir; /* Computes the key difference between two attrs