Skip to content

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

@sebright

Description

@sebright

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions