Repository navigation
fix: allows inputOverrides pattern with complex cross-projects overrides - #32
Conversation
Requires lazy handling of inputOverrides to not trigger stack-overflow.
this create garbage in inputs or can fail.
sini
left a comment
There was a problem hiding this comment.
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.
| resolvedSources.${name} or { } | ||
| else if v ? outPath && !(v ? _type) then | ||
| mkInput name v | ||
| else if isValue v then |
There was a problem hiding this comment.
With the function wrapper, this branch and isValue (line 48) can both go.
that requires lazy handling of inputOverrides (now wrapped in function) to not trigger stackoverflows when pruning recursive follows in mkDefaultWithInputsInput.
that requires lazy handling of
inputOverrides(now nested undervalue) to nottrigger stackoverflows when pruning recursive follows in
mkDefaultWithInputsInput