Use correct parent outPath for relative path inputs (backport #13170)#13404
Merged
mergify[bot] merged 4 commits into2.29-maintenancefrom Jun 27, 2025
Merged
Conversation
Ensure relative path inputs are relative to the parent node's _actual_ `outPath`, instead of the subtly different `sourceInfo.outPath`. Additionally, non-flake inputs now also have a `sourceInfo` attribute. This fixes the relationship between `self.outPath` and `self.sourceInfo.outPath` in some edge cases. Fixes #13164 (cherry picked from commit 46beb9a)
(cherry picked from commit eaee0b4)
…g `sourceInfo` (cherry picked from commit 72232bc)
(cherry picked from commit 2922e30)
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.
Motivation
Ensure relative path inputs are relative to the parent node's actual
outPath, instead of the subtly differentsourceInfo.outPath.Without this, nested relative-path inputs within the same repo end up repeating the parent's relative path segment:
Notice how
nestedFlake2has/./nested-flake1//./nested-flake1/., repeatingnestedFlake1's path.Context
Fixes Nested flake source paths broken #13164
Additional discussion in Support relative path inputs flake-compat#71
cc @edolstra @roberth @packruler @meskill
Testing
I assume a test case would be beneficial, however I'm not familiar with your test suite. Feel free to take over this PR or cherry-pick the changes into a new PR if that is easier. Or if you have ideas for tests, I can try to implement them with some hand-holding 😀
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.
This is an automatic backport of pull request #13170 done by [Mergify](https://mergify.com).