ci/eval: Allow disallowed attrs to depend on other disallowed attrs - #537051
Conversation
MattSturgeon
left a comment
There was a problem hiding this comment.
I like the idea that packages that depend on problematic packages should themselves be marked with a corresponding problem.
I wonder if it's better to have a dedicated "transitive problem" problem class, so that we don't need slightly contrived "a is broken because its dependency b is also broken" messages to be manually maintained?
| preEvalFile ? "${preEval { inherit evalSystem; }}/result.json", | ||
| }: | ||
| let | ||
| singleChunk = writeShellScript "single-chunk" '' |
There was a problem hiding this comment.
Beyond the scope of this PR: writeShellScript -> writeShellApplication would run shellcheck in the checkPhase, catching issues like unquoted variables. I'll consider opening a separate PR.
With a dependency chain like
a -> b -> c
it was not possible to e.g. add a `meta.problems.removal` to b, because that would cause b to be entirely unavailable as a dependency.
This PR slightly lifts that restriction by allowing both a and b to be marked with such a problem without causing a CI failure.
This is useful for:
- Having a problem on a package that needs to be removed but still has dependents (which then also need a problem)
- Having a problem on a package that is aliased under another attribute, which counts as a dependency
MattSturgeon
left a comment
There was a problem hiding this comment.
Just based off the diff, discussion, and description, this SGTM. Thanks!
I've tried not to give too much "wording suggestion"-style feedback, but I did comment on a couple minor spots that tripped me up a little. (Nothing blocking)
I still think we should consider how depending-on-a-problem should be represented in meta and how it should be displayed to end-users:
I wonder if it's better to have a dedicated "transitive problem" problem class, so that we don't need slightly contrived "
ais broken because its dependencybis also broken" messages to be manually maintained?
but that doesn't block the core impl or core concept.
|
|
||
| startEpoch=$(date +%s) | ||
|
|
||
| # The first eval evaluates only attributes that are not disallowed for internal Nixpkgs use, ensuring that they don't depend on disallowed attributes |
There was a problem hiding this comment.
It's fine as is, but this flows better in my brain:
| # The first eval evaluates only attributes that are not disallowed for internal Nixpkgs use, ensuring that they don't depend on disallowed attributes | |
| # The first eval evaluates only attributes that are allowed for internal Nixpkgs use, ensuring that they don't depend on disallowed attributes |
|
|
||
| chunkOutputDirs=$(mktemp -d) | ||
|
|
||
| # Preparation for the second eval |
There was a problem hiding this comment.
Something about my brain reads "prep for second eval" and assumes the "first eval" has already happened. I spent longer than I should admit scrolling up looking for an earlier usage of chunkedEval 😁
Thinking about it, it's kinda arbitrary which eval is first and which is second. Maybe we can give them more semantic names, like "allowed eval" and "disallowed eval" or "normal eval" and "problems eval" or something?
We already kinda do this in the debug echos:
echo "Evaluating the internally allowed attributes"
echo "Evaluating the internally disallowed attributes"I think it'd also help if we had a better name for "the file passed to chunkedEval; we currently call it preEvalFile because historically it has come from the preEval derivation, but disallowedAttributesPreEvalFile is subtly breaking that axiom. I don't have a better suggestion though 🤷🏻
|
Not sure whether you planned to address the minor quibbles above, but I don't think they're worth delaying this PR longer. Let's merge. |
|
Successfully created backport PR for |
This is a follow up to #533376 and will be necessary for #531180
Motivation
With a dependency chain like
it was not possible to e.g. add a
meta.problems.removalto b, because that would cause b to be entirely unavailable as a dependency.This PR slightly lifts that restriction by allowing both a and b to be marked with such a problem without causing a CI failure.
This is useful for:
Things done
meta.problemskinds are still allowed by CI for packages without dependents:problems.removal.message = "Removed"toCuboCore.coregaragenix-build ci -A eval.singleSystem --arg quickTest true, it should succeedqt6.qtbasetoqt6.qbasenix-build ci -A eval.singleSystem --arg quickTest true, it should fail with an error indicating the problem:all-packages.nix:nix-build ci -A eval.singleSystem --arg quickTest true, it should fail with an error indicating that coregarage is used internally:AAAtestPackage:nix-build ci -A eval.singleSystem --arg quickTest true, it should succeed (this failed before)