Skip to content

libutil/url: fix git+file:./ parse error#9897

Merged
edolstra merged 1 commit intoNixOS:masterfrom
bryango:fix-submodule-subdir
Jun 3, 2024
Merged

libutil/url: fix git+file:./ parse error#9897
edolstra merged 1 commit intoNixOS:masterfrom
bryango:fix-submodule-subdir

Conversation

@bryango
Copy link
Copy Markdown
Member

@bryango bryango commented Feb 1, 2024

Motivation

Partially fixes regression #9708: parse error of git+file:./

  • This is a fully working fix before libgit2 (i.e. it fixes the 2.19 series),
  • ... but is still inadequate after libgit2, although it does improve the correctness.

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.

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.
@bryango
Copy link
Copy Markdown
Member Author

bryango commented Jun 4, 2024

Oh thank you for merging this! Could this be backported to at least 2.19-maintenance? Thank you!

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 4, 2024

Backport failed for 2.18-maintenance, because it was unable to cherry-pick the commit(s).

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
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 4, 2024

Backport failed for 2.18-maintenance, because it was unable to cherry-pick the commit(s).

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

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 4, 2024

Git push to origin failed for 2.19-maintenance with exitcode 1

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 4, 2024

Successfully created backport PR for 2.19-maintenance:

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 4, 2024

Backport failed for 2.18-maintenance, because it was unable to cherry-pick the commit(s).

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
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 4, 2024

Backport failed for 2.18-maintenance, because it was unable to cherry-pick the commit(s).

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

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 4, 2024

Backport failed for 2.18-maintenance, because it was unable to cherry-pick the commit(s).

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

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 4, 2024

Git push to origin failed for 2.20-maintenance with exitcode 1

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 4, 2024

Git push to origin failed for 2.19-maintenance with exitcode 1

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 4, 2024

Successfully created backport PR for 2.20-maintenance:

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 4, 2024

Git push to origin failed for 2.19-maintenance with exitcode 1

1 similar comment
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 4, 2024

Git push to origin failed for 2.19-maintenance with exitcode 1

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 4, 2024

Git push to origin failed for 2.21-maintenance with exitcode 1

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 4, 2024

Git push to origin failed for 2.20-maintenance with exitcode 1

1 similar comment
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 4, 2024

Git push to origin failed for 2.20-maintenance with exitcode 1

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 4, 2024

Successfully created backport PR for 2.21-maintenance:

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 4, 2024

Git push to origin failed for 2.20-maintenance with exitcode 1

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 4, 2024

Git push to origin failed for 2.22-maintenance with exitcode 1

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 4, 2024

Git push to origin failed for 2.21-maintenance with exitcode 1

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 4, 2024

Git push to origin failed for 2.21-maintenance with exitcode 1

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 4, 2024

Successfully created backport PR for 2.22-maintenance:

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 4, 2024

Git push to origin failed for 2.21-maintenance with exitcode 1

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 4, 2024

Git push to origin failed for 2.22-maintenance with exitcode 1

2 similar comments
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 4, 2024

Git push to origin failed for 2.22-maintenance with exitcode 1

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 4, 2024

Git push to origin failed for 2.22-maintenance with exitcode 1

@nixos-discourse
Copy link
Copy Markdown

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

aaronmondal added a commit to aaronmondal/nativelink that referenced this pull request Jun 14, 2024
This was caused by an upstream issue that has been fixed in
NixOS/nix#9897.

Fixes TraceMachina#986
aaronmondal added a commit to aaronmondal/nativelink that referenced this pull request Jun 14, 2024
This was caused by an upstream issue that has been fixed in
NixOS/nix#9897.

Fixes TraceMachina#986
aaronmondal added a commit to aaronmondal/nativelink that referenced this pull request Jun 15, 2024
This was caused by an upstream issue that has been fixed in
NixOS/nix#9897.

Fixes TraceMachina#986
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants