ghc-mod icon indicating copy to clipboard operation
ghc-mod copied to clipboard

Failure when upgrading GHC 8.0.1 → 8.0.2

Open andy-morris opened this issue 8 years ago • 15 comments

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)

andy-morris avatar Jan 26 '17 22:01 andy-morris

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.

DanielG avatar May 13 '17 17:05 DanielG

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

ironchicken avatar Jun 21 '17 23:06 ironchicken

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

DanielG avatar Jun 22 '17 02:06 DanielG

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)

ironchicken avatar Jun 22 '17 21:06 ironchicken

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.

DanielG avatar Jun 27 '17 19:06 DanielG

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 avatar Jul 18 '17 23:07 skalyan91

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.

skalyan91 avatar Jul 19 '17 00:07 skalyan91

@skalyan91 can you post the error messages please?

DanielG avatar Jul 19 '17 19:07 DanielG

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.)

skalyan91 avatar Jul 20 '17 09:07 skalyan91

same issue

nineonine avatar Jul 29 '17 06:07 nineonine

@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.

DanielG avatar Jul 30 '17 13:07 DanielG

right on! updating 'cabal-install' fixed everything

nineonine avatar Jul 30 '17 16:07 nineonine

OK, I managed to fix this, but only by uninstalling "ghc-mod". As soon as I install "ghc-mod", the problem returns. Not having "ghc-mod" installed does not seem to lead to any problems (as far as I can tell at the moment).

Also, last week I successfully set up Haskell on a new machine running Ubuntu 16.04, and got it running under Emacs; I don't believe I (explicitly) installed ghc-mod (only haskell-platform, and cabal-*).

On 31 July 2017 at 02:57, Alex Dudarenko [email protected] wrote:

right on! updating 'cabal-install' fixed everything

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DanielG/ghc-mod/issues/869#issuecomment-318914481, or mute the thread https://github.com/notifications/unsubscribe-auth/AC2gwDswNr10kJnShFr3jrhAA6jIB6Yjks5sTLXpgaJpZM4LvOEp .

skalyan91 avatar Aug 15 '17 11:08 skalyan91

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

miladz68 avatar Aug 27 '17 08:08 miladz68

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

skalyan91 avatar Nov 11 '17 03:11 skalyan91