Improved backwards compatibility hack for git URLs using dir=...#14205
Improved backwards compatibility hack for git URLs using dir=...#14205edolstra merged 2 commits intoNixOS:masterfrom
Conversation
|
@GrahamDennis sounds good in principle. Could you add a test though? A unit test in libflake-tests would be good I think. |
This don't impact the The only way I can think to test this would be to write a functional test, but that would require using an ssh or http/s server for git and I believe all tests need to execute in a nix sandbox. Happy to write a test, I'm just not sure how to do that in this case without refactoring to expose RepoInfo in git.hh. |
|
I see. In that case this could probably go to fetch-git nixos test. There we have an actual forge (gitea) that should be enough for a test. |
|
Will merge this since it's simple enough, though a test would still be great. |
|
Successfully created backport PR for |
Motivation
In old versions of Nix, if you had a flake input like
it would result in a lock file entry like
New versions of Nix remove
?dir=subdirfrom theurlfield, since the subdirectory is intended forFlakeRef, not the fetcher (and specifically the remote server), that is, the flakeref is parsed intoHowever, new versions of nix parsing old flake.lock files would pass the dir= query parameter in the "url" attribute to git, which will then complain.
Some mitigations for this issue were added before:
dirquery parameter from all git URLs.Context
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.