Cabal on Windows, revisited

Graham Klyne GK at ninebynine.org
Wed Nov 3 04:32:55 EST 2004


Isaac,

I'll do what I can as and when time and other involvements 
permit.  Meanwhile I was trying to provide what I hope was some 
constructive feedback, at this stage being mainly with respect to 
identifying aspects of Hugs that may require different treatment.  I feel 
that before I can seriously make patches to the code repository, I need to 
get a better overall handle on how the Cabal pieces fit together (which I'm 
slowly getting, I think).

You asked for:
> > 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?

Did you notice I included my makefile bits so far at the end of my previous 
message?  For ease of reference, I include it again, below.  Note that 
directories need to be edited for this to work.

Keep up the good work!

#g
--

[[
PREF=E:\Temp\Cabal
CPPHS=RunHaskell ..\cpphs\cpphs.hs --noline
HUGS=C:\DEV\Hugs98\Hugs.exe

# build the library itself:  for Hugs, this is simply preprocessing into a 
new directory

dist/tmp/Setup.lhs:
         mkdir dist\tmp\Distribution\Simple
         mkdir dist\tmp\Compat
         copy Setup.lhs dist\tmp\Setup.lhs
         $(CPPHS) Distribution/Package.hs > dist/tmp/Distribution/Package.hs
         $(CPPHS) Distribution/Misc.hs > dist/tmp/Distribution/Misc.hs
         $(CPPHS) Distribution/Version.hs > dist/tmp/Distribution/Version.hs
         $(CPPHS) Distribution/Setup.hs > dist/tmp/Distribution/Setup.hs
         $(CPPHS) Distribution/ModuleTest.hs > 
dist/tmp/Distribution/ModuleTest.hs
         $(CPPHS) Distribution/Simple.hs > dist/tmp/Distribution/Simple.hs
         $(CPPHS) Distribution/Make.hs > dist/tmp/Distribution/Make.hs
         $(CPPHS) Distribution/InstalledPackageInfo.hs > 
dist/tmp/Distribution/InstalledPackageInfo.hs
         $(CPPHS) Distribution/Simple/Build.hs > 
dist/tmp/Distribution/Simple/Build.hs
         $(CPPHS) Distribution/Simple/Install.hs > 
dist/tmp/Distribution/Simple/Install.hs
         $(CPPHS) Distribution/Simple/Configure.hs > 
dist/tmp/Distribution/Simple/Configure.hs
         $(CPPHS) Distribution/Simple/Register.hs > 
dist/tmp/Distribution/Simple/Register.hs
         $(CPPHS) Distribution/Simple/Utils.hs > 
dist/tmp/Distribution/Simple/Utils.hs
         $(CPPHS) Distribution/Simple/SrcDist.hs > 
dist/tmp/Distribution/Simple/SrcDist.hs
         $(CPPHS) Distribution/Simple/GHCPackageConfig.hs > 
dist/tmp/Distribution/Simple/GHCPackageConfig.hs
         $(CPPHS) Distribution/GetOpt.hs > dist/tmp/Distribution/GetOpt.hs
         $(CPPHS) Compat/Exception.hs > dist/tmp/Compat/Exception.hs
         $(CPPHS) Compat/H98.hs > dist/tmp/Compat/H98.hs
         $(CPPHS) Compat/RawSystem.hs > dist/tmp/Compat/RawSystem.hs
         $(CPPHS) Compat/ReadP.hs > dist/tmp/Compat/ReadP.hs

setup-hugs: dist/tmp/Setup.lhs

setup: setup-hugs

config: setup
         .\Setup configure --hugs --with-compiler=$(HUGS) --prefix=$(PREF)
]]

My Setup.bat file is:
[[
rem run setup program for installing cabal
rem assumes that RunHaskell utility or batch file is on the path

RunHaskell dist\tmp\Setup.lhs %1 %2 %3 %4 %5 %6 %7 %8
]]

My RunHaskell.bat file is:
[[
C:\DEV\Hugs98\runhugs-20040109.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
]]
(As I mentioned, I'm using a modified version of RunHugs, hence the unusual 
filename.)



At 09:12 02/11/04 -0800, Isaac Jones wrote:
>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
>_______________________________________________
>Libraries mailing list
>Libraries at haskell.org
>http://www.haskell.org/mailman/listinfo/libraries

------------
Graham Klyne
For email:
http://www.ninebynine.org/#Contact



More information about the Libraries mailing list