2

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.

matchwood
  • 257
  • 1
  • 7
  • Does it work if you add `network-uri >= 2.6` and `network >= 2.6` to the `build-depends`? – Lambda Fairy Jan 14 '15 at 21:24
  • @LambdaFairy That does clear that error, thank you! I figured from the compiler error that I might be able to fix it that way, but I didn't want to start fiddling with that until I was sure it wasn't related to the ghc version etc. – matchwood Jan 14 '15 at 22:15
  • Great! I've posted that as an answer below. – Lambda Fairy Jan 14 '15 at 22:41

1 Answers1

0

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.

Lambda Fairy
  • 13,814
  • 7
  • 42
  • 68
  • 1
    Great, thanks. Just thought I'd add that hackage-server.cabal references network in multiple build-dependencies (for hackage-mirror, tests and so on) and all of these need to be changed. – matchwood Jan 15 '15 at 00:14