Newbie wants to add DLL creation support

Leon Smith leon.p.smith at gmail.com
Wed Feb 27 16:48:26 CET 2013


I would start by reading and experimenting with the source.   In my
opinion,  cabal and cabal-install are not exactly elegant programs,  but if
you are only interested in a few isolated issues,  they aren't too hard to
reverse-engineer with a little determination and patience.

Oftentimes you know what commands and arguments you wish to run in some
specific case,  but you don't know how to properly construct these paths
and flags and whatnot in generic cabal settings.  I've found it easiest to
modify the source to print the data structures out and examine them for the
information you are seeking.  The "groom" package is very helpful in this
regard,  as it can pretty print these structures for you.   You can then
examine the source to find out how the fields you are interested in are set
and consumed;  usually the control flow is fairly simple in this regard.
 Admittedly it seems like some kind of code smell to have such large
records with the vast majority of fields only used in a handful of
locations,  but it also makes for relatively simple reverse engineering
with modest tools.

Cabal is somewhat easier to work with in this regard than cabal-install,
 because you can just get access to most of the datastructures you want via
callbacks in Setup.hs.   And since they derive Show instances,  you can use
groom.    Unfortunately most of the datatypes that cabal-install uses
didn't derive Show instances,  at least the last time I checked,  but
that's also easy to fix.

Maybe somebody else could offer better, more specific advice.   I've only
toyed with little bits of Cabal hacking,  and most of the time I didn't
feel like the results were worth sharing.   The only bit that I have shared
so far would be this,  which uses the postHaddock hook to copy a png into
the documentation directory:

https://github.com/lpsmith/split-channel/commit/2edf5c652ef642579919a18531bd3a8ad8cf7cee

However I hear rumors that future versions of Cabal might support this
particular use case natively.

Best,
Leon


On Fri, Feb 22, 2013 at 2:33 AM, Edwin <edwinhere at gmail.com> wrote:

> Hi,
>
> I am a newbie to Haskell, and I want to try to add DLL creation support to
> Cabal.
>
> Where do I start?
>
> I have already made a DLL using ghc and and .bat files for use in trading.
> But the process is a bit tedious. The IRC people said, I should try to add
> DLL support into Cabal.
>
> Edwin
>
> _______________________________________________
> cabal-devel mailing list
> cabal-devel at haskell.org
> http://www.haskell.org/mailman/listinfo/cabal-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/cabal-devel/attachments/20130227/2eb9d7f5/attachment.htm>


More information about the cabal-devel mailing list