Main-Is not creating executable

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Tue Jan 20 19:11:37 EST 2009


On Tue, 2009-01-20 at 20:30 +0000, Alistair Bayley wrote:
> 2009/1/20 Alistair Bayley <alistair at abayley.org>:
> > I have this in Takusen.cabal:
> >
> > Executable miniunit_tests
> >  Main-Is: Test/MiniUnit/Main.hs
> >  Build-Depends:  base, mtl
> >  Extensions: CPP
> >  CPP-Options: "-DNEW_EXCEPTION"
> >
> > (as well as the Library section). When it builds, the modules compile
> > fine, but then I get:
> >
> > Warning: output was redirected with -o, but no output will be
> > generated because there is no Main module.
> 
> 
> My fault. Turns out the module in Test/MiniUnit/Main.hs must be just
> Main, not Test.MiniUnit.Main i.e.
> module Main where...

Right. See http://hackage.haskell.org/trac/hackage/ticket/179

> But the second question still stands: can I selectively build the
> various targets in the .cabal file?

Not yet, sorry.

This is something that we will be able to do easily with the Cabal-2.x
features, though we may well be able to do it before then, at least for
"big" targets like executables and libs.

So it's worth filing a feature request ticket. I usually ask for
suggestions for the user interaction but in this case the obvious seems
to be:

cabal build miniunit_tests

Btw, what you really want here is proper support for testsuites, rather
than executable:
http://hackage.haskell.org/trac/hackage/ticket/215


Duncan



More information about the cabal-devel mailing list