Skip to content

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

Open

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

Activity

  1. sebright commented on Mar 18, 2018

    @sebright
    CollaboratorAuthor
  2. added a commit that references this issue on Mar 18, 2018
  3. added 2 commits that reference this issue on Mar 29, 2018
  4. added 2 commits that reference this issue on Apr 29, 2018
  5. added a commit that references this issue on May 9, 2018
  6. added
    re: config-file
    on Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform: windowsre: config-filetype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions