Opened 8 years ago

Closed 8 years ago

Last modified 15 months ago

#5579 closed bug (fixed)

alex and happy found during ./configure not used

Reported by: kolmodin Owned by: igloo
Priority: normal Milestone: 7.4.1
Component: Build System (make) Version: 7.3
Keywords: make alex happy Cc:
Operating System: Linux Architecture: Unknown/Multiple
Type of failure: Building GHC failed Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


This is with HEAD as of 2011-10-24. 0d6529f669104b6f22049d456a9600d949a09018

Looks like the alex and happy executables found during ./configure are not used when compiling libraries in stage 1.

kolmodin@kolmodin:~/code/ghc$ time PATH=/home/kolmodin/.cabal/bin:$PATH ./configure --prefix=/home/kolmodin/usr --with-ghc=/usr/bin/ghc
Configure completed successfully.

   Building GHC version  : 7.3.20111024

   Build platform        : x86_64-unknown-linux
   Host platform         : x86_64-unknown-linux
   Target platform       : x86_64-unknown-linux

   Bootstrapping using   : /usr/bin/ghc
      which is version   : 6.12.1

   Using GCC             : /usr/bin/gcc
      which is version   : 4.4.3

   ld       : /usr/bin/ld
   Happy    : /home/kolmodin/.cabal/bin/happy (1.18.6)
   Alex     : /home/kolmodin/.cabal/bin/alex (3.0.1)
   Python   : /usr/bin/python
   Perl     : /usr/bin/perl
   dblatex  : 
   xsltproc : /usr/bin/xsltproc

   HsColour was not found; documentation will not contain source links

   Building DocBook HTML documentation : NO
   Building DocBook PS documentation   : NO
   Building DocBook PDF documentation  : NO

When building;

kolmodin@kolmodin:~/code/ghc$ make
===--- building phase 0
make -r --no-print-directory -f phase=0 phase_0_builds
make[1]: Nothing to be done for `phase_0_builds'.
===--- building phase 1
make -r --no-print-directory -f phase=1 phase_1_builds
"inplace/bin/ghc-cabal" configure --with-ghc="/home/kolmodin/code/ghc/inplace/bin/ghc-stage1" --with-ghc-pkg="/home/kolmodin/code/ghc/inplace/bin/ghc-pkg" --flag in-ghc-tree --enable-library-profiling --enable-shared --enable-library-for-ghci --configure-option=CFLAGS=" -fno-stack-protector  " --configure-option=LDFLAGS="   " --configure-option=CPPFLAGS="   " --with-gcc="/usr/bin/gcc" --configure-option=--with-cc="/usr/bin/gcc" --with-ar="/usr/bin/ar" --with-ranlib="true" -- dist utils/haddock
Configuring haddock-2.9.4...
ghc-cabal: The program alex version >=2.3 is required but the version found at
/usr/bin/alex is version 2.2
make[1]: *** [utils/haddock/dist/] Error 1
make: *** [all] Error 2

Note that it tried to use /usr/bin/alex while ./configure had found /home/kolmodin/.cabal/bin/alex.

Change History (3)

comment:1 Changed 8 years ago by igloo

Milestone: 7.4.1
Owner: set to igloo

Thanks for the report; I'll take a look.

comment:2 Changed 8 years ago by igloo

difficulty: Unknown
Resolution: fixed
Status: newclosed

Fixed by:

commit 2a54a0d622a4fa4b62accb2537eb4fc7736d6bb4

Author: Ian Lynagh <>
Date:   Sat Jan 28 23:33:11 2012 +0000

    Pass alex and happy locations to ghc-cabal; fixes #5579

    We only use --with-alex / --with-happy if we know where alex / happy
    are. In particular, we don't need them when building from a source

comment:3 Changed 15 months ago by bgamari

Component: Build SystemBuild System (make)

The new Hadrian build system has been merged. Relabeling the tickets concerning the legacy make build system to prevent confusion.

Note: See TracTickets for help on using tickets.