Commit graph

31 commits

Author SHA1 Message Date
Wolfgang Walther
ea2ba8b5c1
ci/eval: don't evaluate packages marked as broken (#409867) 2025-05-28 13:36:19 +00: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
138393e0ba
ci/eval.combine: avoid parsing of plain text file into JSON
Instead of parsing a plain text file with jq, we can make nix-env output
JSON directly, which is significantly faster.

This saves about 8 out of 10 seconds for the combine step.
2025-05-24 12:36:15 +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
Wolfgang Walther
eccd9564ab
ci/eval: improve api when calling in steps
Previously, `eval.full` organized the results for the supported systems
in a specific layout, i.e. with a folder with one subfolder per system.
Then, `eval.combine` relied on that.

When using `eval.singleSystem` and `eval.combine` directly, the caller
was responsible to recreate the same layout. This is annoying and
error-prone to do, when downloading artifacts from CI to recreate some
steps locally.

With this change, all the artifacts can be downloaded and extracted into
the same folder - because the result from `eval.singleSystem` already
contains the <system-name>/ subfolder.
2025-05-24 12:36:14 +02:00
Winter
5240bdf3c6
ci/eval: don't evaluate packages marked as broken
We really can't expect packages that are marked as broken to evaluate,
and *especially* not on unsupported platforms.

For context, we were attempting to eval them *past* the broken throw
previously, which caused fun side effects like [0].

When we set `includeBroken = true` before, this also included unfree
packages. Those would now be excluded, which is not what we want. Thus,
we explicitly enable them separately.

Commit by winterqt, message slightly reworded by wolfgangwalther.

[0]:
https://github.com/NixOS/nixpkgs/issues/355847#issuecomment-2878873137
2025-05-22 21:38:02 +02:00
Wolfgang Walther
edaf51cb83
ci/eval: remove left-over stats.json
This seems to be a left-over from before the performance comparison was
changed to a difference-per-chunk analysis.
2025-05-18 16:50:20 +02:00
Robert Hensing
529143f3d7 ci/nix: 2.24 -> 2.28 2025-05-17 21:51:19 +02:00
Winter
6b18b3d67b ci/eval: allow configuration of the system to eval attrpaths on
Right now, there are some paths that don't even get exposed to certain
systems (notably Darwin, but some outliers exist for Linux such as the
Darwin-specific Hackage overlay) for one reason or another, usually
because of assertions like `stdenv.isLinux`. To catch these scenarios,
this change implements a way to specify the system to evaluate attrpaths
on, and makes it default to the system that we're evaluating outpaths
for.
2025-05-16 17:14:03 -04:00
Wolfgang Walther
af6faf8760
workflows/eval: remove attrs step
Previously, the attrs step consisted of:
- 7s queue time
- 1m 15s run time

Only 25s of this were spent preparing the attr paths. A bit more than a
minute was just spent for queuing, checking out the repo, downloading
nix, downloading dependencies, uploading the artifacts - and then
downloading them again in the next step. All of that can be avoided if
we collect the attrs as part of the outpaths job.

By running the attrs step as part of each outpaths step the attrpaths
will be collected 4x, but:
- We save a minute for each eval run to complete.
- We save a full job, giving us more free runners and *possibly* less
queue times for other jobs in the repo.
- We reduce complexity in the workflow file.
2025-05-11 22:22:48 +02:00
Wolfgang Walther
456a4697b1
workflows/eval: load supportedSystems from JSON file
This is a refactor to prepare the next commit. It doesn't do much on its
own, but is separated for ease of review.
2025-05-11 22:22:45 +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
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
Johannes Kirschbauer
fa69ce05d6 ci/eval: output per chunk stats 2025-05-01 20:52:24 +02:00
Wolfgang Walther
1b2949a572
ci/eval: fail on non-empty stderr (#381266) 2025-02-14 18:04:12 +01:00
Silvan Mosberger
7c62a764b4 ci/eval: Fail on non-empty stderr
Just like the channel eval requires.
2025-02-11 21:16:58 +01:00
Silvan Mosberger
0344bd7f88 ci/eval: Refactor to cleanly separate stderr
Previously stderr was mixed with the time stats

This allows checking stderr in the next commit
2025-02-11 21:12:31 +01:00
emilylange
657c689842
ci/eval: make eval for non-native platforms less incorrect
We commonly use platform-dependent conditional patterns like
`lib.meta.availableOn stdenv.hostPlatform` and `stdenv.hostPlatform.isLinux`
to enable different features in a given derivation or to evaluate
completely different derivations based on the platform.

For example, source builds of a given derivation may only be available
on linux but not on darwin. The use of such conditionals allow us to
fall back to patched binaries on darwin instead.

In `chromedriver` (pkgs/development/tools/selenium/chromedriver/default.nix), we use

~~~nix
if lib.meta.availableOn stdenv.hostPlatform chromium then
  callPackage ./source.nix { }
else
  callPackage ./binary.nix { }
~~~

To provide some context, `chromedriver` source builds are based on `chromium.mkDerivation`
and `chromium` is limited to `lib.platforms.linux`.
Based on the same `chromium.mkDerivation`, we also do source builds for
`electron` (pkgs/top-level/all-packages.nix):

~~~nix
electron_33 = if lib.meta.availableOn stdenv.hostPlatform electron-source.electron_33 then electron-source.electron_33 else electron_33-bin;
electron_34 = electron_34-bin;
electron = electron_34;
~~~

And finally, the top-level `jdk` (Java) attribute has a lot of
indirection, but eventually also boils down to `stdenv.hostPlatform.isLinux`
for source builds and binaries for x86_64-darwin and aarch64-darwin.

A surprising amount of electron and jdk consumers use variations of
`meta.platforms = electron.meta.platforms` in their own meta block.
Due to internal implementation details, the conditionals in those
top-level attributes like `chromedriver`, `electron` and `jdk` are
evaluated based on the value from `builtins.currentSystem` and not the
system passed to `import <nixpkgs> { }`.

This then causes `chromedriver`, `electron`, `jdk` and all dependents
that inherit those `meta.platforms` to appear only available on linux
despite also being available on darwin. Hydra is affected similarly, but
it's a lot more nuanced and in practice not actually *that* bad.

The addition of `--eval-system` ensures that `builtins.currentSystem`
matches the requested platform.

As a bonus, this also fixes the store paths of an impure test that
should probably be made pure:

~~~diff
@@ -885069,13 +886119,13 @@
     "out": "/nix/store/lb2500hc69czy4sfga9mbh2k679cr1rp-test-compressDrv"
   },
   "tests.config.allowPkgsInPermittedInsecurePackages.aarch64-darwin": {
-    "out": "/nix/store/0l5h8svrpzwymq35mnpvx82gyc7nf8s4-hello-2.12.1"
+    "out": "/nix/store/v1zjb688mp4y2132b6chii43d5kkxnpa-hello-2.12.1"
   },
   "tests.config.allowPkgsInPermittedInsecurePackages.aarch64-linux": {
-    "out": "/nix/store/0l5h8svrpzwymq35mnpvx82gyc7nf8s4-hello-2.12.1"
+    "out": "/nix/store/hb21z2zdk03dwygsw5lvpa8zc3fbr500-hello-2.12.1"
   },
   "tests.config.allowPkgsInPermittedInsecurePackages.x86_64-darwin": {
-    "out": "/nix/store/0l5h8svrpzwymq35mnpvx82gyc7nf8s4-hello-2.12.1"
+    "out": "/nix/store/gljdqsf0mxv1j8zb04phx9ws09pp7z3l-hello-2.12.1"
   },
   "tests.config.allowPkgsInPermittedInsecurePackages.x86_64-linux": {
     "out": "/nix/store/0l5h8svrpzwymq35mnpvx82gyc7nf8s4-hello-2.12.1"
~~~

Diff stats between two full evals based on 75c8548d81
with and without this fix on x86_64-linux:

~~~bash
# git diff --no-index --stat /nix/store/659l3xp78255wx7abbahggsnrlj3a1la-combined-result/outpaths.json /nix/store/4fhlq4g5qa65cxbibskq9pma40zigrx7-combined-result/outpaths.json
 /nix/store/{659l3xp78255wx7abbahggsnrlj3a1la-combined-result => 4fhlq4g5qa65cxbibskq9pma40zigrx7-combined-result}/outpaths.json | 1416 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 1405 insertions(+), 11 deletions(-)
~~~

The full diff is available as a gist at <https://gist.github.com/emilylange/d40c50031fc332bbcca133ad56d224f6>.

When we added `electron_34` only as binary instead of the usual source
on linux with binary fallback in cfed9a19cb
and made the unversioned `electron` top-level point to the newly added
`electron_34` instead of `electron_33`, the GitHub workflow suddenly
reported 20 new packages. Of those 20 reported packages, 17 where
false-positives caused by dropping the wrongly evaluated conditional.
2025-02-02 21:17:23 +01:00
Silvan Mosberger
0acb5f0924
ci/eval: allow precisely choosing which systems to evaluate for (evalSystem -> evalSystems) (#365244) 2024-12-15 02:36:14 +01:00
Gaetan Lepage
6eadbf9c97 ci/eval: allow precisely choosing which systems to evaluate for (evalSystem -> evalSystems) 2024-12-14 21:42:36 +01:00
Silvan Mosberger
bd5c93ca3d ci/eval: Avoid noise for failing attribute evals
It's currently annoying to see the actual failure in the attrs step,
because `time -v` displays like 20 lines, which get repeated, therefore
requiring you to scroll up most of the time:
3429721834 (step):5:794

This commit fixes that by only displaying the most important stats, the
same ones as the chunked system-specific evals.
2024-12-12 12:53:37 +01:00
Gaetan Lepage
f94b4bd945 ci/eval: re-implement compare in nix 2024-12-08 10:23:40 +01:00
Jörg Thalheim
8b7ed6e105 github/workflows/eval: limit number of packages in markdown 2024-12-01 10:59:17 +01:00
Noa Aarts
0e27bc3f9e
github/workflows/eval: add markdown of added, removed and changed 2024-11-30 13:47:49 +01:00
Jörg Thalheim
82434f382c
Use GHA eval to assign rebuild labels (#359704) 2024-11-29 23:21:39 +01:00
Jörg Thalheim
5978e7fa2f ci/eval: don't allow IFD 2024-11-29 22:04:22 +01:00
Silvan Mosberger
af1aa40e73 workflows/eval.yml: Run on dev branch pushes and apply rebuild labels 2024-11-28 22:24:23 +01:00
Jörg Thalheim
d65d18f1e4 ci: use nix 2.24 2024-11-21 09:13:09 +01:00
Silvan Mosberger
fbbe972898 Parallel GH actions workflow for Nixpkgs eval
Motivated by ofborg struggling [1] and its evaluations taking too long,
inspired by Jörg's initial PR [2]
and Adam's previous attempt to parallelise Nixpkgs evaluation [3],
this PR contains initial work to relief ofborg from its evaluation duty
by using GitHub Actions to evaluate Nixpkgs.

For now this doesn't take care of all of what ofborg does, such as
requesting appropriate reviewers or labeling mass rebuilds, but this can
be follow-up work.

[1]: https://discourse.nixos.org/t/infrastructure-announcement-the-future-of-ofborg-your-help-needed/56025?u=infinisil
[2]: https://github.com/NixOS/nixpkgs/pull/352808
[3]: https://github.com/NixOS/nixpkgs/pull/269403

Co-Authored-By: Jörg Thalheim <joerg@thalheim.io>
Co-Authored-By: Adam Joseph <adam@westernsemico.com>
2024-11-20 10:35:56 +01:00