Skip to content

Conversation

wolfgangwalther
Copy link
Contributor

@wolfgangwalther wolfgangwalther commented Jul 19, 2025

Work towards #397184.

TLDR of that issue: In the attrpaths generation step for Eval, we catch and ignore evaluation errors here:

tried = builtins.tryEval seq;
result =
if tried.success then
tried.value
else if enableWarnings && path != [ "AAAAAASomeThingsFailToEvaluate" ] then
lib.warn "tryEval failed at: ${lib.concatStringsSep "." path}" [ ]
else
[ ];

We do this because a lot of asserts/throws are used to give feedback about invalid combinations of things for the current system, throw errors for non-accepted licenses etc. But that also means we silently ignore asserts/throws where they point at a real problem, for example when mkDerivation triggers an assert.

We can show these eval failures by turning on enableWarnings for release-attrpaths-superset.nix. This will give us:

  • 48 attributes with warning for x86_64-linux
  • 110 attributes with warning for aarch64-linux
  • 6040 attributes with warning for x86_64-darwin
  • 6041 attributes with warning for aarch64-darwin
  • (5898 of these darwin warnings are about the linux kernels)

This PR fixes only the warnings for x86_64-linux, and then disables the tryEval logic only on that platform. Arguably this gives us a lot already, because most attributes are evaluated on x86_64-linux, too, and most real eval failures will surface this way. Eventually, it would be good to get rid of all the warnings, though... ✅

We need to do the following things first:

In here we also do:

  • Avoid generating attrpaths for "variants", here pkgsx86_64Darwin, which doesn't eval on Linux.

Things done


Add a 👍 reaction to pull requests you find important.

@wolfgangwalther wolfgangwalther requested review from emilazy, infinisil, winterqt and a team July 19, 2025 10:43
@wolfgangwalther wolfgangwalther force-pushed the ci-eval-asserts branch 2 times, most recently from da3ad86 to d388542 Compare July 19, 2025 10:59
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 6.topic: python Python is a high-level, general-purpose programming language. 6.topic: haskell General-purpose, statically typed, purely functional programming language 6.topic: erlang General-purpose, concurrent, functional high-level programming language 6.topic: lua Lua is a powerful, efficient, lightweight, embeddable scripting language. 6.topic: flutter Open-source UI software development kit for cross-platform applications 6.topic: continuous integration Affects continuous integration (CI) in Nixpkgs, including Ofborg and GitHub Actions backport release-25.05 Backport PR automatically labels Jul 19, 2025
@nix-owners nix-owners bot requested a review from traxys July 19, 2025 11:10
@philiptaron philiptaron added the 1.severity: significant Novel ideas, large API changes, notable refactorings, issues with RFC potential, etc. label Jul 19, 2025
@philiptaron
Copy link
Contributor

Amazing work. I merged the pieces that I think are completely uncontroversial.

@wolfgangwalther

This comment was marked as resolved.

Copy link
Contributor

@philiptaron philiptaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love AAAAAASomeThingsFailToEvaluate but it's fine.

@wolfgangwalther
Copy link
Contributor Author

Rebased to trigger CI once more and confirm that no other breakage has been introduced on master.

Given that there have been no objections other than keeping the AAAAAASomeThingsFailToEvaluate, I intend to merge this after CI passes.

The related issue still needs more work as pointed out above, but this will ensure that this first part doesn't regress.

@wolfgangwalther wolfgangwalther changed the title ci/eval: fail on asserts ci/eval: fail on asserts when generating attrpaths Jul 24, 2025
@wolfgangwalther
Copy link
Contributor Author

wolfgangwalther commented Jul 24, 2025

Not merging because of a regression in #427219 (comment).

Edit: Will wait for the channel to be unblocked in case there are any other eval errors hiding that require a revert of the linux commit.

@vcunat vcunat added 1.severity: channel blocker Blocks a channel and removed 1.severity: channel blocker Blocks a channel labels Jul 24, 2025
@nixpkgs-ci nixpkgs-ci bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 24, 2025
This is already not used in-tree, so should be a variant.
This removes pkgsx86_64Darwin from the top-level attributes when
generating attrpaths for evaluation on Linux. Needed for attrpaths
generation to succeed without silently catching eval errors.

Variants are still available during actual Eval for references from
other packages, just not during attrpath generation. To remove it from
Eval as well, issues around pkgsLLVM will have to be fixed first.
This doesn't fail on *all* asserts, yet, because nix-env still ignores
these in the main eval step. But it already gives some converage during
the attrpath generation.
@nixpkgs-ci nixpkgs-ci bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 24, 2025
@MattSturgeon
Copy link
Contributor

Not merging because of a regression in #427219 (comment).

Is this resolved now with #428023 merged?

Will wait for the channel to be unblocked in case there are any other eval errors hiding that require a revert of the linux commit.

Is there an unrelated channel blocker that's preventing us from knowing if this PR is good now?

@wolfgangwalther
Copy link
Contributor Author

Not merging because of a regression in #427219 (comment).

Is this resolved now with #428023 merged?

Correct.

Will wait for the channel to be unblocked in case there are any other eval errors hiding that require a revert of the linux commit.

Is there an unrelated channel blocker that's preventing us from knowing if this PR is good now?

I don't know of any other channel blocker, no. But it could be that hydra spits out another Eval error, at least in theory. That's because the one above was not noticed because of #426629 (comment) - aka the outpath-step silently catching those errors.

TLDR:

  • Before this PR, all asserts were silently caught.
  • After this PR, we catch some asserts, but not all.
  • Leading up to this PR we caused one known regression, where a new eval error appeared because of us removing an assert.

This PR in itself is not a problem and could be merged. It's just the case of: What if we get another eval error from one of the earlier changes, that we can't easily fix - and thus we want to revert, for example, the "remove the assert in the linux kernel" commit? Once we revert that, we must revert this, too.

Thus, I'd rather wait a bit here to make sure that all the previous changes made it through hydra once.

@MattSturgeon
Copy link
Contributor

Thus, I'd rather wait a bit here to make sure that all the previous changes made it through hydra once.

Ah, I see. That makes sense.

It is also possible that a new regression will show up on master after the changes that we're waiting to see go through hydra but before the point at which we eventually merge this PR. However that seems unlikely, so I agree it's better to wait.

@wolfgangwalther
Copy link
Contributor Author

Release checks, which previously failed, are good now: https://hydra.nixos.org/job/nixpkgs/trunk/unstable#tabs-constituents

The only two pending jobs (manual, metrics) I see there have passed before, so if they fail it's unrelated to us.

@wolfgangwalther wolfgangwalther merged commit 713e0c9 into NixOS:master Jul 24, 2025
24 of 27 checks passed
@wolfgangwalther wolfgangwalther deleted the ci-eval-asserts branch July 24, 2025 19:36
@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented Jul 24, 2025

Successfully created backport PR for release-25.05:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.severity: significant Novel ideas, large API changes, notable refactorings, issues with RFC potential, etc. 6.topic: continuous integration Affects continuous integration (CI) in Nixpkgs, including Ofborg and GitHub Actions 8.has: port to stable This PR already has a backport to the stable release. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons. backport release-25.05 Backport PR automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants