libutil/url: fix git+file:./ parse error#9897
Conversation
Previously, the "file:./" prefix was not correctly recognized in fixGitURL; instead, it was mistaken as a file path, which resulted in a parsed url of the form "file://file:./". This commit fixes the issue by properly detecting the "file:" prefix. Note, however, that unlike "file://", the "file:./" URI is _not_ standardized, but has been widely used to referred to relative file paths. In particular, the "git+file:./" did work for nix<=2.18, and was broken since nix 2.19.0. Finally, this commit fixes the issue completely for the 2.19 series, but is still inadequate for the 2.20 series due to new behaviors from the switch to libgit2. However, it does improve the correctness of parsing even though it is not yet a complete solution.
|
Oh thank you for merging this! Could this be backported to at least |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 2.18-maintenance
git worktree add -d .worktree/backport-9897-to-2.18-maintenance origin/2.18-maintenance
cd .worktree/backport-9897-to-2.18-maintenance
git switch --create backport-9897-to-2.18-maintenance
git cherry-pick -x 8594f3cd5ad34838b2b7997af4909160e5887d73 |
1 similar comment
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 2.18-maintenance
git worktree add -d .worktree/backport-9897-to-2.18-maintenance origin/2.18-maintenance
cd .worktree/backport-9897-to-2.18-maintenance
git switch --create backport-9897-to-2.18-maintenance
git cherry-pick -x 8594f3cd5ad34838b2b7997af4909160e5887d73 |
|
Git push to origin failed for 2.19-maintenance with exitcode 1 |
|
Successfully created backport PR for |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 2.18-maintenance
git worktree add -d .worktree/backport-9897-to-2.18-maintenance origin/2.18-maintenance
cd .worktree/backport-9897-to-2.18-maintenance
git switch --create backport-9897-to-2.18-maintenance
git cherry-pick -x 8594f3cd5ad34838b2b7997af4909160e5887d73 |
2 similar comments
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 2.18-maintenance
git worktree add -d .worktree/backport-9897-to-2.18-maintenance origin/2.18-maintenance
cd .worktree/backport-9897-to-2.18-maintenance
git switch --create backport-9897-to-2.18-maintenance
git cherry-pick -x 8594f3cd5ad34838b2b7997af4909160e5887d73 |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 2.18-maintenance
git worktree add -d .worktree/backport-9897-to-2.18-maintenance origin/2.18-maintenance
cd .worktree/backport-9897-to-2.18-maintenance
git switch --create backport-9897-to-2.18-maintenance
git cherry-pick -x 8594f3cd5ad34838b2b7997af4909160e5887d73 |
|
Git push to origin failed for 2.20-maintenance with exitcode 1 |
|
Git push to origin failed for 2.19-maintenance with exitcode 1 |
|
Successfully created backport PR for |
|
Git push to origin failed for 2.19-maintenance with exitcode 1 |
1 similar comment
|
Git push to origin failed for 2.19-maintenance with exitcode 1 |
|
Git push to origin failed for 2.21-maintenance with exitcode 1 |
|
Git push to origin failed for 2.20-maintenance with exitcode 1 |
1 similar comment
|
Git push to origin failed for 2.20-maintenance with exitcode 1 |
|
Successfully created backport PR for |
|
Git push to origin failed for 2.20-maintenance with exitcode 1 |
|
Git push to origin failed for 2.22-maintenance with exitcode 1 |
|
Git push to origin failed for 2.21-maintenance with exitcode 1 |
|
Git push to origin failed for 2.21-maintenance with exitcode 1 |
|
Successfully created backport PR for |
|
Git push to origin failed for 2.21-maintenance with exitcode 1 |
|
Git push to origin failed for 2.22-maintenance with exitcode 1 |
2 similar comments
|
Git push to origin failed for 2.22-maintenance with exitcode 1 |
|
Git push to origin failed for 2.22-maintenance with exitcode 1 |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-06-03-nix-team-meeting-minutes-149/46582/1 |
This was caused by an upstream issue that has been fixed in NixOS/nix#9897. Fixes TraceMachina#986
This was caused by an upstream issue that has been fixed in NixOS/nix#9897. Fixes TraceMachina#986
This was caused by an upstream issue that has been fixed in NixOS/nix#9897. Fixes TraceMachina#986
Motivation
Partially fixes regression #9708: parse error of
git+file:./I am hoping that this could be backported to 2.19-maintenance.
Context
Previously, the "file:./" prefix was not recognized in
fixGitURL; instead, it was parsed as a file path, which resulted in a url of the form "file://file:./" (#9708).This commit fixes the issue by properly detecting the "file:" prefix. Note, however, that unlike "file://", the "file:./" URI is not standardized, but has been widely used to referred to relative file paths. In particular, the "git+file:./" did work for nix<=2.18, and was broken since nix 2.19.0. These are the usages found in github: https://github.com/search?q=git%2Bfile%3A.&type=code
Finally, this commit fixes the issue completely for the 2.19 series, but is still inadequate for the 2.20 series due to new behaviors from the switch to libgit2 (consequently, we do not add a test because it is not yet working on master). However, it does improve the correctness of parsing, even though it is not yet a complete solution.
Priorities and Process
Pinging @roberth as they might be interested 😉 if not, sorry for the noise...
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.