Cabal feedback notes

Isaac Jones ijones at
Fri Oct 22 11:23:23 EDT 2004

Hi Graham.  Thanks for your comments!

Graham Klyne <gk at> writes:

> I'm having a shot at packaging my revision of the HaXml library using
> Cabal, using [1] as reference:
> [1]
> I'm basically stuck at the point of bootstrapping Cabal into my system
> (see point 9 towards the end, below).  I'm proceeding on the basis of
> using Windows and Hugs.  I *could* use GHC, but for non-Haskellers I
> think Hugs represents the easiest path of entry into using Haskell
> software, so I'd like to persist with that.

I haven't worked much with the Hugs code; I'm mostly focusing on an
end-to-end solution with GHC first, then branching out to other
implementations, if no one beats me to them.  If you want to use Hugs,
you'll have to help contribute some code :)

> 1. Section 1.2 example of Setup.description has field Exposed-modules,
> but section 4.1 described field "Modules".  Which is correct?
> [Later, I see both are defined.  The relationship could usefully be
> clarified sooner.]

Eventually, we want to mostly use Exposed-modules and Main-modules (or
whatever), then compute the dependencies to the rest of the modules to
include.  Modules will probably stay around as a backup.  I made a
note to clarify that in the docs.

> 2. At this stage, it's not clear if I should include full hierarchical
> package names, or just list packages relative to the working
> directory.  I'm assuming the latter.

The full hierarchical package name, relative to the hssource
directory.  There are a few examples shipped with the source for what
it's worth. Look under "test".

> 4. Copyright:  this isn't a pure Cabal question:  how does one
> indicate the copyright of a package that have been heavily extended
> like my version of HaXml.  The original Copyright should be respected,
> but there's a lot of new code too.  Can I use multiple Copyright
> fields?

Copyright is a free text string, so you can put whatever you want
here, but there's only one field.  For license, if yours isn't on the
list, then you use (OtherLicense FilePath) to indicate the location of
a license file.

> 5. The Setup.description file doesn't appear to have provision for a
> free-form description of the package.  Suggest 'Description:', e.g.:

Yeah, this should be added, along with a few other fields that are
needed for the "Hackage" infrastructure.

> (A Wiki-like format would be handy here;  now wasn't someone working on that?)

Not that I can recall.

> 6. Description file comments:  is the '--' required to start at column
> 1?  I think this should be 'yes', given the leading-space sensitive
> nature of the header field format.

Yeah, I think so.  I'll make a note to double-check.

> 7. I'm uneasy about the prohibition against completely empty lines in
> the Setup.description file.  I guess this is following RFC2822/MIME,
> right?  I see a mismatch here with my suggested "Description:" field,
> and am not sure which should hold sway.

I think the solution is to use a " ." to indicate an empty line in the

> 8. Setup.lhs.  Following the example in section 1.2, is it intended
> that Hugs will always used to run the installation.

Nope.  For now, the solution is "Execute Setup however you can" in the
future, once someone writes it (hint, hint), we'll use the
"runhaskell" tool which might choose the default compiler /

> For my Windows system, for the time being I've taken the simple
> expedient of placing a file "RunHaskell.bat" in a directory on the
> Path:
> [[
> C:\DEV\Hugs98\runhugs-20040109.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
> ]]
> (There are probably better/neater ways to achieve this goal, but I
> like using batch/script files in this way, as it makes the actual
> location of the actual program files used very transparent.)

I don't know anything about widows batch files, but it would be great
if someone knowledgeable would create the windows version of

> 9. At this point, I get stuck.  How am I supposed to bootstrap Cabal?

Did you read the README?  Cabal comes with a bootstrap makefile.  In
the future, it'll hopefully be distributed with the compilers to make
this easier.

> runhugs: Error occurred
> Reading file "Setup.lhs":
> Reading file ".\Distribution\Simple.hs":
> Parsing
> ERROR ".\Distribution\Simple.hs":52 - Syntax error in module
> definition (unexpec
> ted selector "#ifdef")
> ]]

You're going to have some trouble using Hugs here, since the makefile
doesn't have any hugs target and so there's no preprocessing step.
Theoretically, most if not all of the code is portable, we just need
the makefile rules to do the bootstrapping and such.  It'll be easier
once we figure out how to do preprocessing in cabal itself, so I've
been a little lazy here.

> There seems to be a kind of "Catch-22" problem here:  how to get Cabal
> installed without Cabal first being installed.

Yep.  See above.

> 10. I'll repeat here a comment made on the list.  I think there should
> be an option in the Setup.description file to specify what file
> extensions are to be passed through the hscpp (or whatever) program.

I'm not sure I understand this, I'll have to read back over the list.

> 11. If Cabal does not ship with hscpp for performing all
> preprocessing, I'd suggest having a point of indirection (like
> "runhaskell") so that systems without cpp but with hscpp can be set
> up to invoke this.

In the short-term (at least), I think I'll probably include hscpp with

> I think that's as much as I can usefully do at this stage.  If
> anyone has any further suggestions I'm willing to try them out.

So is ghc a problem for you?  If so, you'll have to hack the makefiles
to get it working with hugs (and send me the patch!!)  If not, then
just switch to ghc, read the README, and you should be set.  Please
let me know how things are working for Windows, send me any patches
you make (preferably with darcs, which is really easy!)

Hopefully that's enough to get you unstuck.



More information about the Libraries mailing list