ndmitchell / hoogle

Haskell API search engine
http://hoogle.haskell.org/
Other
738 stars 134 forks source link

`cabal install hoogle` failure #383

Open ndzik opened 2 years ago

ndzik commented 2 years ago

Hopefully the right address here (;

So I tried to install hoogle via cabal using the following command:

cabal install hoogle

Down the road I receive the following error:

cabal: Failed to build wai-logger-2.4.0 (which is required by exe:hoogle from
hoogle-5.0.18.3). The failure occurred during the configure step. The
exception was:
dieVerbatim: user error (cabal: '/home/omega/.ghcup/bin/ghc' exited with an
error:

/tmp/cabal-install.-47811/dist-newstyle/tmp/src-47813/wai-logger-2.4.0/dist/setup/setup.hs:11:1:
error:
Bad interface file:
/home/omega/.cabal/store/ghc-8.10.7/cabal-doctest-1.0.9-f8a0eb8f5ca943544bd4426764b807654c9259bab0897519ba54541e31009638/lib/Distribution/Extra/Doctest.hi
mismatched interface file ways (wanted "", got "dyn")
|
11 | import Distribution.Extra.Doctest ( defaultMainWithDoctests )
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)

Workaround: What worked for me was cabal install hoogle --ghc-options="-dynamic-too". Now I do not know why this worked and the only reason I tried this out was because of an issue with haskell-language-server in which a similar error was mentioned in the thread and this answer containing above suggestion. I figured I try it and everything works now.

System: ArchLinux GHC: Everything haskell related is installed with ghcup. I tried the above with GHC 8.10.7. Cabal: Tried with versions 3.6.2.0 and 3.4.1.0 and it only works with the above flag for both.

Maybe this is also an issue for cabal? I think someone might point me to the right direction, just figured I post something s.t. some other lost soul might find a solution.

Might this be related to me being on ArchLinux? Since I am not using any Arch ghc or haskell-* packages I figured this should not pose a problem but who am I to judge.

Thanks for your time!

ghost commented 2 years ago

Looks like wai-logger-2.4.0 was uploaded at 2022-01-30T00:52:35Z.

GHC 8.10.7

hoogle successfully installed in December 2021 using GHC 8.10.7 and wai-logger-2.3.7


with this cabal executable

https://downloads.haskell.org/~cabal/cabal-install-3.6.0.0/ cabal-install-3.6.0.0-x86_64-linux.tar.xz

$ tar xvf cabal-install-3.6.0.0-x86_64-linux.tar.xz
cabal
$ ./cabal --version
cabal-install version 3.6.0.0
compiled using version 3.6.1.0 of the Cabal library
$

Running strings cabal | grep lHS | cut -f 1 -d ] | cut -f 2 -d [ | tr , '\n' prints the Haskell libraries (and Cffi library as bundled with rts) the executable had been compiled with.

Strip and locally install cabal.

$ strip --strip-unneeded cabal
$ mkdir -p ~/.cabal/bin && mv cabal ~/.cabal/bin
$ 
kazu-yamamoto commented 2 years ago

wai-logger-2.4.0 changed a minor log message a bit. Building should not be influenced at all.