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

Configuring now always takes an insane amount of memory #4589

Closed
leftaroundabout opened this issue Jul 6, 2017 · 10 comments
Closed

Configuring now always takes an insane amount of memory #4589

leftaroundabout opened this issue Jul 6, 2017 · 10 comments

Comments

@leftaroundabout
Copy link

leftaroundabout commented Jul 6, 2017

After installing the HEAD version of Cabal (8315dbf), it has become practically unusable because any configure (or new-configure) allocates about 11 GiB of memory, which is quite enough to drive my laptop hopelessly into swap.

cabal-install apparently does this before even doing any of the actual configuration work, because when there's a syntax error in the .cabal file, I only get an error after the memory load is down again.

I thought it might have something to do with old cruft in my ~/.cabal, but even completely removing that and setting up from scratch didn't change anything. Nor did it help to remove everything in /tmp.

System info: Ubuntu 16.04, ghc-8.3.20170622.

@23Skidoo
Copy link
Member

23Skidoo commented Jul 6, 2017

This doesn't affect 2.0, right?

@23Skidoo
Copy link
Member

23Skidoo commented Jul 6, 2017

I wonder why Travis didn't catch this. Can this have something to do with the fact that you're using GHC HEAD?

@23Skidoo
Copy link
Member

23Skidoo commented Jul 6, 2017

@leftaroundabout Does this happen with all packages or only with your project? Can you post repro instructions?

@leftaroundabout
Copy link
Author

leftaroundabout commented Jul 6, 2017

The issue happens with all packages (even a module Main where main = return () dummy).

Same problem with a cabal-install-2.0.0.0 I've just built (using that same GHC-HEAD compiler), so it looks a lot like it has something to do with either GHC-HEAD or my local configuration. Will try compiling cabal-install with another compiler now...

@leftaroundabout
Copy link
Author

leftaroundabout commented Jul 6, 2017

Ok, when cabal-install is built with ghc-8.0.1, the problem is gone.

[21:24:19]sagemuej@sagemuej-X302LA:/tmp/cbt  # a basically empty dummy package
$ /home/sagemuej/local/progwrit/haskell/notmine/haskell/cabal/.stack-work/install/x86_64-linux/ghc-8.0.1/8.0.1/bin/cabal configure -v3
no user package environment file found at /tmp/cbt
Searching for ghc in path.
Found ghc at /usr/local/bin/ghc
/usr/local/bin/ghc --numeric-version
/usr/local/bin/ghc is version 8.3.20170622
looking for tool ghc-pkg near compiler in /usr/local/bin
candidate locations:
["/usr/local/bin/ghc-pkg","/usr/local/bin/ghc-pkg-ghc-8.3.20170622","/usr/local/bin/ghc-pkg-8.3.20170622","/usr/local/bin/ghc-pkg"]
found ghc-pkg in /usr/local/bin/ghc-pkg
/usr/local/bin/ghc-pkg --version
/usr/local/bin/ghc-pkg is version 8.3.20170622
/usr/local/bin/ghc --supported-languages
/usr/local/bin/ghc --info
creating dist
Reading installed packages...
/usr/local/bin/ghc-pkg dump --global -v0
/usr/local/bin/ghc-pkg dump --user -v0
/usr/local/bin/ghc --print-libdir
Reading available packages...
index-state(hackage.haskell.org) = 2017-07-06T13:22:11Z
Searching for pkg-config in path.
Found pkg-config at /usr/bin/pkg-config
/usr/bin/pkg-config --version
/usr/bin/pkg-config is version 0.29.1
/usr/bin/pkg-config --list-all
...   # finishes everything just fine without consuming significant memory

Whereas with the GHC-HEAD-built version of the same cabal-install-2.0.0.0,

[21:24:32]sagemuej@sagemuej-X302LA:/tmp/cbt
$ cabal configure -v3
no user package environment file found at /tmp/cbt
Searching for ghc in path.
Found ghc at /usr/local/bin/ghc
/usr/local/bin/ghc --numeric-version
/usr/local/bin/ghc is version 8.3.20170622
looking for tool ghc-pkg near compiler in /usr/local/bin
candidate locations:
["/usr/local/bin/ghc-pkg","/usr/local/bin/ghc-pkg-ghc-8.3.20170622","/usr/local/bin/ghc-pkg-8.3.20170622","/usr/local/bin/ghc-pkg"]
found ghc-pkg in /usr/local/bin/ghc-pkg
/usr/local/bin/ghc-pkg --version
/usr/local/bin/ghc-pkg is version 8.3.20170622
/usr/local/bin/ghc --supported-languages
/usr/local/bin/ghc --info
creating dist
Reading installed packages...
/usr/local/bin/ghc-pkg dump --global -v0
/usr/local/bin/ghc-pkg dump --user -v0
/usr/local/bin/ghc --print-libdir
Reading available packages...
^C  # at this point, memory goes through the roof

@23Skidoo
Copy link
Member

23Skidoo commented Jul 6, 2017

OK, I think we should now report this to GHC devs. BTW, can you try with GHC 8.2 HEAD?

@bgamari
Copy link
Contributor

bgamari commented Jul 7, 2017

For the record, I have opened GHC bug #13930 to track this issue. It doesn't appear to affect ghc-8.2. Unfortunately I'm having trouble bisecting it due to #4509.

@23Skidoo
Copy link
Member

23Skidoo commented Jul 7, 2017

Closing in favour of GHC bug #13930.

@23Skidoo 23Skidoo closed this as completed Jul 7, 2017
@hvr
Copy link
Member

hvr commented Jul 7, 2017

@bgamari how are you building cabal? are recompiling latest lib:Cabal or using the prebuilt one included in your GHC 8.2 snapshot? I had the impression that #4509 was merely a result compiling a new exe:cabal against an too old lib:Cabal...

@bgamari
Copy link
Contributor

bgamari commented Jul 7, 2017

I'm using a cabal-install and Cabal both from the current v2.0 branch.

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