Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

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

bos opened this issue May 24, 2012 · 4 comments

Comments

@bos
Copy link
Contributor

bos commented May 24, 2012

(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
Copy link
Contributor Author

bos commented May 24, 2012

(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
Copy link

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
Copy link
Contributor

manzyuk commented May 3, 2013

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

@ttuegel
Copy link
Member

ttuegel commented Apr 23, 2015

Closing this issue, which appears to be user error.

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

No branches or pull requests

4 participants