-
Notifications
You must be signed in to change notification settings - Fork 701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix file+noindex URI usage on Windows #10728
base: master
Are you sure you want to change the base?
Conversation
8cacda3
to
fe6eed7
Compare
fe6eed7
to
0b33fff
Compare
0b33fff
to
5558a47
Compare
Notice this was broken on Windows #10095 (comment), see how the paths in the output do not have a |
5558a47
to
82788ec
Compare
82788ec
to
37ab8b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I wonder if we can pull in some of Andrea’s PRs after this fix…
37ab8b4
to
7349d88
Compare
390ce77
to
85d3807
Compare
a03d515
to
19c9a86
Compare
I'd suggest not to inline it. I'd definitely prefer reading unrelated code that calls a function like that rather than seeing the list comprehension. |
908b17e
to
a48e96a
Compare
6a9a53a
to
c7f0145
Compare
Thanks for your thorough review @philderbeast ! |
@jasagredo, I checked the haddocks for I think this could be fixed with this patch: $ git diff
diff --git a/Cabal-syntax/src/Distribution/Utils/Path.hs b/Cabal-syntax/src/Distribution/Utils/Path.hs
index fef2fe996..b082c17b5 100644
--- a/Cabal-syntax/src/Distribution/Utils/Path.hs
+++ b/Cabal-syntax/src/Distribution/Utils/Path.hs
@@ -545,7 +545,7 @@ data PkgConf
-- | Sometimes we need to represent a Windows path (that might have been
-- normalized) as a POSIX path, for example in URIs, as that is what
--- @network-uri@ understands. Furthermore they need to use the @\\.\@ DOS
+-- @network-uri@ understands. Furthermore they need to use the @\\\\.\\@ DOS
-- device syntax or otherwise the filepath will be unusable.
--
-- >>> import Network.URI |
Ah yes sounds familiar, see the first argument of https://hackage.haskell.org/package/Win32-2.14.1.0/docs/System-Win32-NamedPipes.html#v:createNamedPipe and the corresponding source code haddocks 😄 |
c7f0145
to
629366b
Compare
I got an idea, but I won't be able to test it until tomorrow or maybe next week hence I'm removing the merge label. My suspicion is that the path The basis for the suspicion is the NT namespace mentioned here And if that is the case maybe I was wrong all along when thinking that network-uri fails to process Windows paths properly and |
OK I can confirm it does not work and my assumptions were right:
In PowerShell: ➜ Get-Content \C:\foo.txt
Get-Content: Cannot find drive. A drive with the name '\C' does not exist. So the GHC documentation that mentions:
Seems wrong, as such an NT namespace does not seem usable. |
This PR fixes the parsing of URIs for file+noindex repositories when using Windows paths. As suggested by @phadej in #10703 we now use (and specify in the docs)
//./C:/...
paths on Windows.QA
In Windows, one can now specify
//./
paths in file+noindex repositories. To check, create a simple package, thencabal sdist
, move the tar.gz to some directory and in a different project declare the following stanza:It might still fail because of #9891
Template Α: This PR modifies behaviour or interface
Include the following checklist in your PR:
significance: significant
in the changelog file.