a cabal package with both a library and executable programs

Hi. This example is taken from the Cabal documentation: Name: TestPackage ... Library Build-Depends: HUnit Exposed-Modules: A, B, C Executable program1 Main-Is: Main.hs Hs-Source-Dirs: prog1 Other-Modules: A, B Executable program2 Main-Is: Main.hs Hs-Source-Dirs: prog2 Other-Modules: A, C, Utils Here I see a small problem. Why should I explicitly declare modules from the library that are used in the executables? I would like to do, instead ... Executable program1 Main-Is: Main.hs Hs-Source-Dirs: prog1 build-depends: TestPackage Executable program2 Main-Is: Main.hs Hs-Source-Dirs: prog2 build-depends: TestPackag Other-Modules: Utils I tried this, but configuration fails, since Cabal does not find the TestPackage. It is true that it does not yet exists, but we are going to build it! Should I fill a feature request ticket, or this is how it is supposed to work? Thanks Manlio

Manlio Perillo
Should I fill a feature request ticket, or this is how it is supposed to work?
I would like to be able to do that, too. I also don't want cabal to recompile a thousand modules just for a demo program, and don't want to see hackage being polluted by thousands of foo-lib and foo-bin packages to circumvent the current behaviour, either. That is, feel yourself seconded. -- (c) this sig last receiving data processing entity. Inspect headers for copyright history. All rights reserved. Copying, hiring, renting, performance and/or quoting of this signature prohibited.

On Wed, 2009-03-25 at 15:19 +0100, Achim Schneider wrote:
Manlio Perillo
wrote: Should I fill a feature request ticket, or this is how it is supposed to work?
I would like to be able to do that, too. I also don't want cabal to recompile a thousand modules just for a demo program, and don't want to see hackage being polluted by thousands of foo-lib and foo-bin packages to circumvent the current behaviour, either.
That is, feel yourself seconded.
The existing ticket for this feature request is: http://hackage.haskell.org/trac/hackage/ticket/89 The plan is to allow the executables to build-depend on the library. Duncan
participants (3)
-
Achim Schneider
-
Duncan Coutts
-
Manlio Perillo