Compiling projects with dependencies using GHC HEAD

Alexis King lexi.lambda at gmail.com
Tue Oct 1 22:46:23 UTC 2019


Hi all,

I have a project that I’d like to try to build with GHC HEAD, but it’s a
large project with a lot of dependencies, and while there’s a lot of
information on building GHC itself, I haven’t been able to find very many
resources on what workflow people use to actually build projects in the
wild using it. I found this wiki page, “Installing packages in your test
compiler,” which has a little guidance, but the details are sparse:

https://gitlab.haskell.org/ghc/ghc/wikis/debugging/installing-packages-inplace


However, I’ve been struggling to actually get my project to build using
cabal-install paired with a stage 2 compiler. I realize some of this is
just fundamental—various libraries need to be updated for new versions of
GHC—but I’m willing to go to the effort to manually resolve those conflicts
so long as I know the right way to go about doing it.

One simple thing I did try (and failed at) is building an updated version
of cabal-install itself using my updated GHC. From inside my checkout of
the GHC repo, I tried the following:

$ cd libraries/Cabal/cabal-install
$ cabal --version
cabal --version
cabal-install version 2.4.1.0
compiled using version 2.4.1.0 of the Cabal library
$ cabal --with-compiler=<path to ghc> --package-db=<path to package db> \
    new-build cabal-install


However, this failed to compile due to out-of-bounds versions of certain
packages, so I tried again with --allow-newer:

$ cabal --with-compiler=<path to ghc> --package-db=<path to package db> \
    new-build cabal-install --allow-newer=base,ghc-prim,template-haskell


This time, it managed to produce a build plan, but for reasons I don’t
understand, both Cabal-3.1.0.0 and Cabal-2.4.1.0 are in the build plan, and
the latter fails to compile against newer versions of base (due to the
MonadFail changes). I tried to figure out what was causing Cabal-2.4.1.0 to
end up in the build plan, but running new-build with the -v3 option didn’t
seem to give me any more explanation.

Apologies if this is really a request for support with cabal-install, and
it doesn’t belong on this list, but I figured I’d start here, since I
imagine the people on this list are best-equipped to answer questions
involving using GHC HEAD. I’d appreciate any pointers or resources anyone
has!

Thanks,
Alexis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20191001/8c929769/attachment.html>


More information about the ghc-devs mailing list