Skip to content
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

cabal-install converts the remote repo URI to a file path incorrectly on Windows. #5218

Open
grayjay opened this issue Mar 18, 2018 · 1 comment

Comments

@grayjay
Copy link
Collaborator

grayjay commented Mar 18, 2018

This issue is item 4 from #5204, but I wanted to open a separate issue because it doesn't just affect tests.

When the url field of the repository section of the cabal config file is a file URI, cabal treats its path component as a file path, without applying a conversion:

withRepo _ callback | uriScheme remoteRepoURI == "file:" = do
dir <- Sec.makeAbsolute $ Sec.fromFilePath (uriPath remoteRepoURI)

On Windows, the path is invalid because it contains forward slashes. If the path is an absolute path, hackage-security's path conversion code ends up removing the colon from the path and preventing cabal from reading root.json. There is more detail in #5204 (comment).

@grayjay
Copy link
Collaborator Author

grayjay commented Mar 18, 2018

I tried searching for a conversion function, and the only one I could find was in haskell-lsp: https://hackage.haskell.org/package/haskell-lsp-0.2.0.1/docs/Language-Haskell-LSP-TH-DataTypesJSON.html#v:uriToFilePath

grayjay added a commit to grayjay/cabal that referenced this issue Mar 18, 2018
This commit uses a relative path to specify the test remote repository on
Windows, to avoid the path conversion issue described in haskell#5218.
grayjay added a commit to grayjay/cabal that referenced this issue Mar 29, 2018
This commit uses a relative path to specify the test remote repository on
Windows, to avoid the path conversion issue described in haskell#5218.
grayjay added a commit to grayjay/cabal that referenced this issue Mar 31, 2018
This commit uses a relative path to specify the test remote repository on
Windows, to avoid the path conversion issue described in haskell#5218.
grayjay added a commit to grayjay/cabal that referenced this issue Apr 29, 2018
This commit uses a relative path to specify the test remote repository on
Windows, to avoid the path conversion issue described in haskell#5218.
grayjay added a commit to grayjay/cabal that referenced this issue May 3, 2018
This commit uses a relative path to specify the test remote repository on
Windows, to avoid the path conversion issue described in haskell#5218.
23Skidoo pushed a commit that referenced this issue May 9, 2018
This commit uses a relative path to specify the test remote repository on
Windows, to avoid the path conversion issue described in #5218.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant