Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building GHC: configure fails on happy despite successful cabal install

I am attempting to build GHC from source following this page. When installing dependencies, I had to install happy and alex:

$ cabal install alex happy
Resolving dependencies...
Configuring alex-3.2.1...
Configuring happy-1.19.5...
Building happy-1.19.5...
Building alex-3.2.1...
Installed alex-3.2.1
Installed happy-1.19.5

yet when running configure I get an error message:

$ ./configure
...
checking for happy... no
checking for version of happy... 
configure: error: Happy version 1.19.4 or later is required to compile GHC.

I am running on Debian stretch:

$ uname -a 
Linux <host> 4.8.0-1-amd64 #1 SMP Debian 4.8.5-1 (2016-10-28) x86_64 GNU/Linux

Can anyone suggest an obvious step I could try to resolve this?

like image 439
Sven Williamson Avatar asked Jul 05 '17 19:07

Sven Williamson


2 Answers

I suspect you simply don't have them on your PATH. Make sure to include something like

PATH="$HOME/.cabal/bin:$PATH"

in your .bashrc (or startup files for whatever shell you use). Installing them through the package manager simply installed them in a location that was already on your PATH.

Even if you have things working now, you should consider modifying your .bashrc while it's fresh in your head, as other cabal-install'd executables will get put there in the future.

like image 178
Daniel Wagner Avatar answered Dec 19 '22 22:12

Daniel Wagner


You should install alex and happy as Debian packages as well. On a Debian machine, you can use apt-get for that:

sudo apt-get install alex happy
like image 30
Willem Van Onsem Avatar answered Dec 19 '22 21:12

Willem Van Onsem