Use correct parent outPath for relative path inputs#13170
Merged
roberth merged 4 commits intoNixOS:masterfrom May 19, 2025
Merged
Use correct parent outPath for relative path inputs#13170roberth merged 4 commits intoNixOS:masterfrom
outPath for relative path inputs#13170roberth merged 4 commits intoNixOS:masterfrom
Conversation
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 |
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
Member
|
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)
This was referenced Jun 27, 2025
mergify bot
added a commit
that referenced
this pull request
Jun 27, 2025
…3170 Use correct parent `outPath` for relative path inputs (backport #13170)
mergify bot
added a commit
that referenced
this pull request
Jun 27, 2025
…3170 Use correct parent `outPath` for relative path inputs (backport #13170)
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
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.