Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

Failure when upgrading GHC 8.0.1 → 8.0.2 #869

Open
andy-morris opened this issue Jan 26, 2017 · 15 comments
Open

Failure when upgrading GHC 8.0.1 → 8.0.2 #869

andy-morris opened this issue Jan 26, 2017 · 15 comments

Comments

@andy-morris
Copy link

cabal-helper-wrapper: Installing a private copy of Cabal because we couldn't
find the right version in your global/user package-db, this might take a
while but will only happen once per Cabal version you're using.

If anything goes horribly wrong just delete this directory and try again:
    /home/anders0/.ghc-mod/cabal-helper

If you want to avoid this automatic installation altogether install
version 1.24.0.0 of Cabal manually (into your user or global package-db):
    $ cabal install Cabal --constraint "Cabal == 1.24.0.0"

Installing Cabal 1.24.0.0 ...
Resolving dependencies...
In order, the following would be installed:
directory-1.2.7.1 (latest: 1.3.0.1) (via: Cabal-1.24.0.0 process-1.4.3.0) (new version)
process-1.4.3.0 (via: Cabal-1.24.0.0) (reinstall) (changes: directory-1.3.0.0 removed)
Cabal-1.24.0.0 (latest: 1.24.2.0) (new version)
cabal: The following packages are likely to be broken by the reinstalls:
ghc-8.0.2
Cabal-1.24.2.0
Use --force-reinstalls if you want to install anyway.
cabal-helper-wrapper: Installing Cabal version 1.24.0.0 failed.

You have the following choices to fix this:

- The easiest way to try and fix this is just reconfigure the project and try
  again:
        $ cabal clean && cabal configure

- If that fails you can try to install the version of Cabal mentioned above
  into your global/user package-db somehow, you'll probably have to fix
  something otherwise it wouldn't have failed above:
        $ cabal install Cabal --constraint 'Cabal == 1.24.0.0'

- If you're using `Build-Type: Simple`:
  - You can see if you can reinstall your cabal-install executable while
    having it linked to a version of Cabal that's available in you
    package-dbs or can be built automatically:
        $ ghc-pkg list | grep Cabal  # find an available Cabal version
            Cabal-W.X.Y.Z
        $ cabal install cabal-install --constraint 'Cabal == W.X.*'
    Afterwards you'll have to reconfigure your project:
        $ cabal clean && cabal configure

- If you're using `Build-Type: Custom`:
  - Have cabal-install rebuild your Setup.hs executable with a version of the
    Cabal library that you have available in your global/user package-db:
        $ cabal clean && cabal configure
    You might also have to install some version of the Cabal to do this:
        $ cabal install Cabal

(recompiling cabal-install with the new Cabal version fixed it)

@DanielG
Copy link
Owner

DanielG commented May 13, 2017

If anyone else is experiencing this please make some noise otherwise I'm going to close this under the assumption everyone's got a working 8.0.2 environment now.

@ironchicken
Copy link

I'm getting this problem with cabal sanboxes.

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.0.2
$ ghc-mod --version
ghc-mod version 5.7.0.0 compiled by GHC 8.0.2

@DanielG
Copy link
Owner

DanielG commented Jun 22, 2017

@ironchicken are you getting exactly the same error message? Could you post it if in doubt?

@ironchicken
Copy link

cabal-helper-wrapper: Installing a private copy of Cabal because we couldn't
find the right version in your global/user package-db, this might take a
while but will only happen once per Cabal version you're using.

If anything goes horribly wrong just delete this directory and try again:
    /home/richard/.ghc-mod/cabal-helper

If you want to avoid this automatic installation altogether install
version 1.24.1.0 of Cabal manually (into your user or global package-db):
    $ cabal install Cabal --constraint "Cabal == 1.24.1.0"

Installing Cabal 1.24.1.0 ...
Unpacking to Cabal-1.24.1.0/
Resolving dependencies...
In order, the following would be installed:
directory-1.2.7.1 (latest: 1.3.1.1) (via: Cabal-1.24.1.0 process-1.4.3.0) (new version)
process-1.4.3.0 (latest: 1.6.0.0) (via: Cabal-1.24.1.0) (reinstall) (changes: directory-1.3.0.0 removed)
Cabal-1.24.1.0 (latest: 1.24.2.0) (new version)
cabal: The following packages are likely to be broken by the reinstalls:
ghc-8.0.2
Cabal-1.24.2.0
Use --force-reinstalls if you want to install anyway.
cabal-helper-wrapper: Installing Cabal version 1.24.1.0 failed.

You have the following choices to fix this:

- The easiest way to try and fix this is just reconfigure the project and try
  again:
        $ cabal clean && cabal configure

- If that fails you can try to install the version of Cabal mentioned above
  into your global/user package-db somehow, you'll probably have to fix
  something otherwise it wouldn't have failed above:
        $ cabal install Cabal --constraint 'Cabal == 1.24.1.0'

- If you're using `Build-Type: Simple`:
  - You can see if you can reinstall your cabal-install executable while
    having it linked to a version of Cabal that's available in you
    package-dbs or can be built automatically:
        $ ghc-pkg list | grep Cabal  # find an available Cabal version
            Cabal-W.X.Y.Z
        $ cabal install cabal-install --constraint 'Cabal == W.X.*'
    Afterwards you'll have to reconfigure your project:
        $ cabal clean && cabal configure

- If you're using `Build-Type: Custom`:
  - Have cabal-install rebuild your Setup.hs executable with a version of the
    Cabal library that you have available in your global/user package-db:
        $ cabal clean && cabal configure
    You might also have to install some version of the Cabal to do this:
        $ cabal install Cabal


ghc-mod: GMEProcess "readProcessStderrChan" "/home/richard/code/haskell/ghc-mod/.cabal-sandbox/libexec/x86_64-linux-ghc-8.0.2/cabal-helper-0.7.3.0/cabal-helper-wrapper" ["--with-ghc=ghc","--with-ghc-pkg=ghc-pkg","--with-cabal=cabal","/home/richard/code/haskell/elastic-metadata","/home/richard/code/haskell/elastic-metadata/dist","package-db-stack","entrypoints","source-dirs","ghc-options","ghc-src-options","ghc-pkg-options","ghc-merged-pkg-options","ghc-lang-options","licenses","flags","config-flags","non-default-config-flags","compiler-version"] (Left 1)

@DanielG
Copy link
Owner

DanielG commented Jun 27, 2017

Right yeah that looks like the same problem. The easy solution is just to recompile cabal-install using something like cabal update && cabal install cabal-install. I'll see if I can reproduce this and work around it in cabal-helper.

@skalyan91
Copy link

skalyan91 commented Jul 18, 2017

I am also having this problem (where it tries to install Cabal 1.24.1.0). I have tried both cabal install Cabal --constraint 'Cabal == 1.24.2.0' and cabal update && cabal install cabal-install, but to no avail. I even considered manually installing Cabal 1.24.1.0, but got a warning that it might break GHC 8.0.2., so didn't go ahead.

@skalyan91
Copy link

Also tried cabal install Cabal --constraint 'Cabal == 1.24.2.0' (despite the warning about possibly breaking hackage-security-0.5.2.2), but this still doesn't help.

@DanielG
Copy link
Owner

DanielG commented Jul 19, 2017

@skalyan91 can you post the error messages please?

@skalyan91
Copy link

skalyan91 commented Jul 20, 2017

Here's a partial screenshot (I'm unable to copy the text directly because Emacs has frozen):

screenshot from 2017-07-20 19-52-31

(The missing lines at the top are the same as for @andy-morris and @ironchicken.)

@nineonine
Copy link

same issue

@DanielG
Copy link
Owner

DanielG commented Jul 30, 2017

@skalyan91 Ah I see what is happening, the cabal guys deprecated version 1.24.1.0 on Hackage and added an unsatisfiable constraint to it (the base < 0 in the output above). This has nothing to do with ghc-mod or cabal-helper you simply need to upgrade your cabal-install. This is an urelated issue though.

@nineonine
Copy link

right on! updating 'cabal-install' fixed everything

@skalyan91
Copy link

skalyan91 commented Aug 15, 2017 via email

@miladz68
Copy link

I had an issue which I think is relevant to what @andy-morris is reporting. here is the log

ghc-mod check app/Seperator.hs

cabal-helper-wrapper: /home/milad/.ghc-mod/cabal-helper/cabal-helper-0.7.3.0-Cabal-1.24.2.0: createProcess: runInteractiveProcess: exec: permission denied (Permission denied)
ghc-mod: readCreateProcess: /home/milad/.stack/snapshots/x86_64-linux-gmp4/lts-9.1/8.0.2/libexec/x86_64-linux-ghc-8.0.2/cabal-helper-0.7.3.0/cabal-helper-wrapper "--with-ghc=/home/milad/.stack/programs/x86_64-linux/ghc-gmp4-8.0.2/bin/ghc" "--with-ghc-pkg=/home/milad/.stack/programs/x86_64-linux/ghc-gmp4-8.0.2/bin/ghc-pkg" "--with-cabal=cabal" "/home/milad/sources/IMI-FTP" "/home/milad/sources/IMI-FTP/.stack-work/dist/x86_64-linux-gmp4/Cabal-1.24.2.0" "package-db-stack" "entrypoints" "source-dirs" "ghc-options" "ghc-src-options" "ghc-pkg-options" "ghc-merged-pkg-options" "ghc-lang-options" "licenses" "flags" "config-flags" "non-default-config-flags" "compiler-version" (exit 1): failed

I used what @andy-morris suggested and removed ~/.ghc-mod folder, and it was fixed

@skalyan91
Copy link

FWIW, my problems disappeared after upgrading to Ubuntu 17.10. I am now able to use ghc-mod without getting any errors.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants