12 Aug 12:08
Build system idea
From: Simon Marlow <marlowsd <at> gmail.com>
Subject: Build system idea
Newsgroups: gmane.comp.lang.haskell.glasgow.user, gmane.comp.lang.haskell.cvs.ghc
Date: 2008-08-12 10:11:38 GMT
Subject: Build system idea
Newsgroups: gmane.comp.lang.haskell.glasgow.user, gmane.comp.lang.haskell.cvs.ghc
Date: 2008-08-12 10:11:38 GMT
Simon PJ and I had a talk about the build system earlier today, I thought I'd float the idea we discussed (I should admit that the idea was mine, lest Simon PJ think I'm attributing bad ideas to him(Continue reading). This is not completely thought through, but I'm pretty sure a solution exists along these lines that would improve things for us. Ok, the starting point is this: - Cabal has code to generate Makefiles. Almost nobody uses it except for the GHC build system. It essentially duplicates the build system for compiling Haskell source (but not for installation, haddocking, registration, configuration, etc.) - Cabal is a library I propose we do this: - Extract the code from Cabal that generates Makefiles, and treat it as part of the GHC build system. Rather than generating a Makefile complete with build rules, we generate a Makefile that just has the package-specific metadata (list of modules, etc.), and put the code to actually build the package in the GHC build system. This means we still get to use 'make', we still get to use the .cabal files as metadata, but the build system is more private to GHC, more extensible, and hopefully more understandable and modifiable. We can express dependencies that Cabal currently doesn't know about. It would let us avoid the current uncomfortable situation where we have to feed all kinds of configuration information from the GHC build system into Cabal - Cabal would be essentially just a mechanism for translating the .cabal file into
. This is not
completely thought through, but I'm pretty sure a solution exists along
these lines that would improve things for us.
Ok, the starting point is this:
- Cabal has code to generate Makefiles. Almost nobody uses it except
for the GHC build system. It essentially duplicates the build system
for compiling Haskell source (but not for installation, haddocking,
registration, configuration, etc.)
- Cabal is a library
I propose we do this:
- Extract the code from Cabal that generates Makefiles, and treat it as
part of the GHC build system. Rather than generating a Makefile
complete with build rules, we generate a Makefile that just
has the package-specific metadata (list of modules, etc.), and put
the code to actually build the package in the GHC build system.
This means we still get to use 'make', we still get to use the .cabal files
as metadata, but the build system is more private to GHC, more extensible,
and hopefully more understandable and modifiable. We can express
dependencies that Cabal currently doesn't know about. It would let us
avoid the current uncomfortable situation where we have to feed all kinds
of configuration information from the GHC build system into Cabal - Cabal
would be essentially just a mechanism for translating the .cabal file into