FS#54563 - [cabal-install] hackage packages with custom Setup.hs cause linker failure
Attached to Project:
Community Packages
Opened by José Manuel Calderón Trilla (jmct) - Friday, 23 June 2017, 21:56 GMT
Last edited by Doug Newgard (Scimmia) - Tuesday, 27 June 2017, 05:18 GMT
Opened by José Manuel Calderón Trilla (jmct) - Friday, 23 June 2017, 21:56 GMT
Last edited by Doug Newgard (Scimmia) - Tuesday, 27 June 2017, 05:18 GMT
|
Details
Description:
This bug seems to only occur on the arch linux version of cabal install. I have confirmed that the same version of cabal-install works on OS X. Take for example trying to install the `entropy` package on a fresh install of arch: ``` $ cabal install entropy Resolving dependencies... Configuring entropy-0.3.8... Failed to install entropy-0.3.8 Build log ( /home/vagrant/.cabal/logs/entropy-0.3.8.log ): cabal: Entering directory '/tmp/cabal-tmp-24768/entropy-0.3.8' cabal: Leaving directory '/tmp/cabal-tmp-24768/entropy-0.3.8' cabal: Error: some packages failed to install: entropy-0.3.8 failed during the configure step. The exception was: user error ('/usr/bin/ghc' exited with an error: /usr/bin/ld: cannot find -lHSCabal-1.24.2.0 /usr/bin/ld: cannot find -lHSprocess-1.4.3.0 /usr/bin/ld: cannot find -lHSpretty-1.1.3.3 /usr/bin/ld: cannot find -lHSdirectory-1.3.0.0 /usr/bin/ld: cannot find -lHSunix-2.7.2.1 /usr/bin/ld: cannot find -lHStime-1.6.0.1 /usr/bin/ld: cannot find -lHSfilepath-1.4.1.1 /usr/bin/ld: cannot find -lHSbinary-0.8.3.0 /usr/bin/ld: cannot find -lHScontainers-0.5.7.1 /usr/bin/ld: cannot find -lHSbytestring-0.10.8.1 /usr/bin/ld: cannot find -lHSdeepseq-1.4.2.0 /usr/bin/ld: cannot find -lHSarray-0.5.1.1 /usr/bin/ld: cannot find -lHSbase-4.9.1.0 /usr/bin/ld: cannot find -lHSinteger-gmp-1.0.0.1 /usr/bin/ld: cannot find -lHSghc-prim-0.5.0.0 /usr/bin/ld: cannot find -lHSrts_thr collect2: error: ld returned 1 exit status `gcc' failed in phase `Linker'. (Exit code: 1) ) ``` Additional info: * 1.24.0.2-1 Steps to reproduce: Run try to install a package that uses a custom Setup.hs (two examples: entropy, cabal-install) |
This task depends upon
Closed by Doug Newgard (Scimmia)
Tuesday, 27 June 2017, 05:18 GMT
Reason for closing: Not a bug
Additional comments about closing: config issue
Tuesday, 27 June 2017, 05:18 GMT
Reason for closing: Not a bug
Additional comments about closing: config issue
$ echo 'main = pure ()' >test.hs
$ /usr/bin/ghc test.hs
[1 of 1] Compiling Main ( test.hs, test.o )
Linking test ...
/usr/bin/ld: cannot find -lHSbase-4.9.1.0
/usr/bin/ld: cannot find -lHSinteger-gmp-1.0.0.1
/usr/bin/ld: cannot find -lHSghc-prim-0.5.0.0
/usr/bin/ld: cannot find -lHSrts
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)
Edit 1:
Workaround: uncomment and add ghc-options: -dynamic to your ~/.cabal/config file.
Edit 2:
#54591 was closed as not-a-bug.
Edit 3:
Found another, more global workaround:
sed -i 's/pc_DYNAMIC_BY_DEFAULT = False/pc_DYNAMIC_BY_DEFAULT = True/' /usr/lib/ghc-8.0.2/platformConstants:
I think this change should be included in the 'ghc' package.
One can force Cabal/GHC to ignore the global package database, but afaict this won’t help, since this will ignore boot libraries too.