Haskell-ide-engine: Support Cabal 3.0.0.0

Created on 31 Aug 2019  路  6Comments  路  Source: haskell/haskell-ide-engine

Recently Cabal 3.0.0.0 and cabal-install 3.0.0.0 was released, bringing along the following relevant changes I could find:

As far as I can see, this results in HIE being broken for everybody using Cabal 3.0.0.0

Possible solutions

  • Patch ghc-mod and cabal-helper to use v1- commands explicitly
  • One of

    • Patch cabal-helper to not use the deprecated symbols anymore, by looking at what upstream cabal-helper did to remove them. This might be simple or it might not be simple at all

    • Update cabal-helper to the upstream version, this is what https://github.com/haskell/haskell-ide-engine/pull/1245 tries to do, but there seems to be some problems

    • I also think hie-bios by @mpickering would solve this, though this doesn't look like it's going to be merged quickly

Ping @fendor @bubba @alanz @mpickering @DanielG

Related issues:

cabal-helper

Most helpful comment

We are supporting Cabal 3.0.0.0 from #1126 on!

All 6 comments

I'm afraid it still does not work with the current master:

$ cabal v2-run ./install.hs --project-file install/shake.project hie-8.6.5
Resolving dependencies...
Build profile: -w ghc-8.6.5 -O1
In order, the following will be built (use -v for more details):
 - fake-package-0 (exe:script) (configuration changed)
Configuring executable 'script' for fake-package-0..
Preprocessing executable 'script' for fake-package-0..
Building executable 'script' for fake-package-0..
[1 of 1] Compiling Main             ( Main.hs, /Users/ur20980/src/haskell-ide-engine/dist-newstyle/build/x86_64-osx/ghc-8.6.5/fake-package-0/x/script/build/script/script-tmp/Main.dyn_o )
Linking /Users/ur20980/src/haskell-ide-engine/dist-newstyle/build/x86_64-osx/ghc-8.6.5/fake-package-0/x/script/build/script/script ...
. . . . .
Installing   cabal-install-3.0.0.0 (all, legacy fallback)
Completed    cabal-install-3.0.0.0 (all, legacy fallback)
Symlinking 'hie'
Warning: Failed to build documentation for haddock-api-2.22.0 (which is
required by exe:hie-wrapper from haskell-ide-engine-0.12.0.0 and exe:hie from
haskell-ide-engine-0.12.0.0).
Symlinking 'hie-wrapper'
Error when running Shake build system:
  at want, called at src/Development/Shake/Internal/Args.hs:81:69 in shk-0.17.8-b3e20d9c:Development.Shake.Internal.Args
* Depends on: hie-8.6.5
  at need, called at src/HieInstall.hs:90:37 in hie-install-0.8.0.0-inplace:HieInstall
* Depends on: cabal-hie-8.6.5
* Raised the exception:
/Users/ur20980/.local/bin/hie: copyFile:atomicCopyFileContents:withReplacementFile:copyFileToHandle:openBinaryFile: does not exist (No such file or directory)

Here's the full output: cabal-v2-fail.txt

Before you ask - stack fails to build hie too:

$ stack -v ./install.hs hie-8.6.5 2>&1 | tee ~/stack-fail.txt

--  While building package hie-install-0.8.0.0 using:
      /Users/ur20980/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5 --builddir=.stack-work/dist/x86_64-osx/Cabal-2.4.0.1 build lib:hie-install --ghc-options ""
    Process exited with code: ExitFailure 1
$
$ /Users/ur20980/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5 --version
Cabal library version 2.4.0.1
$

Versions:

  • MacOS 10.14.6
  • GHC-8.6.5 installed via current ghcup
  • Cabal-3.0.0.0
    -Stack-2.1.3
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.6.5
$ cabal --version
cabal-install version 3.0.0.0
compiled using version 3.0.0.0 of the Cabal library 
$ stack --version
Version 2.1.3, Git revision 0fa51b9925decd937e4a993ad90cb686f88fa282 (7739 commits) x86_64 hpack-0.31.2
$ uname -a
Darwin xxxxxx 18.7.0 Darwin Kernel Version 18.7.0: Thu Jun 20 18:42:21 PDT 2019; root:xnu-4903.270.47~4/RELEASE_X86_64 x86_64
$

Ping @fendor @bubba @alanz @mpickering @DanielG

Current master does not support Cabal 3.0.0.0.
However, the hie-bios branch does support Cabal 3.0.0.0.

EDIT: @mouse07410, your errors seem to me completely independent of Cabal 3 support. Installation of hie should work fine with cabal 3.0.

What would you recommend me to do? Pull a different branch? And would you like me to open a separate issue?

Update

Using branch hie-bios did not help, though the error changed:

$ stack -v ./install.hs hie-8.6.5 2>&1 | tee ~/stack-fail.txt
Linking /Users/ur20980/.stack/setup-exe-cache/x86_64-osx/tmp-Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.2 ...
<command line>: can't load .so/.DLL for: libgmp.dylib (dlopen(libgmp.dylib, 5): image not found)
$ git branch
* hie-bios
  master
$ ll /opt/local/lib/libgmp.dylib
lrwxr-xr-x  1 root  admin  15 Dec 11  2018 /opt/local/lib/libgmp.dylib@ -> libgmp.10.dylib
$ ll /opt/local/lib/libgmp.10.dylib
-rwxr-xr-x  1 root  admin  553448 Dec 11  2018 /opt/local/lib/libgmp.10.dylib*
$ 

Yes, please open a different issue. It might be MacOS specific.

We are supporting Cabal 3.0.0.0 from #1126 on!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alanz picture alanz  路  3Comments

raxod502 picture raxod502  路  4Comments

alanz picture alanz  路  3Comments

flip111 picture flip111  路  4Comments

ajeetdsouza picture ajeetdsouza  路  3Comments