"cabal install happy" causes memory overflow. (GHC 7.8.2)
Asked Answered
C

1

6

I've been trying to get happy to install correctly for the past couple days, and while I found it challenging to get cabal install happy to not just error (by installing happy-1.19 with apt-get and adding /opt/happy/1.19.3/bin to PATH), now it runs through the source until it gets to ProduceCode (15/18) and seems to enter an infinite loop. It accumulates memory until either I hit Ctrl+C or power off when the whole system becomes unresponsive.

I think I remember this not being a problem at all with GHC-HEAD, but I don't want to use the head since it seems to update every couple of days, requiring me to constantly rebuild my packages, unless there's a trick I don't know about for migrating from head to head+1.

$ ghc -v
Glasgow Haskell Compiler, Version 7.8.2, stage 2 booted by GHC version 7.4.1
Using binary package database: /opt/ghc/7.8.2/lib/ghc-7.8.2/package.conf.d/package.cache
Using binary package database: /home/house/.ghc/x86_64-linux-7.8.2/package.conf.d/package.cache
package oeis-0.3.5-26e4c8a4e89d20dbd9e2d89ad4774bd0 is unusable due to missing or recursive dependencies:
HTTP-4000.2.12-2793df5d0fb675f1a42bc04cfdf74851
hiding package Cabal-1.18.1.3 to avoid conflict with later version Cabal-1.20.0
hiding package Cabal-1.19.2 to avoid conflict with later version Cabal-1.20.0
wired-in package ghc-prim mapped to ghc-prim-0.3.1.0-948744e1f99cc8bcc7c7d3ba60c7c2d8
wired-in package integer-gmp mapped to integer-gmp-0.5.1.0-dc47f6b546fc171f67a7f7d311684a99
wired-in package base mapped to base-4.7.0.0-018311399e3b6350d5be3a16b144df9b
wired-in package rts mapped to builtin_rts
wired-in package template-haskell mapped to template-haskell-2.9.0.0-dcc8c210fb02937e104bc1784d7b0f06
wired-in package dph-seq not found.
wired-in package dph-par not found.
Hsc static flags: 
*** Deleting temp files:
Deleting: 
*** Deleting temp dirs:
Deleting: 
ghc: no input files
Usage: For basic information, try the `--help' option.

$ cabal --version 
cabal-install version 1.20.0.0
using version 1.20.0 of the Cabal library 
Chellean answered 17/4, 2014 at 16:42 Comment(3)
Are you building with -O2? For me, it works with -O or -O2 -fno-spec-constr, but when I tried building with -O2 I killed ghc after it got up to 4gb RAM.Kela
That was exactly it! I used the line cabal install happy --ghc-options="-fno-spec-constr" and it used almost no memory. Now if only I could remember what happy was a dependency for...Chellean
This might help you: #6952896Michelinemichell
L
2

Community Wiki answer from the comments:

"For me, it works with -O or -O2 -fno-spec-constr, but when I tried building with -O2 I killed ghc after it got up to 4gb RAM"

Ld answered 17/4, 2014 at 16:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.