Ghc can't load a package, even when ghc-pkg listed it

I fear the Haskell School of Music installation guide is woefully outdated. I fairly frequently see questions about trying to build it.

That said, I don’t understand the problem you’re seeing. I can build it fine.

But firstly an important point:

never use cabal install --lib!

I know cabal itself recommends you try it. Don’t. cabal is very naughty to recommend something that causes a huge bunch of headaches. If you ever get tempted to use cabal install --lib and you don’t know what to do instead please post a question here.

Now onto actually building it. Here’s what I did:

$ git clone https://github.com/Euterpea/HSoM.git
$ cd HSoM
$ cabal build --allow-newer

and it built without problems. You do not have to install dependencies manually! That means you don’t need to mention UISF or Euterpea explicitly. cabal will just download them from Hackage and install them.

Now, the version of Euterpea cabal pulled in was 2.0.7 (which is on Hackage) and perhaps you want 2.0.8 (which is not on Hackage) so that makes things slightly more complicated.

But before we get more complicated can we establish a baseline? Please tell me whether you can cabal build HSoM using the commands I give above?


FWIW I did have to install the Debian dependencies manually, specifically

libglu1-mesa-dev
libasound-dev
libgl-dev
3 Likes