Deewiant / glob

Haskell library for glob matching
https://deewiant.iki.fi/projects/glob/
Other
25 stars 8 forks source link

Test issue during Installation with nix #5

Closed ibrahimsag closed 8 years ago

ibrahimsag commented 8 years ago

Hey, I get the following error. does it make any sense to you?

Preprocessing library Glob-0.7.10...
[1 of 7] Compiling System.FilePath.Glob.Utils ( System/FilePath/Glob/Utils.hs, dist/build/System/FilePath/Glob/Utils.o )
[2 of 7] Compiling System.FilePath.Glob.Base ( System/FilePath/Glob/Base.hs, dist/build/System/FilePath/Glob/Base.o )
[3 of 7] Compiling System.FilePath.Glob.Match ( System/FilePath/Glob/Match.hs, dist/build/System/FilePath/Glob/Match.o )
[4 of 7] Compiling System.FilePath.Glob.Directory ( System/FilePath/Glob/Directory.hs, dist/build/System/FilePath/Glob/Directory.o )
[5 of 7] Compiling System.FilePath.Glob.Simplify ( System/FilePath/Glob/Simplify.hs, dist/build/System/FilePath/Glob/Simplify.o )
[6 of 7] Compiling System.FilePath.Glob.Primitive ( System/FilePath/Glob/Primitive.hs, dist/build/System/FilePath/Glob/Primitive.o )
[7 of 7] Compiling System.FilePath.Glob ( System/FilePath/Glob.hs, dist/build/System/FilePath/Glob.o )
In-place registering Glob-0.7.10...
Preprocessing test suite 'glob-tests' for Glob-0.7.10...

Tests/Utils.hs:3:8:
    File name does not match module name:
    Saw: ‘Utils’
    Expected: ‘Tests.Utils’
builder for ‘/nix/store/ihqhggkawmw26bs85nfmjv36lbrnm3yh-Glob-0.7.10.drv’ failed with exit code 1
Deewiant commented 8 years ago

Could be related to the recent b61dabe27cc39fb164d20fd3abfe70b21699c6de where Utils.hs was added explicitly to the list of modules in the test suite. I don't know why it's causing an issue for you though. I would guess it's a Nix-specific thing.

TikhonJelvis commented 8 years ago

I think I've tracked down the problem. The test suite is configured with two source directories:

hs-source-dirs: ., tests

At a guess, cabal is starting with . and seeing tests/Utils.hs as if it were Tests/Utils.hs.

Switching the order of hs-source-dirs fixed the problem for me, but that still feels pretty fragile. I'm not sure if this is fundamentally an issue with cabal or just that you shouldn't provide nested source dirs.

hs-source-dirs: tests, .

I'm not sure exactly what's causing this problem to pop up in Nix but not elsewhere—perhaps it's a matter of the cabal version? Here's mine:

[nix-shell:~/programming/glob]$ cabal --version
cabal-install version 1.24.0.0
compiled using version 1.24.0.0 of the Cabal library 
TikhonJelvis commented 8 years ago

Thinking about it some more, it's probably because I ran this on OS X and OS X filepaths are case-insensitive, so tests/Utils.hs looks the same as Tests/Utils.hs.

Deewiant commented 8 years ago

Thanks for the sleuthing, sounds plausible. I pushed out 0.7.11 which gets rid of the whole tests/Utils.hs file. I don't have a case-insensitive file system conveniently on hand so I don't know if that actually resolves this issue. Please let me know either way.

TikhonJelvis commented 8 years ago

Yes, 0.7.11 builds for me on OS X. Thanks!