0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 13:40:28 +03:00
Commit graph

32 commits

Author SHA1 Message Date
Wolfgang Walther
1b2949a572
ci/eval: fail on non-empty stderr (#381266) 2025-02-14 18:04:12 +01:00
Wolfgang Walther
dfa7783c7d
ci/eval: make eval for non-native platforms less incorrect (#378922) 2025-02-14 17:49:10 +01:00
Silvan Mosberger
799273bf13 ci/eval/compare: Ignore null packages
CI can fail to evaluate if a package is null:
https://github.com/NixOS/nixpkgs/actions/runs/13209876145/job/36881335314?pr=380228
2025-02-11 21:24:28 +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
80e011146b ci/eval/compare: Improve performance and avoid large stacks
Various improvements such as:
1. Avoiding deduplications when there can't be any duplicates
2. Avoiding O(n^2) deduplications
3. Using builtins.any to avoid list allocations
4. Using builtins.concatMap instead of lib.flatten when it's known that there's only one level of nesting
5. Using builtins.groupBy instead of folding with an accumulator

In particular 5. should fix CI exceeding the stack size on staging: https://github.com/NixOS/nixpkgs/actions/runs/12989244871/job/36240781244?pr=377253

While 2. in particular should make CI a lot faster.
2025-01-28 17:05:11 +01:00
Silvan Mosberger
0fe2e3f0e3 maintainers.nix: Remove unused code 2025-01-27 19:07:24 +01:00
zowoq
b94f270650 ci/eval: restore 501+ label 2025-01-22 09:14:10 +10:00
Peder Bergebakken Sundt
a226f13211 ci/eval: support "10.rebuild-${kernel}: 1" labels
This should restore the old behavior of ofborg
2025-01-20 11:45:52 +01:00
Masum Reza
a69bc54e33
workflows/eval: Request reviews from changed package maintainers (#366046) 2025-01-02 14:18:57 +05:30
Janne Heß
6d96c9a21e
ci: Label 10.rebuild-*-stdenv (#369102)
Currently ofborg does this, but there is actually no real reason this
shouldn't be done by CI
2024-12-30 20:01:31 +01:00
Silvan Mosberger
b844cba4e6 workflows/eval: Use maintainer GitHub IDs for review requests of changed packages
The handles can change over time and there's nothing guaranteeing the
ones in the maintainer list are up-to-date. In comparison GitHub IDs
never change.
2024-12-18 22:13:48 +01:00
Silvan Mosberger
b9d800d468 workflows/eval: Request reviews from changed package maintainers
Currently we need to rely on ofborg requesting reviews from package
maintainers, which takes a while with ofborg's eval queue. Since
recently we're doing faster evaluations with GitHub Actions, which contain all
necessary information to determine reviewers of changed packages the
same way ofborg does. This PR takes advantage of that.
2024-12-18 22:13:37 +01:00
Jörg Thalheim
44dc31e676 ci/eval/compare: truncate step summary to 1024k 2024-12-15 14:08:02 +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:
https://github.com/NixOS/nixpkgs/actions/runs/12290298121/job/34297218345#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
518ae8fd58 ci/eval: add rebuildsByPlatform to the comparison result 2024-12-11 16:37:25 +01:00
Gaetan Lepage
214cb79aa6 ci/eval: fix compare label assignment 2024-12-10 10:00:11 +01:00
Gaetan Lepage
f94b4bd945 ci/eval: re-implement compare in nix 2024-12-08 10:23:40 +01:00
Silvan Mosberger
449314825e ci/eval: Also count added packages as rebuilds
This is also what ofborg does
2024-12-02 21:28:47 +01:00
Silvan Mosberger
512859412f
ci: fix GHA's rebuild-xxx: 5001+ labels (#360754) 2024-12-01 20:43:35 +01:00
Wolfgang Walther
a06822cabf
ci: fix GHA's rebuild-xxx: 5001+ labels 2024-12-01 13:27:42 +01:00
Jörg Thalheim
006691de3c github/workflows/eval: add nixos package search links and wrap sections in a summary list 2024-12-01 11:58:30 +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