Commit Graph

130 Commits

Author SHA1 Message Date
Wolfgang Walther
628d2d6abc
[Backport release-24.11] Fail GHA eval on non-empty stderr (#382099) 2025-02-14 18:06:24 +01:00
Silvan Mosberger
dccd2b762c ci/eval: Fail on non-empty stderr
Just like the channel eval requires.

(cherry picked from commit 7c62a764b4)
2025-02-14 17:04:42 +00:00
Silvan Mosberger
1199390daa ci/eval: Refactor to cleanly separate stderr
Previously stderr was mixed with the time stats

This allows checking stderr in the next commit

(cherry picked from commit 0344bd7f88)
2025-02-14 17:04:41 +00:00
emilylange
83c1139626 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.

(cherry picked from commit 657c689842)
2025-02-14 16:49:43 +00:00
Silvan Mosberger
f3a4bcf34e 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

(cherry picked from commit 799273bf13)
2025-02-12 21:42:36 +00:00
Sefa Eyeoglu
3945055b40
ci: Update pinned Nixpkgs
From the nixpkgs-unstable channel: https://hydra.nixos.org/eval/1811194#tabs-inputs

(cherry picked from commit d51aeeb1fb)
2025-02-01 11:41:35 +01:00
Jörg Thalheim
2affe0326d
add python-updates to dev branches
(cherry picked from commit 668d72c474)
2025-02-01 11:41:35 +01:00
Silvan Mosberger
cfbab720d8 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.

(cherry picked from commit 80e011146b)
2025-02-01 10:26:27 +00:00
Silvan Mosberger
cfba7d138e maintainers.nix: Remove unused code
(cherry picked from commit 0fe2e3f0e3)
2025-02-01 10:26:27 +00:00
zowoq
90a94678de ci/eval: restore 501+ label
(cherry picked from commit b94f270650)
2025-01-24 15:06:01 +00:00
Silvan Mosberger
8e1bf76e40 ci/request-reviews: Don't fail when there's too many reviewers
It's better than getting failed CI and emails: https://github.com/NixOS/nixpkgs/pull/371528#issuecomment-2573926369

And fix a shellcheck lint

(cherry picked from commit 06ee611619)
2025-01-20 18:55:23 +00:00
Peder Bergebakken Sundt
29623dc5c2 ci/eval: support "10.rebuild-${kernel}: 1" labels
This should restore the old behavior of ofborg

(cherry picked from commit a226f13211)
2025-01-20 13:38:51 +00:00
Silvan Mosberger
01dcbcedda ci/request-reviews: Fix code owner requests for filenames with spaces
Discovered in https://github.com/NixOS/nixpkgs/pull/368656#issuecomment-2564266513

(cherry picked from commit 33257a9d7c)
2025-01-11 14:00:44 +00:00
Wolfgang Walther
1925ad63df
[Backport release-24.11] workflows/eval: Request reviews from changed package maintainers (#370709) 2025-01-11 14:55:14 +01:00
NAHO
1a7793d1ac
workflows: update Ubuntu runner to ubuntu-24.04
Link: https://github.com/actions/runner-images/issues/10636
(cherry picked from commit fcfbe6fff4)
2025-01-11 14:44:09 +01:00
NAHO
fae0c7b0eb
workflows: lock Ubuntu runner to ubuntu-22.04
Lock the Ubuntu runner to ubuntu-22.04 to avoid accidental updates [1]
and increase reproducibility.

[1]: https://github.com/actions/runner-images/issues/10636

(cherry picked from commit 2660dd1e71)
2025-01-11 14:44:00 +01:00
Leona Maroni
c05e24c057 OWNERS: add leona to jetbrains
(cherry picked from commit 6bb50c992f)
2025-01-09 16:02:04 +00:00
Wolfgang Walther
982e96f5d0
ci/request-reviews: limit to 10 maintainer review requests
This mirrors ofborg for now.

(cherry picked from commit 240c82b60e)
2025-01-05 13:47:06 +01:00
Wolfgang Walther
53d0959fbc
ci/request-reviews: request reviewers 1-by-1
This is to be able to ignore the odd failure for some users, who are
listed as collaborators, but still fail to be requested properly.

(cherry picked from commit 034613f860)
2025-01-04 19:34:22 +01:00
Wolfgang Walther
bc3c6a9edd
ci/request-reviews: share code to request reviewers from gh api
This makes it easier to add ofborg's request-1-by-1 logic, where failed
requests are OK for edge cases.

(cherry picked from commit 62779fbfa4)
2025-01-04 19:34:22 +01:00
Wolfgang Walther
d82f7fa36d
ci/request-reviews: use generic wording instead of "code owner"
This is now re-used for both code owners and maintainers.

(cherry picked from commit ffb0ace1e7)
2025-01-04 19:34:22 +01:00
Wolfgang Walther
ff1e788238
ci/request-reviews: rename code-owner related files
Now that we have maintainer reviews as well, be a bit more explicit
about naming.

(cherry picked from commit cf0616fec6)
2025-01-04 19:34:22 +01:00
Wolfgang Walther
58e9df7363
ci/request-reviews: lowercase handles consistently
This script assumed to get lowercased input before, but with the
addition of pinging maintainers that's not necessarily true anymore.

Since the checks for prAuthor and already-reviewed-by already lowercase,
make sure to lowercase the handles in the users array, too.

(cherry picked from commit 213dbf1774)
2025-01-04 14:55:38 +01:00
Silvan Mosberger
1b7595a922
ci/request-reviews: Don't request reviews from non-repo-collaborators
Fixes this problem for maintainer-based reviews when the maintainer
didn't yet accept or missed the automated invite:

    gh: Reviews may only be requested from collaborators. One or more of
the users or teams you specified is not a collaborator of the
NixOS/nixpkgs repository. (HTTP 422)

(cherry picked from commit 077007a658)
2025-01-04 14:55:37 +01:00
Silvan Mosberger
d29ca81b4f
ci/request-reviews: split off a more reusable reviewer processing script
We can reuse the new process-reviewers.json part for requesting
reviews from maintainers.

(cherry picked from commit 0371b7fb4b)
2025-01-03 21:33:29 +01:00
Silvan Mosberger
0916ec48fb 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.

(cherry picked from commit b844cba4e6)
2025-01-03 20:30:51 +00:00
Silvan Mosberger
db45da12a8 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.

(cherry picked from commit b9d800d468)
2025-01-03 20:30:51 +00:00
Janne Heß
db5a0ad774
ci: Label 10.rebuild-*-stdenv (#369102)
Currently ofborg does this, but there is actually no real reason this
shouldn't be done by CI

(cherry picked from commit 6d96c9a21e)
2025-01-01 04:35:47 -05:00
Jörg Thalheim
bb3bf66877
ci/eval/compare: truncate step summary to 1024k
(cherry picked from commit 44dc31e676)
2025-01-01 04:35:46 -05:00
Silvan Mosberger
7f0d2b1b45
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.

(cherry picked from commit bd5c93ca3d)
2025-01-01 04:35:45 -05:00
Gaetan Lepage
c1553b513e
ci/eval: allow precisely choosing which systems to evaluate for (evalSystem -> evalSystems)
(cherry picked from commit 6eadbf9c97)
2025-01-01 04:35:45 -05:00
Gaetan Lepage
e88b48d259
ci/eval: add rebuildsByPlatform to the comparison result
(cherry picked from commit 518ae8fd58)
2025-01-01 04:35:44 -05:00
Gaetan Lepage
ff9bb621de
ci/eval: fix compare label assignment
(cherry picked from commit 214cb79aa6)
2025-01-01 04:35:44 -05:00
Gaetan Lepage
3f4f84fdc7
ci/eval: re-implement compare in nix
(cherry picked from commit f94b4bd945)
2025-01-01 04:35:44 -05:00
Silvan Mosberger
3a324754bc ci: Update pinned Nixpkgs
From the nixpkgs-unstable channel: https://hydra.nixos.org/eval/1810299#tabs-inputs

(cherry picked from commit d979e89d88)
2024-12-09 18:08:23 +00:00
emilylange
864365ad6c chromium: remove ofborg maintainer ping workaround, use CODEOWNERS
The workaround to have ofborg ping chromium and ungoogled-chromium
maintainers when a change was only made to the upstream-info relied on
string context.

That string context was provided by the upstream-info being a nix file,
not a json file, and then holding on to that string context using
awkward attribute merges.

It was intended as a quick fix until the handling of this would improve
in ofborg itself and worked great.

That was until very recently when we switched from the chromium release
tarball to git source fetching in 8dd2f1add9.

Part of that change included going back from upstream-info.nix to
upstream-info.json and with that losing the string context and the base
on which this workaround used to work.

But this is fine. A lot has happened in the meantime.

CODEOWNERS was reimplemented and no longer requires every user listed in
it to have write permissions to the repository (commit bit).

Meaning we can accept that ofborg pings no longer work and instead rely
on CODEOWNERS exclusively.

It should, however, be noted that CODEOWNERS provide less granularity
than ofborg, meaning we can no longer differentiate between
ungoogled-chromium and chromium or even chromedriver.

Previously, implementing the workaround that is now essentially
reverted: 68c59791fb

(cherry picked from commit 674835a9d9)
2024-12-07 04:10:43 +00:00
John Titor
dc17bb7c12
ci: init get-merge-commit workflow
Signed-off-by: John Titor <50095635+JohnRTitor@users.noreply.github.com>
(cherry picked from commit b5a6aeb5df)
2024-12-06 23:01:24 +05:30
Aleksana
b8bdfa8d19
[Backport release-24.11] ci: Update pinned Nixpkgs (#361220) 2024-12-04 23:04:41 +08:00
Jörg Thalheim
0952756344
[release-24.11] GitHub Action eval backports (#361168) 2024-12-03 07:29:28 +01:00
Silvan Mosberger
d9e2440123 ci: Update pinned Nixpkgs
From the nixpkgs-unstable channel: https://hydra.nixos.org/eval/1810238#tabs-inputs

(cherry picked from commit c9bbb9962c)
2024-12-02 21:10:02 +00:00
Silvan Mosberger
d7ba9d09cb ci/eval: Also count added packages as rebuilds
This is also what ofborg does

(cherry picked from commit 449314825e)
2024-12-02 20:59:06 +00:00
Jörg Thalheim
7ea19651d6 github/workflows/eval: add nixos package search links and wrap sections in a summary list
(cherry picked from commit 006691de3c)
2024-12-02 19:06:24 +01:00
Jörg Thalheim
bd1bcde2ec github/workflows/eval: limit number of packages in markdown
(cherry picked from commit 8b7ed6e105)
2024-12-02 19:06:19 +01:00
Noa Aarts
432bc2ceac github/workflows/eval: add markdown of added, removed and changed
(cherry picked from commit 0e27bc3f9e)
2024-12-02 19:06:14 +01:00
Jörg Thalheim
e4e9f713cb ci/eval: don't allow IFD
(cherry picked from commit 5978e7fa2f)
2024-12-02 19:05:48 +01:00
Jörg Thalheim
8ea3a59601 ci: use nix 2.24
(cherry picked from commit d65d18f1e4)
2024-12-02 19:05:42 +01:00
Wolfgang Walther
8265d51a3c ci: fix GHA's rebuild-xxx: 5001+ labels
(cherry picked from commit a06822cabf)
2024-12-01 19:44:00 +00:00
Silvan Mosberger
8b4d5bc0bb workflows/eval.yml: Run on dev branch pushes and apply rebuild labels
(cherry picked from commit af1aa40e73)
2024-11-29 23:33:43 +00:00
Silvan Mosberger
6333a2f92b
OWNERS: Add myself to .github/workflows
(cherry picked from commit bb19beaf77)
2024-11-23 19:33:30 +05:30
Silvan Mosberger
cb77c97eb2 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>
(cherry picked from commit fbbe972898)
2024-11-20 20:24:27 +00:00