Skip to content

windows: add a separate local_shorthand_path test#15307

Merged
Ericson2314 merged 1 commit into
NixOS:masterfrom
nix-windows:windows-local-shorthand
Feb 23, 2026
Merged

windows: add a separate local_shorthand_path test#15307
Ericson2314 merged 1 commit into
NixOS:masterfrom
nix-windows:windows-local-shorthand

Conversation

@puffnfresh
Copy link
Copy Markdown
Member

@puffnfresh puffnfresh requested a review from edolstra as a code owner February 20, 2026 23:25
@puffnfresh puffnfresh force-pushed the windows-local-shorthand branch 2 times, most recently from 60a52cf to d796754 Compare February 20, 2026 23:38
Comment thread src/libstore-tests/store-reference.cc Outdated
.variant =
StoreReference::Specified{
.scheme = "local",
.authority = "C:\\foo\\bar\\baz",
Copy link
Copy Markdown
Contributor

@xokdvium xokdvium Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this is actually right. Since store references are in fact URLs this would be local://C:/foo/bar/baz" - which has the hostname C with an empty port... (or worse yet, no forward slashes mean that it won't parse at all as a URL)

Let's not do this. If anything, we should take the same approach as with file:// URL spec - i.e. local:///C:/foo/bar/baz (note the first slash in path and all forward slashes).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a pretty good argument. UrlCreateFromPath gives things like file:///c:/path/to/the%20file.txt, which makes sense and should build upon your PR.

@xokdvium
Copy link
Copy Markdown
Contributor

Also we should probably build proper fixes upon #15280

Copy link
Copy Markdown
Member

@Ericson2314 Ericson2314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xokdvium I think this is good now? It is not atop your PR, but it should be very compatible with it

Specified{
.scheme = "local",
.authority = absPath(baseURI),
.authority = encodeUrlPath(pathToUrlPath(absPath(std::filesystem::path{baseURI}))),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the pct-encoding fix PR this isn't exactly correct, but overall this seems more correct tbh.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think it will nicely work with your PR.

Comment thread src/libutil/url.cc Outdated
Comment thread src/libutil/url.cc Outdated
This missing URL functionality allow us to properly fix the path
shorthand for local store URLs test case.
@Ericson2314 Ericson2314 force-pushed the windows-local-shorthand branch from 4d5df7d to 3f419cf Compare February 23, 2026 18:32
@Ericson2314 Ericson2314 added this pull request to the merge queue Feb 23, 2026
Merged via the queue into NixOS:master with commit 5ce241c Feb 23, 2026
14 checks passed
@Ericson2314 Ericson2314 deleted the windows-local-shorthand branch February 23, 2026 20:30
brittonr pushed a commit to brittonr/nix that referenced this pull request Apr 1, 2026
windows: add a separate local_shorthand_path test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants