lib/modules: Report error for unsupported t // { check = ...; }#454964
Merged
roberth merged 1 commit intoNixOS:masterfrom Oct 28, 2025
Merged
lib/modules: Report error for unsupported t // { check = ...; }#454964roberth merged 1 commit intoNixOS:masterfrom
t // { check = ...; }#454964roberth merged 1 commit intoNixOS:masterfrom
Conversation
t // { check = ...; }`t // { check = ...; }
11 tasks
`check` can have a new place since the introduction of
merge.v2. This makes the // { check = ... } idiom unreliable.
In this PR we add checks to detect and report this.
merge.v2 introduced in:
NixOS#391544
Real world case:
https://hercules-ci.com/github/hercules-ci/hercules-ci-effects/jobs/875
MattSturgeon
approved these changes
Oct 23, 2025
khaneliman
added a commit
to khaneliman/home-manager
that referenced
this pull request
Oct 30, 2025
The dagOf type was using an ad-hoc `type // { check = ...; }` pattern
via `inherit (attrEquivalent) check`, which is incompatible with throw
introduced in NixOS/nixpkgs#454964.
This commit properly implements the v2 merge protocol for dagOf by:
- Making `check` a functor with `isV2MergeCoherent = true` that
delegates to the underlying attrsOf type's check function
- Making `merge` a functor with a `v2` attribute that properly
delegates to the underlying type's v2 merge implementation
This ensures compatibility with the v2 merge mechanism while
maintaining all existing dagOf functionality.
Fixes evaluation errors like:
error: The option '...' has a type `DAG of X' that uses
an ad-hoc `type // { check = ...; }' override, which is
incompatible with the v2 merge mechanism.
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
9 tasks
Closed
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
checkcan have a new place since the introduction ofmerge.v2. This makes thet // { check = ...; }idiom unreliable.In this PR we add checks to detect and report this in cases where it breaks.
merge.v2introduced in:Real world case: hercules-ci-effects
I was lucky to unit test my type in a way that triggers it. Many people don't unit test types (I hope not most 🤨), and they'll have a harder time to figure this out.
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.