December 19, 2004

The many dependencies of GHC's build system

GHC continues to amaze me with the number of dependencies it has. I have been building the HEAD nightly (using a set of automated scripts which I wrote) for some time. Mysteriously they started failing on 9 December. Upon inspection it turned out that make was either going into an infinite loop of some kind, or just taking a really long time when invoked in the ghc/compiler directory. Debugging began.

The first thing I tried to see was if the Makefile in the directory had been changed recently in the HEAD. It had, and so I reverted to an earlier version to see if that fixed the problem. No matter how many versions back I reverted to the problem persisted. I finally concluded that make itself might be at fault and proceeded to try a new version. This solved the problem. It seems that version 3.79 of GNU make had a bug. However, 3.79.1 has fixed it.

The most interesting thing is that it doesn't appear that a change to the Makefiles has caused the bug to manifest itself - a mere change in the dependencies between modules in GHC has.

GHC has many dependencies on many tools. Through the miracle of being able to come back to this entry and update it I now list all of the ones I know of:

As of 19 December 2004:


  • alex. Alex version 2.0

  • happy. Happy version 1.14

  • gcc. gcc version 3.3 20030304 (Apple Computer, Inc. build 1495). However, as my preprocesser I'm using gcc3 -E -traditional which I get by setting environment variable CPP.
  • make. Make version 3.79.1