Issue installing Happy

cabal, haskell

Solution

I had this problem once, and in my case it was a version problem.... I had a version of happy that came with the OS (at /usr/bin/happy), but the cabal version was at ~/.cabal/bin/happy.

By the comments in the error message, this might be (is probably?) your problem also.

Check your PATH variable and see if it points to the correct happy.

Problem

I'm trying to install Fay. Fay has a dependency on `pretty-show`, so I'm installing that. When I run `cabal install pretty-show`, I get the following error: ``` Resolving dependencies... Configuring pretty-show-1.6.2... cabal: The program happy version >=1.19 is required but the version found at /usr/bin/happy is version 1.18.10 Failed to install pretty-show-1.6.2 cabal: Error: some packages failed to install: pretty-show-1.6.2 failed during the configure step. The exception was: ExitFailure 1 ``` When I try to run `cabal install happy`, it says it's successful: ``` Resolving dependencies... [1 of 1] Compiling Main ( /var/folders/d1/h6lvlvnd0j18lf3ml2rn11dm0000gq/T/happy-1.19.2-89313/happy-1.19.2/Setup.lhs, /var/folders/d1/h6lvlvnd0j18lf3ml2rn11dm0000gq/T/happy-1.19.2-89313/happy-1.19.2/dist/setup/Main.o ) Linking /var/folders/d1/h6lvlvnd0j18lf3ml2rn11dm0000gq/T/happy-1.19.2-89313/happy-1.19.2/dist/setup/setup ... Configuring happy-1.19.2... Building happy-1.19.2... Preprocessing executable 'happy' for happy-1.19.2... [ 1 of 18] Compiling NameSet ( src/NameSet.hs, dist/build/happy/happy-tmp/NameSet.o ) [ 2 of 18] Compiling Target ( src/Target.lhs, dist/build/happy/happy-tmp/Target.o ) [ 3 of 18] Compiling AbsSyn ( src/AbsSyn.lhs, dist/build/happy/happy-tmp/AbsSyn.o ) [ 4 of 18] Compiling ParamRules ( src/ParamRules.hs, dist/build/happy/happy-tmp/ParamRules.o ) [ 5 of 18] Compiling GenUtils ( src/GenUtils.lhs, dist/build/happy/happy-tmp/GenUtils.o ) [ 6 of 18] Compiling ParseMonad ( src/ParseMonad.lhs, dist/build/happy/happy-tmp/ParseMonad.o ) [ 7 of 18] Compiling Lexer ( src/Lexer.lhs, dist/build/happy/happy-tmp/Lexer.o ) [ 8 of 18] Compiling Parser ( dist/build/happy/happy-tmp/Parser.hs, dist/build/happy/happy-tmp/Parser.o ) [ 9 of 18] Compiling AttrGrammar ( src/AttrGrammar.lhs, dist/build/happy/happy-tmp/AttrGrammar.o ) [10 of 18] Compiling AttrGrammarParser ( dist/build/happy/happy-tmp/AttrGrammarParser.hs, dist/build/happy/happy-tmp/AttrGrammarParser.o ) [11 of 18] Compiling Grammar ( src/Grammar.lhs, dist/build/happy/happy-tmp/Grammar.o ) [12 of 18] Compiling First ( src/First.lhs, dist/build/happy/happy-tmp/First.o ) [13 of 18] Compiling LALR ( src/LALR.lhs, dist/build/happy/happy-tmp/LALR.o ) [14 of 18] Compiling Paths_happy ( dist/build/autogen/Paths_happy.hs, dist/build/happy/happy-tmp/Paths_happy.o ) [15 of 18] Compiling ProduceCode ( src/ProduceCode.lhs, dist/build/happy/happy-tmp/ProduceCode.o ) [16 of 18] Compiling ProduceGLRCode ( src/ProduceGLRCode.lhs, dist/build/happy/happy-tmp/ProduceGLRCode.o ) [17 of 18] Compiling Info ( src/Info.lhs, dist/build/happy/happy-tmp/Info.o ) [18 of 18] Compiling Main ( src/Main.lhs, dist/build/happy/happy-tmp/Main.o ) Linking dist/build/happy/happy ... Warning: No documentation was generated as this package does not contain a library. Perhaps you want to use the --executables flag. Installing executable(s) in /Users/buck2/Library/Haskell/ghc-7.6.3/lib/happy-1.19.2/bin Installed happy-1.19.2 Updating documentation index /Users/buck2/Library/Haskell/doc/index.html ``` But then when I call `cabal info happy`, it says this, which I assume means that it's not installed: ``` Bucks-MacBook-Pro:~ buck2$ cabal info happy * happy (program) Synopsis: Happy is a parser generator for Haskell Versions available: 1.16, 1.17, 1.18.8, 1.18.9, 1.18.10, 1.18.11, 1.19.0, 1.19.1, 1.19.2 (and 7 others) Versions installed: [ Unknown ] Homepage: http://www.haskell.org/happy/ Bug reports: https://github.com/simonmar/happy/issues Description: Happy is a parser generator for Haskell. Given a grammar specification in BNF, Happy generates Haskell code to parse the grammar. Happy works in a similar way to the @yacc@ tool for C. Category: Development License: BSD3 Author: Andy Gill and Simon Marlow Maintainer: Simon Marlow <marlowsd@gmail.com> Source repo: http://github.com/simonmar/happy.git Executables: happy Flags: small_base Dependencies: base >=1.0 && <2.1, containers -any, array -any, base >=2.1, mtl >=1.0, base <5, process -any, base -any Cached: Yes ``` Any ideas why I'd be getting this issue? I'm running OS X Mavericks, and I just reinstalled the Haskell platform today.

Original source