Cabal feedback notes
Graham Klyne
gk at ninebynine.org
Fri Oct 22 10:59:37 EDT 2004
I'm having a shot at packaging my revision of the HaXml library using
Cabal, using [1] as reference:
[1] http://www.haskell.org/libraryInfrastructure/proposal/index.html
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.
...
There are some random notes jotted down as I progress.
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.]
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.
3. I've collected my list of exported modules by copying imports statements
from the unit test program.
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?
5. The Setup.description file doesn't appear to have provision for a
free-form description of the package. Suggest 'Description:', e.g.:
[[
Description:
This HaXml-I package is a derivative of the HaXml package
maintained by Malcolm Wallace, with a number of enhancements:
- support for XML namespaces, xml:lang and xml:base
- passes a significant number of W3C conformance tests
- support for Unicode UTF-8 and UTF-16 character encodings
- redesigned external entity support, including support for
HTTP access to external entities.
]]
(A Wiki-like format would be handy here; now wasn't someone working on that?)
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.
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.
8. Setup.lhs. Following the example in section 1.2, is it intended that
Hugs will always used to run the installation. I.e. Hugs must be
installed? I like the runhaskell idea better. I guess we just need to
work through this to figure out how things work in the various environments.
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.)
9. At this point, I get stuck. How am I supposed to bootstrap Cabal?
I tried unzipping the Cabal distribution, switching to the Cabal directory,
then:
[[
K:\>cd K:\DEVKIT\Haskell\Cabal\cabal
K:\DEVKIT\Haskell\Cabal\cabal>runhaskell Setup.lhs
K:\DEVKIT\Haskell\Cabal\cabal>C:\DEV\Hugs98\runhugs-20040109.exe Setup.lhs
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")
]]
There seems to be a kind of "Catch-22" problem here: how to get Cabal
installed without Cabal first being installed.
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.
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.
...
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.
#g
------------
Graham Klyne
For email:
http://www.ninebynine.org/#Contact
More information about the Libraries
mailing list