cabal executable using local hsc modules

Andreas Voellmy andreas.voellmy at gmail.com
Mon Mar 25 18:11:24 CET 2013


Sure, I can do that, but then I get:

$ cabal install --disable-library-profiling
Resolving dependencies...
Configuring foo-1.0...
cabal: The field 'build-depends: foo' refers to a library which is defined
within the same package. To use this feature the package must specify at
least
'cabal-version: >= 1.8'.
Failed to install foo-1.0
cabal: Error: some packages failed to install:
foo-1.0 failed during the configure step. The exception was:
ExitFailure 1

Maybe I could try with cabal-version >= 1.8, but this doesn't seem like it
should be necessary. I wouldn't need this build-depends: foo if A were just
A.hs, right? So it seems odd (from a user's standpoint) that I need it when
it is A.hsc.


On Mon, Mar 25, 2013 at 1:01 PM, Henning Thielemann <
lemming at henning-thielemann.de> wrote:

>
> On Mon, 25 Mar 2013, Andreas Voellmy wrote:
>
>  > This should work since Cabal-1.14. Can you show, how exactly you added
>> > the dependency to the executable?
>>
>> I included the two source files, A.hsc and B.hs, and the cabal file in my
>> last email. That shows how I add
>> the dependency in the executable section. I have those three files in a
>> single directory.
>>
>
> Your Cabal file does not contain a dependency in the library for the
> executable. It would look like this:
>
>
> executable B
>  main-is: B.hs
>  build-depends: foo
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20130325/db27f6e7/attachment.htm>


More information about the Libraries mailing list