Open mouse07410 opened 5 years ago
I have a similar problem on archlinux while installing intero. Here is the error:
While building package ghc-paths-0.1.0.9 using:
/home/terzievk/.stack/programs/x86_64-linux/ghc-tinfo6-8.8.2/bin/ghc-8.8.2 --make -odir /tmp/stack-dcdca92561a018ae/ghc-paths-0.1.0.9/.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.0.1.0/setup -hidir /tmp/stack-dcdca92561a018ae/ghc-paths-0.1.0.9/.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.0.1.0/setup -i -i. -clear-package-db -global-package-db -package-db=/home/terzievk/.stack/snapshots/x86_64-linux-tinfo6/8c94611031dbc130e5574b8d8ad2b5c41557903cfa4a41958fb465ceb081bbeb/8.8.2/pkgdb -package-db=/home/terzievk/.stack/global-project/.stack-work/install/x86_64-linux-tinfo6/8c94611031dbc130e5574b8d8ad2b5c41557903cfa4a41958fb465ceb081bbeb/8.8.2/pkgdb -hide-all-packages -package=Cabal -package-id=base-4.13.0.0 -package-id=directory-1.3.4.0 -optP-include -optP/tmp/stack-dcdca92561a018ae/ghc-paths-0.1.0.9/.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.0.1.0/setup/setup_macros.h /tmp/stack-dcdca92561a018ae/ghc-paths-0.1.0.9/Setup.hs /home/terzievk/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs -main-is StackSetupShim.mainOverride -o /tmp/stack-dcdca92561a018ae/ghc-paths-0.1.0.9/.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.0.1.0/setup/setup -threaded
Process exited with code: ExitFailure 1
If anyone could help with investigating and fixing this I'd be grateful. Why does it work with Cabal and not Stack? Is Stack perhaps not running the Setup.hs
for the package?
I didn't check at the time I made my previous comment, but since intero is discontinued, does it really matter?
Setup
MacOS Mojave 10.14.2, Xcode-10.1, current Macports with a lot of tools ("ports") installed, current Haskell Platform (ghc-8.6.3), current
cabal
andstack
.In short
stack
fails to buildintero
because it fails to buildghc-paths
. Which fails, because somehowghc-paths
is the only package (or one of the few) that does not accept (or doesn't make use of) parameters like---ghc-options -optL=/usr/lib/libiconv.dylib
.This came up in https://github.com/rikvdkleij/intellij-haskell/issues/375
Log
Shown in the attempt to build
intero
: intero-build.txtThe long story
Problem: Macports provides it's own version of
libiconv.dylib
, and it mangles function names - so it cannot be used in place of the Apple-providedlibiconv.dylib
. Standardghc
(or rather,libHSbase.a
, which is a part of the GHC binary package) is linked against the Apple-providedlibiconv.dylib
.For most packages (of for everything other than
ghc-paths
), adding--ghc-options -optL=/usr/lib/libiconv.dylib
to thestack
invocation seems to suffice to force the linker to take the correct shared library (to use/usr/lib/libiconv.dylib
instead of/opt/local/lib/libiconv.dylib
that precedes it on the library search path - which it must for reasons I don't want to get into here). But withghc-paths
it does not work.Since all of my
stack
config files add the options I listed, but I cannot find it in the actual log - I suspect that something in theghc-paths
forces certain build flags. If that's correct - it would have to be relaxed to fix this problem.Note: with
cabal
I can buildghc-paths
and installintero
. But that doesn't help with my problem, as the IDE plugin I'm using, only understand `stack projects.Your help is requested in resolving this.
Thanks!