haskelldependency-managementhaskell-stackhakyll

Stack not resolving dependencies properly


I'm trying to set up Hakyll on a fresh Ubuntu 16.04 instance, but I can't seem to get the Stack-based setup instructions right.

Starting out with stack install hakyll, I get:

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for hakyll-4.9.3.0:
    http-conduit-2.1.11 must match >=2.2 && <2.3 (latest applicable is 2.2.3)

Plan construction failed.

I got a similar error when tying to stack-install http-conduit-2.1.11, this time with:

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for http-conduit-2.2.3:
    http-client-0.4.31.2 must match >=0.5 && <0.6 (latest applicable is 0.5.5)
    http-client-tls-0.2.4.1 must match >=0.3 && <0.4 (latest applicable is 0.3.3.1)

Plan construction failed.

After resolving dependencies for this (also using Stack), I tried once again to stack install http-conduit-2.1.11, but I once again got the same dependency error.

The packages http-client-0.4.31.2 and http-client-tls-0.2.4.1 appear in my ~/.stack/precompiled/x86_64-linux/ghc-8.0.1/1.24.0.0/, which isn't explicitly in my $PATH, however that feels like an extremely hacky solution, and I haven't found any documentation recommending this approach.

How can I correctly install Hakyll on my machine?


Solution

  • A simpler solution than @sjakobi's in this case was to specify a resolver as a command line option when starting a new Stack project:

    stack install hakyll --resolver=5.11 --install-ghc