Cabal on Windows, revisited

Isaac Jones ijones at syntaxpolice.org
Tue Nov 2 12:12:53 EST 2004


Graham Klyne <gk at ninebynine.org> writes:

> I'm having another go at Building Cabal for Windows, this time using
> the make utility from mingw.   (HMake doesn't serve, as it's specific
> to compiling Haskell programs.  Mainly, I need to get the
> preprocessing performed for loading into Hugs).

Hi Graham,

I think you're going to continue to have trouble with Hugs for a
while, but I just did some hacking to add more hugs support to Cabal.
If you get the new darcs sources or tarball, you should be able to get
a little further.  I think you'll have more success with GHC on
Windows; I think it's been done before, in fact.

http://www.haskell.org/cabal/code.html

I still can't even get it to bootstrap on my own system with Hugs.  In
case I haven't mentioned this before, I'm not focusing very hard on
Hugs right now, though it does _kinda_ work at this time.  My focus is
on getting an end-to-end solution with GHC before branching out to
platforms and compilers that I don't use much.  If you want to help
with Hugs support, look at the TODO list in the sources, and grep
around for "FIX (HUGS)" comments that'll direct your attention to
things that need it.  I just added those.

One problem is that there's no tool for registering or unregistering
packages with Hugs (HC-PKG), so the hacks that I have in place will
just dump the files into hugs libraries tree directly (using
hugs-package, which doesn't do the same kind of thing as ghc-package).

I really need more hackers on this, and it would be great if you could
grab the darcs tree and start to submit patches when you see problems.
I'll be more than happy to work with you to get this running on your
system.

> 1. The "mkdir -p" command fails:  under Windows, the syntax of this
>    command is different.   I realize there are many other Unix shell
>    commands that just wont work in a make file under Windows, so I'm
>    going to proceed to create a Windows-specific makefile for Hugs.

Can you send me this file either as a darcs patch or as an attachment
in private mail?

> 2. I've replaced the GHC invocations with cpphs, rather like the
>    makefile target for creating documentation.

This shouldn't actually be necessary now, since hugs-package does this
step.  Do you have hugs-package on your platform?

> 5. At this point, using a batch file to run Setup, I can issue the
>    command Setup --help:

Well, that's something!

(snip)
> Cannot find compiler for hugs
> make: *** [config] Error 1
>
> E:\HaskellTools\cabal>
> ]]
>
> I guess this is because of my unusual Hugs setup:

Yep.

> configure: looking for package tool: hugs-package near compiler in RunHaskell
> Cannot find package tool: ./hugs-package
> make: *** [config] Error 1
>
(snip)
> OK, it seems to need the actual Hugs executable to find the proper
> path, so I'll have to make that available and try again:
> [[
> E:\HaskellTools\cabal>C:\DEV\Hugs98\runhugs-20040109.exe
> dist\tmp\Setup.lhs conf
> igure --hugs --with-compiler C:\DEV\Hugs98\Hugs.exe --prefix E:\Temp\Cabal
> Configuring Cabal-0.1...
> configure: looking for package tool: hugs-package near compiler in
> C:DEVHugs98Hu
> gs.exe
> Cannot find package tool: ./hugs-package
> make: *** [config] Error 1

It's looking for the hugs-package tool.  You can tell it where to find
it with the "--with-hc-pkg" option, just like you did for hugs itself
above.

> E:\HaskellTools\cabal>
> ]]
>
> I note the '\' in the filename are being processed incorrectly again.
> Also, it still can't find the package tool ./hugs-package.

Hmm. Can you run the test suite in the Utils module?  You should be
able to preprocess that and load it pretty easily.  Running the test
suite will require HUnit.

> That's about as far as I'm going to get here.  My makefile so far is:

Thanks for messing with this.  I hope that other windows users will be
able to offer you more help with some of this stuff than I can.


peace,

  isaac


More information about the Libraries mailing list