Skip to content

fix: allows inputOverrides pattern with complex cross-projects overrides - #32

Merged
vic merged 3 commits into
denful:mainfrom
jbgi:lazy-overrides
Oct 18, 2026
Merged

vic merged 3 commits into
denful:mainfrom
jbgi:lazy-overrides

Conversation

@jbgi

@jbgi jbgi commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

that requires lazy handling of inputOverrides (now nested under value) to not
trigger stackoverflows when pruning recursive follows in mkDefaultWithInputsInput

jbgi added 2 commits October 17, 2026 11:48
Requires lazy handling of inputOverrides to not trigger stack-overflow.
this create garbage in inputs or can fail.

@sini sini left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, this fixes the cycle: with the __functor fix applied on both sides, main still overflows the stack on the new test, and this branch returns /our-nixpkgs. just ci passes (54/54), and so does this branch merged with #33 and #34.

One problem with the { value = …; } wrapper. inputsOverrides crosses version boundaries, because a nested project usually pins its own copy of with-inputs. An older copy receiving the wrapper treats it as a direct value. I ran the existing nested-follows case (real-flakes.test-sub-npins-with-inputs-nested-follows) with the outer and inner copies at different versions:

outer / inner result
main / main /nested-nixpkgs
this PR / this PR /nested-nixpkgs
main / this PR /nested-nixpkgs
this PR / main error: attribute 'outPath' missing

The new cross-project test with a main inner copy fails with expected a set but found null. Also, any override that is exactly { value = x; } would now be unwrapped by mistake.

See the inline suggestion: wrapping each override as a function instead keeps it lazy, and every version already handles it, because resolveInput calls an entry that is a function. With that change and isValue removed, I measured 54/54 tests, the cross-project test passing with either inner version, and the nested-follows case passing with a main inner copy.

Comment thread with-inputs.nix Resolved
Comment thread with-inputs.nix Outdated
resolvedSources.${name} or { }
else if v ? outPath && !(v ? _type) then
mkInput name v
else if isValue v then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

With the function wrapper, this branch and isValue (line 48) can both go.

@sini sini mentioned this pull request Oct 18, 2026
that requires lazy handling of inputOverrides (now wrapped in function) to not
trigger stackoverflows when pruning recursive follows in mkDefaultWithInputsInput.
@jbgi
jbgi requested a review from sini October 18, 2026 09:22
@vic
vic merged commit 9cc2735 into denful:main Oct 18, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants