You are not logged in.

#1 2018-03-14 16:46:03

marmistrz
Member
Registered: 2016-01-05
Posts: 129

Cannot convince cabal to do dynamic linking using the config file

Hi. As described in the wiki, I have modified my ~/.cabal/config in the following way:

As advised in the wiki page: https://wiki.archlinux.org/index.php/Ha … th_linking
I have modified my `~/.cabal/config` in the following way

library-vanilla: False
shared: True
executable-dynamic: True

Even though, cabal doesn't seem to pick up those options:

$ cabal install quickcheck  --reinstall
Resolving dependencies...
In order, the following will be installed:
QuickCheck-2.11.3 (reinstall)
Warning: Note that reinstalls are always dangerous. Continuing anyway...
Configuring QuickCheck-2.11.3...
Building QuickCheck-2.11.3...
Failed to install QuickCheck-2.11.3
Build log ( /home/marcin/.cabal/logs/ghc-8.2.2/QuickCheck-2.11.3-19mdm5lhmxMFf4AANg83KE.log ):
cabal: Entering directory '/tmp/cabal-tmp-8330/QuickCheck-2.11.3'
Configuring QuickCheck-2.11.3...
Preprocessing library for QuickCheck-2.11.3..
Building library for QuickCheck-2.11.3..
[ 1 of 15] Compiling Test.QuickCheck.Exception ( Test/QuickCheck/Exception.hs, dist/build/Test/QuickCheck/Exception.o )

Test/QuickCheck/Exception.hs:7:8: error:
    Could not find module ‘Prelude’
    There are files missing in the ‘base-4.10.1.0’ package,
    try running 'ghc-pkg check'.
    Use -v to see a list of the files searched for.
  |
7 | module Test.QuickCheck.Exception where
  |        ^^^^^^^^^^^^^^^^^^^^^^^^^

Test/QuickCheck/Exception.hs:15:1: error:
    Could not find module ‘Control.Exception’
    There are files missing in the ‘base-4.10.1.0’ package,
    try running 'ghc-pkg check'.
    Use -v to see a list of the files searched for.
   |
15 | import qualified Control.Exception as E
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cabal: Leaving directory '/tmp/cabal-tmp-8330/QuickCheck-2.11.3'
cabal: Error: some packages failed to install:
QuickCheck-2.11.3-19mdm5lhmxMFf4AANg83KE failed during the building phase. The
exception was:
ExitFailure 1

If I explicitly pass the flags to `cabal`, then the installation succeeds:

$ cabal install --enable-shared --enable-executable-dynamic --disable-library-vanilla quickcheck --reinstall
Resolving dependencies...
In order, the following will be installed:
QuickCheck-2.11.3 (reinstall)
Warning: Note that reinstalls are always dangerous. Continuing anyway...
Configuring QuickCheck-2.11.3...
Building QuickCheck-2.11.3...
Installed QuickCheck-2.11.3

It looks like cabal ignores the configuration of these options. What's more interesting, setting the prefix in `~/.cabal/config` seems to work.
Do you have any idea how to convince cabal to link everything in accordance to how Arch handles things Haskell?

Last edited by marmistrz (2018-03-14 16:46:32)

Offline

Board footer

Powered by FluxBB