
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. The ghc command (from setup -v build): Building executable: miniunit_tests... Creating dist\build\miniunit_tests (and its parents) Creating dist\build\miniunit_tests\miniunit_tests-tmp (and its parents) c:\ghc\ghc-6.10.1\bin\ghc.exe -o dist\build\miniunit_tests\miniunit_tests.exe -- make -hide-all-packages -no-user-package-conf -i -idist\build\miniunit_tests\min iunit_tests-tmp -i. -idist\build\autogen -Idist\build\autogen -Idist\build\miniu nit_tests\miniunit_tests-tmp -optP-DNEW_EXCEPTION -optP-include -optPdist\build\ autogen\cabal_macros.h -odir dist\build\miniunit_tests\miniunit_tests-tmp -hidir dist\build\miniunit_tests\miniunit_tests-tmp -stubdir dist\build\miniunit_tests \miniunit_tests-tmp -package QuickCheck-1.2.0.0 -package Takusen-0.8.4 -package base-4.0.0.0 -package mtl-1.1.0.2 -package old-time-1.0.0.1 -package time-1.1.2. 2 -O -XCPP .\Test/MiniUnit/Main.hs I don't see ghc flag -main-is in here. What do I need to do to get it to build the executable? Also, is there a way to get it to just build miniunit_tests.exe i.e. without rebuilding the library and another executable target? Alistair

2009/1/20 Alistair Bayley
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... But the second question still stands: can I selectively build the various targets in the .cabal file? Alistair

On Tue, 2009-01-20 at 20:30 +0000, Alistair Bayley wrote:
2009/1/20 Alistair Bayley
: 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

Duncan Coutts schrieb:
But the second question still stands: can I selectively build the various targets in the .cabal file?
Not yet, sorry.
I use to selectively build executables depending on Cabal flags, where the executable section starts with Executable test If !flag(buildTests) Buildable: False With cabal configure -fbuildTests I enable building them.

From: libraries-bounces@haskell.org [mailto:libraries-bounces@haskell.org] On Behalf Of Henning Thielemann Duncan Coutts schrieb:
But the second question still stands: can I selectively build the various targets in the .cabal file?
Not yet, sorry.
I use to selectively build executables depending on Cabal flags, where the executable section starts with
Executable test If !flag(buildTests) Buildable: False
With cabal configure -fbuildTests I enable building them.
Cool. This morning it occurred to me that flags might be usable for this. Alistair ***************************************************************** Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. *****************************************************************
participants (4)
-
Alistair Bayley
-
Bayley, Alistair
-
Duncan Coutts
-
Henning Thielemann