
On Wed, Jan 28, 2009 at 11:42:39PM +0000, Duncan Coutts wrote:
I'm not sure how it was ever supposed to work, that is bootstrapping Cabal directly using runhugs on the Setup.hs script in the Cabal dir. Cabal has always had some cpp in it and (as far as I know) hugs does not have a -cpp flag. I presume the hugs build system has some workaround to cpp all the files first.
Hugs uses cpphs, but it has to build a dozen packages (including Cabal) before cpphs is available. Once it is, they're built again.
The way I've tested it recently is to build the Setup.hs with ghc and use that to install Cabal for hugs. From then on one can use runhugs to run other Setup scripts.
Yes, you just need to remember the --hugs flag, and Cabal defaults to the compiler that built it.
If you can get the search path right (ie to not look in the current dir) then I expect it would also be possible to bootstrap using a pre-existing Cabal library for hugs.
Unfortunately that won't work: runhugs always adds the directory containing the Main module to its search path for modules imported by Main, so that multi-module programs work. This will be a problem for upgrading Cabal (only, I think). For the original build, the Hugs build system copies Setup.hs of each package into another directory, so that it can be run with runhugs without picking up local modules.