Visitar URL original
Behavior of `getHomeDirectory` and/or `canonicalizePath` is inconsistent across GHC versions · Issue #44 · haskell/directory · GitHub
Skip to content

Behavior of getHomeDirectory and/or canonicalizePath is inconsistent across GHC versions  #44

Closed

Description

@mrkkrp

Here is the test:

https://github.com/mrkkrp/path-io/blob/master/tests/Main.hs#L116

It succeds with 7.10, but fails with 7.8 and 8.0:

https://travis-ci.org/mrkkrp/path-io/jobs/110565920#L381

At first I decided to “forgive” 7.8 and added some CPP to skip that test there, but now I added 8.0 to build matcix and this thing again throws something unexpected. getHomeDir uses getHomeDirectory and canonicalizePath, so the only thing it can throw in the setting of that test is isDoesNotExistError. Any comment?

Activity

  1. Rufflewind commented on Feb 20, 2016

    @Rufflewind
    Member

    canonicalizePath used to have unpredictable behavior on non-existent paths in versions of directory older than 1.2.3.0. Since 1.2.3.0, it was fixed to return a sensible result for any path, even non-existent ones. Hence, your test should expect no errors at all, but only if directory is 1.2.3.0 or newer. Otherwise, all bets are off.

    Keep in mind that the version of directory is not tied to that of GHC or base. Consider checking for directory's version rather than base:

    #if MIN_VERSION_directory(1, 2, 3)

    Your Travis tests for GHC 7.8 pulled in directory-1.2.5.0, but for GHC 7.10 it was using directory-1.2.2.0.

  2. mrkkrp commented on Feb 20, 2016

    @mrkkrp
    Author

    Thanks for the explanation, I will update the tests accordingly.

  3. added 2 commits that reference this issue on Jul 29, 2016
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions