cabal is not reading or respecting ~/.cabal/config #760

Closed
bos opened this Issue May 24, 2012 · 4 comments

4 participants

@bos
Haskell member

(Imported from Trac #770, reported by guest on 2010-11-27)

I changed my ~/.cabal/config file to keep global packages under /usr/local/lib/haskell and /usr/local/share/haskell to avoid cluttering the main /usr/local/lib and /usr/local/share/doc directories. ghc-pkg finds them just fine, and ghc-pkg recache works as expected. However, when I do 'cabal install whatever --global' it still throws everything into the old default directories, and more distressingly it isn't updating the access timestamp on ~/.cabal/config (as revealed by ls -u.)

cabal --version reports 0.8.2 using library 1.8.0.6, nothing else unusual about my setup.

@bos
Haskell member

(Imported comment by @dcoutts on 2010-11-27)

This is quite peculiar. I assume it is something odd in your particular setup or situation, since cabal definitely does read its config file (or very little would work for anyone).

Double check a few things:

  • that your ~/.cabal/config file is readable.
  • are access timestamps on your system accurate? (may systems are configured with the noatime mount option). If you're sure it's not reading it at all, check with strace.
Attaching your ~/.cabal/config to this ticket might give us more clues.

@marcotmarcot

I'm having the same problem. I've made the following change my ~/.cabal/config:

22c22

< -- library-profiling: False

-- library-profiling: True
24c24

< -- executable-profiling: False

-- executable-profiling: True
37c37

< -- documentation: False

-- documentation: True

But still, when I try to install a package, it won't build profiling libraries or documentation:

marcot@ioiozinho:Mon Jul 30 10:15:40:~$ cabal install --reinstall iconv
Resolving dependencies...
Configuring iconv-0.4.1.0...
Preprocessing library iconv-0.4.1.0...
Building iconv-0.4.1.0...
[1 of 2] Compiling Codec.Text.IConv.Internal ( Codec/Text/IConv/Internal.hs, dist/build/Codec/Text/IConv/Internal.o )

Codec/Text/IConv/Internal.hs:46:1:
Warning: In the use of `unsafePerformIO'
(imported from Foreign):
Deprecated: "Use System.IO.Unsafe.unsafePerformIO instead; This function will be removed in the next release"
[2 of 2] Compiling Codec.Text.IConv ( Codec/Text/IConv.hs, dist/build/Codec/Text/IConv.o )
Registering iconv-0.4.1.0...
Installing library in /home/marcot/.cabal/lib/iconv-0.4.1.0/ghc-7.4.2
Registering iconv-0.4.1.0...

I need to pass the command line arguments to make it work:

marcot@ioiozinho:Mon Jul 30 10:15:46:~$ cabal install --enable-documentation --enable-library-profiling --reinstall iconv
Resolving dependencies...
Configuring iconv-0.4.1.0...
Preprocessing library iconv-0.4.1.0...
Building iconv-0.4.1.0...
[1 of 2] Compiling Codec.Text.IConv.Internal ( Codec/Text/IConv/Internal.hs, dist/build/Codec/Text/IConv/Internal.o )

Codec/Text/IConv/Internal.hs:46:1:
Warning: In the use of `unsafePerformIO'
(imported from Foreign):
Deprecated: "Use System.IO.Unsafe.unsafePerformIO instead; This function will be removed in the next release"
[2 of 2] Compiling Codec.Text.IConv ( Codec/Text/IConv.hs, dist/build/Codec/Text/IConv.o )
[1 of 2] Compiling Codec.Text.IConv.Internal ( Codec/Text/IConv/Internal.hs, dist/build/Codec/Text/IConv/Internal.p_o )

Codec/Text/IConv/Internal.hs:46:1:
Warning: In the use of `unsafePerformIO'
(imported from Foreign):
Deprecated: "Use System.IO.Unsafe.unsafePerformIO instead; This function will be removed in the next release"
[2 of 2] Compiling Codec.Text.IConv ( Codec/Text/IConv.hs, dist/build/Codec/Text/IConv.p_o )
Registering iconv-0.4.1.0...
Running Haddock for iconv-0.4.1.0...
Preprocessing library iconv-0.4.1.0...
Warning: The documentation for the following packages are not installed. No
links will be generated to these packages: rts-1.0
Haddock coverage:

dist/build/tmp23353/Codec/Text/IConv/Internal.hs:46:1:
Warning: In the use of `unsafePerformIO'
(imported from Foreign):
Deprecated: "Use System.IO.Unsafe.unsafePerformIO instead; This function will be removed in the next release"
31% ( 8 / 26) in 'Codec.Text.IConv.Internal'
79% ( 11 / 14) in 'Codec.Text.IConv'
Warning: Codec.Text.IConv: could not find link destinations for:
Codec.Text.IConv.tmpChunkSize
Documentation created: dist/doc/html/iconv/index.html
Installing library in /home/marcot/.cabal/lib/iconv-0.4.1.0/ghc-7.4.2
Registering iconv-0.4.1.0...
Updating documentation index /home/marcot/.cabal/share/doc/index.html

The file is being read, as can be checked by strace:

marcot@ioiozinho:Mon Jul 30 10:17:39:~$ strace cabal install --reinstall iconv 2>&1 | grep /home/marcot/.cabal/config
open("/home/marcot/.cabal/config", O_RDONLY|O_NOCTTY|O_NONBLOCK) = 3
marcot@ioiozinho:Mon Jul 30 10:17:47:~$

@manzyuk

Am I correct that the relevant lines in your ~/.cabal/config file begin with --? If so, they are treated as comments.

@ttuegel
Haskell member

Closing this issue, which appears to be user error.

@ttuegel ttuegel closed this Apr 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment