hasLibs and hasExes honest reporting?
Yaakov Nemoy
loupgaroublond at gmail.com
Wed Apr 30 15:32:03 EDT 2008
On Wed, Apr 30, 2008 at 4:04 AM, Duncan Coutts
<duncan.coutts at worc.ox.ac.uk> wrote:
>
> On Tue, 2008-04-29 at 17:59 -0400, Yaakov Nemoy wrote:
> > Hi List,
> >
> > First off, I want to say hi, as this is my first post. I'm trying to
> > get some badly needed updates to cabal-rpm, so we can get more Haskell
> > packages into Fedora.
>
> Great! :-)
<snip>
> > In the case of xmonad, hasLibs returns True. but returns a nonempty
> > list. hasExes returns True, and with the same nonempty list. I would
> > expect the lists to be the same, as all the Modules listed therein are
> > needed to compile the executable, and also to be linked with the user
> > supplied config file. The only problem I see is with hasLibs itself.
>
> http://hackage.haskell.org/packages/archive/xmonad/0.7/xmonad.cabal
>
> Looking at the xmonad.cabal file we see that xmonad does contain both a
> library and an executable, so we would expect hasLibs and hasExes to
> return True. The reason the modules returned for both are the same is
> because the list of exposed-modules and other-modules in the
> xmonad.cabal are exactly the same for the lib and for the exe.
Ack, what I meant to say is that hasLibs returns False. I am actually
expecting those two lists to be the same. I've written an alternate
function for hasLibs and withLibs that works on that expectation, but
it's specific to cabal-rpm. I haven't tested it because of another
bug I've come across, that I need to talk to Brian O'Sullivan about.
I may bug you guys on this list again though, but it's a separate
issue.
> > I heard something a while back that xmonad needs to be compiled twice,
> > because this setup is considered an edge case in Cabal. Because
> > xmonad is the reason why I'm working on getting Haskell packages into
> > Fedora, I'm not sure I want to think of it that way. Is this a bug,
> > or just a 'feature' I need to watch out for?
>
> What they meant is that it is not currently possible to make a package
> with a library and an executable where the executable links against the
> library, instead it must compile the same modules that are in the
> library itself. So that's what people mean by having to compile things
> twice.
>
> If/when it becomes possible we'd write something like:
<snip>
> So in summary: there is no bug. xmonad really does contain a library and
> an executable. The only limitation is that a few modules get compiled
> twice rather than once.
So in all likelihood this issue has little to do with the bug I'm
reporting here. Glad that at least is not in the way.
More information about the cabal-devel
mailing list