Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when installing cabal-install #17

Open
MrQubo opened this issue Apr 5, 2020 · 1 comment
Open

Error when installing cabal-install #17

MrQubo opened this issue Apr 5, 2020 · 1 comment

Comments

@MrQubo
Copy link

MrQubo commented Apr 5, 2020

I've tried running

stack install cabal-install

But it failed:

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

In the dependencies for cabal-install-3.2.0.0:
    Cabal-2.4.0.1 from stack configuration does not match ==3.2.*  (latest matching version is 3.2.0.0)
    hackage-security must match >=0.6.0.0 && <0.7, but the stack configuration has no specified version  (latest matching version is 0.6.0.0)
    lukko must match >=0.1 && <0.2, but the stack configuration has no specified version  (latest matching version is 0.1.1.2)
needed since cabal-install is a build target.

Some different approaches to resolving this:

  * Recommended action: try adding the following to your extra-deps in /home/arch/.asdf/installs/haskell/8.6.5/stack/global-project/stack.yaml:

- Cabal-3.2.0.0@sha256:d0d7a1f405f25d0000f5ddef684838bc264842304fd4e7f80ca92b997b710874,27320
- hackage-security-0.6.0.0@sha256:69987d46e7b55fe5f0fc537021c3873c5f6f44a6665d349ee6995fd593df8147,11976
- lukko-0.1.1.2@sha256:c9d3fa30fb6ab2ba16e037586ca79be6e57ec5f00381b6ee5f293400dbdf5515,4485

Plan construction failed.

Adding extra-deps, as the message described, fixed the error.
But is this expected behavior or there's something wrong with my installation?

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.6.5
@jakecoble
Copy link

Quick fix for anyone else who was having trouble installing cabal-install:

asdf install haskell 8.6.5
asdf global haskell 8.6.5
asdf reshim
stack install cabal-install --resolver lts-14.27

Response to OP:

Nothing wrong with your installation exactly, the README is just missing some detail.

You need to use the correct resolver to fetch from a Stackage snapshot that has all the packages you need. Adding packages to extra-deps fetches those from Hackage, not a Stackage snapshot, so this works around the problem, but using --resolver lts-14.27 solves it without manually editing files. You can also set the default resolver in the config, see: https://docs.haskellstack.org/en/stable/yaml_configuration/#resolver

See here for all the snapshots that contain cabal-install (and the ghc versions they support): https://www.stackage.org/lts-14.27/package/cabal-install-2.4.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants