Cabal problems with an executable containing c-sources

Hello The following case seems to be broken: Name: tt Version: 0.0 License: BSD3 Executable: tt Main-Is: test.hs C-Sources: a.c Extensions: ForeignFunctionInterface a.c is completely ignored by Cabal. A complete minimal example can be found at: http://www.cs.helsinki.fi/u/ekarttun/haskell/executable-with-c-sources.tar.g... - Einar Karttunen

Einar Karttunen
Executable: tt Main-Is: test.hs C-Sources: a.c Extensions: ForeignFunctionInterface
a.c is completely ignored by Cabal.
From looking at the source code, it seems you are right. I'll fix this ASAP (hopefully late tonight). FWIW, the problem is around line 165 of Distribution.Simple.Build. It's clear that we process C sources for libraries but not executables.
peace, isaac

Einar Karttunen
Hello
The following case seems to be broken: (snip executable containing c-sources)
This should now be fixed in the CVS and darcs repos, but for GHC only. Mind if I snarf this test case for my regression test suite? I can't work on the Hugs fix right now. Ross, any help? Thanks for the excellent bug report! peace, isaac

On Fri, Feb 18, 2005 at 12:43:44AM -0800, Isaac Jones wrote:
Einar Karttunen
writes: The following case seems to be broken: (snip executable containing c-sources)
This should now be fixed in the CVS and darcs repos, but for GHC only. Mind if I snarf this test case for my regression test suite?
I can't work on the Hugs fix right now. Ross, any help?
This case already works for Hugs, if you follow the instructions in the documentation (under c-sources).

Ross Paterson
On Fri, Feb 18, 2005 at 12:43:44AM -0800, Isaac Jones wrote:
Einar Karttunen
writes: The following case seems to be broken: (snip executable containing c-sources)
This should now be fixed in the CVS and darcs repos, but for GHC only. Mind if I snarf this test case for my regression test suite?
I can't work on the Hugs fix right now. Ross, any help?
This case already works for Hugs, if you follow the instructions in the documentation (under c-sources).
Here's the error I get when running the produced executable: ./,tmp/bin/tt runhugs: Error occurred ERROR ",tmp/lib/hugs/programs/tt/Main.hs" - Error while importing DLL "/home/ijones/usr/src/haskell/fptools/libraries/Cabal/tests/exeWithC/,tmp/lib/hugs/programs/tt/Main.so": /home/ijones/usr/src/haskell/fptools/libraries/Cabal/tests/exeWithC/,tmp/lib/hugs/programs/tt/Main.so: cannot open shared object file: No such file or directory #so I % find . -name Main.so ./dist/build/programs/tt/Main.so % cp dist/build/programs/tt/Main.so % ./,tmp/bin/tt 12 And it works. Looks like the install /copy targets are slightly broken. peace, isaac
participants (3)
-
Einar Karttunen
-
Isaac Jones
-
Ross Paterson