Conversation
Adds a version-diff job that compares every legacyPackages.<system> derivation between a PR's head and base commit and posts the result as a collapsed comment (one <details> per system, folded into its summary line), using nvd for the actual version/added/removed diff. Enumerates legacyPackages directly (via a small linkFarm collector expression) rather than relying on nix-eval's packages_matrix, since that matrix only lists not-yet-cached packages and goes stale/empty once a PR's packages are built and cached -- the wrong signal for "did anything change vs base". Uses a GitHub App token via actions/create-github-app-token so the comment step isn't blocked by the org's "Actions can't create/approve PRs" policy, and grants pull-requests: write only to the comment job.
Building the entire legacyPackages closure on both sides just to nvd-diff two roots meant realizing ~700+ store paths per side per arch even when only one package changed -- most of that time was substituter narinfo lookups and downloads, not building anything. Evaluate each attr's drvPath (pure evaluation, no network) on both sides first. Equal maps mean no changes, decided without touching the store at all. Otherwise only the attrs whose drvPath actually differs get built and nvd-diffed; added/removed attrs are reported directly.
Package version diff: noneCompares built package versions in No Package DifferencesAll packages are hash-identical on all systems ( |
mmlb
reviewed
Sep 14, 2026
Comment on lines
+317
to
+328
| - name: Install nix (ephemeral) | ||
| if: matrix.installer == 'ephemeral' | ||
| uses: ./head/.github/actions/nix-install-ephemeral | ||
| with: | ||
| push-to-cache: 'true' | ||
| env: | ||
| DEV_AWS_ROLE: ${{ secrets.DEV_AWS_ROLE }} | ||
| NIX_SIGN_SECRET_KEY: ${{ secrets.NIX_SIGN_SECRET_KEY }} | ||
|
|
||
| - name: Install nix (self-hosted) | ||
| if: matrix.installer == 'self-hosted' | ||
| uses: ./head/.github/actions/nix-install-self-hosted |
Collaborator
There was a problem hiding this comment.
Pretty sure nix-install-ephemeral can be used for the arm darwin runners too.
Comment on lines
+330
to
+336
| # nix-eval's packages_matrix only lists *uncached* packages, so it | ||
| # cannot be used to decide what to diff. Instead, evaluate every | ||
| # derivation's drvPath under legacyPackages.<system> (recursing into | ||
| # attrsets like nix-eval-jobs --force-recurse does) on both sides. | ||
| # drvPath captures any input change (source, patches, deps, build | ||
| # steps), not just a bumped version string, and evaluating it is pure | ||
| # -- no substituter queries, no downloads, no builds. |
Collaborator
There was a problem hiding this comment.
Worth uploading the nix-eval-job's output as a build artifact that you can then fetch here? This way don't waste time eval'ing all the things twice.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reviving #2299 . This can be used instead of Nix Dependency Analysis workflow as a much faster alternative that won't run out of disk space so easily.
drvPathunderlegacyPackages.<system>on the PR's head and base commits (pure evaluation — no network, no build).nvd— the rest of the closure is never touched.Results are posted as a single collapsed comment per PR, updated in place on subsequent pushes.
Example — no differences: see #2299 ' s first comment.
Example — with a real diff (added package): #2306