-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Use correct parent outPath
for relative path inputs
#13170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
+117
−15
Conversation
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
MattSturgeon
commented
May 14, 2025
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2025-05-14-nix-team-meeting-minutes-226/64298/1 |
roberth
reviewed
May 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does look more correct!
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 NixOS#13164
02e5930
to
9f4e7ce
Compare
9f4e7ce
to
2922e30
Compare
roberth
approved these changes
May 19, 2025
Thank you @MattSturgeon! |
MattSturgeon
added a commit
to MattSturgeon/flake-compat
that referenced
this pull request
May 19, 2025
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. (cherry picked from commit NixOS/nix@46beb9a) (cherry picked from PR NixOS/nix#13170)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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
nestedFlake2
has/./nested-flake1//./nested-flake1/.
, repeatingnestedFlake1
's path.Context
Fixes Nested flake source paths broken #13164
Additional discussion in Support relative path inputs edolstra/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.