Search code examples
haskellcabalhackage

hackage-server fails to build - are there specific ghc/cabal version requirements?


I am trying to build and run a copy of the Hackage server https://github.com/haskell/hackage-server. I followed the instructions here https://github.com/haskell/hackage-server/wiki and also the instructions in the readme. Whichever I try, when trying to build with ghc 7.8.4 and cabal 1.22 I receive the following error:

Preprocessing executable 'hackage-server' for hackage-server-0.5.0...
Main.hs:40:8:
Could not find module ‘Network.URI’
It is a member of the hidden package ‘network-uri-2.6.0.1’.
Perhaps you need to add ‘network-uri’ to the build-depends in your .cabal file.
It is a member of the hidden package ‘network-2.4.2.3’.
Perhaps you need to add ‘network’ to the build-depends in your .cabal file.

I have also tried using the latest Haskell Platform, and I get the same failure message.

I'm trying to work out if this is a bug in the current master branch of hackage-server or if it is something to do with the way I installed ghc or cabal.

EDIT: I've tried again with the Ubuntu 14.04 repo haskell-platform (ghc 7.6.3, cabal 1.16) and the same error happens.


Solution

  • network-uri was split from network a while ago, but it looks like Hackage hasn't been updated with that change.

    As a workaround, open hackage-server.cabal and add these lines to build-dependencies:

    network >= 2.6,
    network-uri >= 2.6
    

    That should get it working again.