Commit graph

65 commits

Author SHA1 Message Date
NAHO dec908b169
treewide: remove optional builtins prefixes from prelude functions
Remove optional builtins prefixes from prelude functions by running:

    builtins=(
      abort
      baseNameOf
      break
      derivation
      derivationStrict
      dirOf
      false
      fetchGit
      fetchMercurial
      fetchTarball
      fetchTree
      fromTOML
      import
      isNull
      map
      null
      placeholder
      removeAttrs
      scopedImport
      throw
      toString
      true
    )

    fd --type file --exec-batch sed --in-place --regexp-extended "
      s/\<builtins\.($(
        printf '%s\n' "${builtins[@]}" |
          paste --delimiter '|' --serial -
      ))\>/\1/g
    "

    nix fmt
2025-09-30 09:05:08 +02:00
Philip Taron 3d0e2841b8
ci.eval.compare: keep warnings as warnings rather than raising them as errors
This reverts commit f8210561f3 (ci.eval.compare: turn warnings into errors, 2025-09-16).

It turns out that there are normal math warnings and we don't want to block CI on the math coming out wrong.
2025-09-18 08:37:36 -07:00
Philip Taron d80d4a77b7
ci.eval.compare: split out equivalent values into their own table 2025-09-17 14:04:28 -07:00
Philip Taron fb1647ec6e
ci.eval.compare: explain the various metrics under the --explain flag 2025-09-17 14:04:28 -07:00
Philip Taron c9860ef95c
ci.eval.compare: remove the duplicate cpuTime key 2025-09-17 14:04:28 -07:00
Philip Taron 2817f79649
ci.eval.compare: put things with counts together 2025-09-17 14:04:28 -07:00
Philip Taron 210e3e1151
ci.eval.compare: put things with bytes together 2025-09-17 14:04:28 -07:00
Philip Taron 3edc1e204e
ci.eval.compare: make the table format using tabulate not manually 2025-09-17 14:04:28 -07:00
Philip Taron 4eaa094f20
ci.eval.compare: sort time metrics first, then GC metrics, then everything else 2025-09-17 14:04:28 -07:00
Philip Taron e83e900874
ci.eval.compare: assert types in flatten_data 2025-09-17 14:04:28 -07:00
Philip Taron 9959a4e507
ci.eval.compare: delete unreferenced global 2025-09-17 14:04:28 -07:00
Philip Taron e4101ea3a9
ci.eval.compare: instead of manually tabulating, use tabulate 2025-09-17 14:04:28 -07:00
Philip Taron 7818a245f7
ci.eval.compare: support passing single files to cmp-stats 2025-09-17 14:04:27 -07:00
Philip Taron 4bc54e7a3a
ci.eval.compare: allow before_vals == 1 but avoid the t-test 2025-09-17 14:04:27 -07:00
Philip Taron f8210561f3
ci.eval.compare: turn warnings into errors
This helps detect my math errors
2025-09-17 14:04:27 -07:00
Philip Taron 4c7ec9bf20
ci.eval.compare: require the directories to exist (they always should) 2025-09-17 14:04:27 -07:00
Philip Taron 241bb94b64
ci.eval.compare: use argument parsing instead of environment variables to pass before/after to cmp-stats.py 2025-09-17 14:04:27 -07:00
Philip Taron 2fe7b1cec2
ci.eval.compare: extract a derivation for cmp-stats
It's not very useful yet.
2025-09-17 14:04:27 -07:00
Philip Taron 4c2c6d9c43
ci.eval.compare: extract main function in cmp-stats.py 2025-09-17 14:04:27 -07:00
Philip Taron 6900cf62ee
ci.eval.compare: sort imports in cmp-stats.py 2025-09-17 14:04:27 -07:00
Philip Taron a3c01782d3
ci.eval.compare: format cmp-stats.py with ruff 2025-09-17 14:04:27 -07:00
Wolfgang Walther e5ce5c2500
ci/eval/compare: add 10.rebuild-nixos-tests label (#439255) 2025-09-15 14:29:47 +00:00
Wolfgang Walther b9d4098221
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.
2025-09-11 20:18:48 +02:00
Wolfgang Walther 45a765a282
ci/eval: fix local comparison with baseline
Due to how we pass in existing store paths via CLI arguments for the
diff and combine scripts, Nix didn't register a dependency on the store
paths properly. This meant that some of the derivations that were built,
didn't have the right store paths made available in the sandbox -
leading to all kinds of "not found" errors.

We worked around this in CI by resolving the symlinks to the nix store
beforehand. We tried to work around this locally by storing the nix
store path in BASELINE, but this didn't fully work. By explicitly
registering these store paths as dependencies, this should work across
the board - without any magic required by the caller.
2025-09-10 14:35:46 +02:00
Wolfgang Walther 63e6fc4c43
ci/eval/compare: add 10.rebuild-nixos-tests label
This indicates that the NixOS test-driver changed and all NixOS tests
have to be rebuilt. It can be used to either re-target to staging or to
batch this with other similar changes, at least.
2025-09-04 21:27:30 +02:00
Wolfgang Walther 5c4608656e
top-level/release-outpaths: move to ci/eval & refactor (#439221) 2025-09-03 16:27:37 +00:00
Wolfgang Walther f2ca5796de
ci/eval/compare: handle missing packages
Not all packages that are reported as changed will actually exist on the
platform that the maintainers are colleted on.

This is the case for some attributes that are only available on Darwin
or explicitly set to `null` on Linux. By filtering out packages without
maintainers, these are ignored - and we should potentially get a small
performance improvement as well.
2025-09-01 15:50:05 +02:00
Wolfgang Walther 2aae142529
ci/eval: remove ofborg references
By now, these files have been changed enough to not need the "vendored
from" notes anymore. These links would still be there when going through
the history of the file, but today GHA CI has not many similarities
anymore to what ofborg did, so these are not really helpful.
2025-08-31 12:15:06 +02:00
Wolfgang Walther 4126ef7e00
ci/eval/compare: refactor
Simplification after the last step.
2025-08-30 17:56:35 +02:00
Wolfgang Walther e88dd3a8b2
ci/eval/compare: only check changed attrpaths
It makes no sense to check newly added attrpaths for maintainers on the
target branch - by definition these attrpaths won't exist, yet. We can
avoid falling back to `null` for these etc.
2025-08-30 17:56:30 +02:00
Wolfgang Walther 0753aa4580
ci/eval/compare: remove package validity check
This should not be necessary anymore, because packages that fail to
evaluate should already be filtered out by the attrpath generation step
in main eval.
2025-08-30 17:56:27 +02:00
Wolfgang Walther 540e188796
ci/eval/compare: ping maintainers of removed packages
This change pings maintainers of actually removed packages, aka where
the package's expression is deleted.

This will not ping maintainers of packages that become invisible,
because a (transitive) dependency of them is marked as insecure or
broken.
2025-08-30 15:24:13 +02:00
Wolfgang Walther f05895fb3c
ci/eval/compare: reorder step summary
Move "Packages" up, because it's much shorter and easier to scroll past.
This way both Packages and Performance are visible immediately.
2025-08-12 10:13:56 +02:00
Wolfgang Walther 5c697b8aea
ci/eval: reduce closure size
`procps` pulls in 180 MB of systemd, but busybox also provides `kill`.
`busybox` also ships `time`, so no need for that extra dependency.

Using `nativeBuildInputs` pulls in all the -dev outputs of the listed
packages - which we don't need. We only need to run these tools, thus
map to their bin outputs.

Brings down the closure size from 500+ MB to 193 MB for the Eval job.
This probably saves ~10 seconds for the job.
2025-08-09 11:55:03 +02:00
Wolfgang Walther c5c7cd5bc7
ci/eval/compare: don't treat renames as rebuilds
When a package's attrpath is renamed it is currently treated as a
rebuild, even though the outpath already exists and is already cached.

This also happens when adding new names for packagesets that already
exist, for example when starting to eval `perlPackages` in CI, which is
just the same as `perl540Packages` currently. It would also happen when
`perlPackages` is switched from `perl540Packages` to `perl999Packages`.
Assuming that `perl999Packages` had already been built before, this
doesn't really cause any rebuilds.
2025-08-06 18:18:35 +02:00
Matt Sturgeon 7c7009a3da
ci/eval: fix comparing to null in getLabels
Check if `to` is null _before_ comparing it to `rebuildCount`.
2025-06-22 20:27:41 +01:00
Wolfgang Walther 5b5b18c875
workflows/labels: manage labels with a single API call
Instead of deleting each label separately and then making another call
to add new labels, this replaces all labels at once, thus saving API
calls in some cases. Also, the labels are now managed in object-style
compared to the array-style before. This allows putting all the
knowledge about each label into a single place instead of in multiple
places. For example, the rebuild labels had to be special cased in the
workflow before - and the nix code to compare had to match that. Also,
the approval labels had to be considered in the `before` and `after`
phases.

The next commit shows how easy it is to add a new label now.
2025-06-22 14:09:04 +02:00
Wolfgang Walther 19ce5d94bc
ci/eval/compare: fix rebuild-stdenv labels
Those have not been working since before the migration from OfBorg.
Those `rebuildsByKernel` are an attrset of lists coming from
`groupByKernel` (also see lengthy comment at the top of the file) - thus
we need `lib.elem` instead.
2025-06-21 13:08:13 +02:00
Wolfgang Walther 4b31cabd6c
workflows/eval: add header for packages in summary
After the stats were added with a header, the list of packages now
appeared directly below it, without any separation.
2025-05-31 14:35:05 +02:00
Wolfgang Walther 8a39ce4a48
workflows/eval: diff outpaths immediately
This moves the diff of outpaths into the outpaths job, mainly as a
preparation to allow future improvements. For example, this will allow
running the purity release checks only on changed outpaths instead of
the whole eval.

This also removes the inefficiency introduced in the last commit about
uploading the intermediate paths twice. Now, only the diff is passed on.

Also, technically, the diff is now run in parallel across 4 jobs. This
should be *slightly* faster than before, where outpaths from all systems
were combined first and then diffed. It's probably only a few seconds,
though.
2025-05-25 19:26:08 +02:00
Wolfgang Walther b2579d36ff
workflows/eval: consistently avoid "result" in arguments
Everything is a result, especially when nix-build uses "result" as its
default output. This becomes confusing, when re-wiring the different
parts later.

Thus, consistently name those things after some of their properties and
avoid the term result.
2025-05-25 19:23:12 +02:00
Wolfgang Walther d87d760dfa
ci/eval.compare: use lib from pinned nixpkgs
compare/maintainers.nix needs to access the current checkout to check
attrpaths, but makes the mistake of using lib from that checkout as
well. All other code in ci/ uses the pinned nixpkgs instance, so
maintainers.nix should do so as well.
2025-05-24 12:36:15 +02:00
Winter d52066e2b1 ci/eval/compare: manage the "by: package-maintainer" label
While OfBorg is still adding these, it takes a much longer time to do so
compared to the eval action. Since we're adding rebuild labels, I think
it'd be nice to just do it within the eval action.
2025-05-17 15:45:13 -04:00
Winter a7eef26e86
check-meta: wrap maintainers attribute to include team members (#402991) 2025-05-07 17:11:15 -04:00
Johannes Kirschbauer 4f64ebd02b
ci/eval-stats: sort output table by metric name 2025-05-07 18:05:07 +02:00
Johannes Kirschbauer 0d584f7c8f
ci/compare: nix stats comparison
Displays stats table in the step-summary if there are no added/removed packages
2025-05-06 21:49:18 +02:00
Morgan Jones 92bd743239
ci/eval: use correct maintainer and team positions
We need to pass through the maintainers and teams positions from the
original meta so pings work correctly, since check-meta clobbers the
original attribute positions in them.

Tested with `maintainers/scripts/get-maintainer-pings-between.sh` on a
handful of major packages maintained by both individuals and teams.
2025-05-05 23:45:13 -07:00
Johannes Kirschbauer a3520e9577
Revert "ci/compare: Bring back nix stats comparison" 2025-05-01 23:02:38 +02:00
Johannes Kirschbauer 78e8992345
ci/compare: nix stats comparison
Displays stats table in the step-summary if there are no added/removed packages
2025-05-01 22:41:12 +02:00
Morgan Jones e5306ea0ae
ci/eval/compare: support optional byName argument
Sometimes it is quite useful to output names instead of GitHub IDs, e.g.
for maintainer scripts that show you who you would ping. Add this as an
option, but keep the existing default.
2025-04-17 23:54:29 -07:00