warp tests don't build on non-linux/freebsd/darwin
sthibaul opened this issue · 1 comments
sthibaul commented
Hello,
As can be read on
Building test suite 'spec' for warp-3.3.21..
[ 1 of 48] Compiling HTTP ( test/HTTP.hs, dist-ghc/build/spec/spec-tmp/HTTP.o )
[ 2 of 48] Compiling Network.Wai.Handler.Warp.Date ( Network/Wai/Handler/Warp/Date.hs, dist-ghc/build/spec/spec-tmp/Network/Wai/Handler/Warp/Date.o )
Network/Wai/Handler/Warp/Date.hs:17:1: error:
Could not load module ‘System.Posix’
It is a member of the hidden package ‘unix-2.7.2.2’.
Perhaps you need to add ‘unix’ to the build-depends in your .cabal file.
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
|
17 | import System.Posix (epochTime)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Warp tests don't build on GNU/Hurd, because there's a missing dependency on unix. Looking at warp.cabal
we can read
Test-Suite spec
[...]
if (os(linux) || os(freebsd) || os(darwin)) && flag(allow-sendfilefd)
Cpp-Options: -DSENDFILEFD
Build-Depends: unix
And thus on non-linux/freebsd/darwin, the unix dependency is not pulled, even though we have in Network/Wai/Handler/Warp/Date.hs
:
import System.Posix (epochTime)
I'd say that that part of warp.cabal
should be modified to always build-depend on unix
on non-windows?
kazu-yamamoto commented
Thank you for your report. I believe that "test-suite spec" should have the same logic as "library".