Haskell package with dynamic library only

Andreas Voellmy andreas.voellmy
Sat Oct 5 15:56:02 UTC 2013


Christiaan suggested that I try cabal installing
"--disable-library-vanilla" which I combined with --enable-shared. It
almost works. It causes ghc to only create the dynamic libraries. However,
ghc-pkg register fails with the error:

/usr/local/bin/ghc-pkg update - --global --user
--package-db=dist/package.conf.inplace
cabal: TestLib-0.1.0.0: cannot find libHSTestLib-0.1.0.0.a on library path
(use --force to override)
Failed to install TestLib-0.1.0.0

It seems that ghc-pkg thinks that we must have the .a files to register the
package. (I scanned the ghc-pkg source and it looks like checkHSLib is
where this check happens.)

So, is the check in ghc-pkg really correct? I.e. the package would be
unusable without the .a file? Or would this be OK, so we really should
change ghc-pkg?

-Andi




On Fri, Oct 4, 2013 at 6:35 PM, Andreas Voellmy
<andreas.voellmy at gmail.com>wrote:

> Hi all,
>
> Is it possible to have a Haskell package that only includes a dynamic
> library and .dyn_hi files? I.e. it would omit the .o and .a files? I tried
> building a library using cabal and --enable-shared. It still includes the
> .o and .a files.
>
> Will builds with "-dynamic" and loading modules in ghci work correctly if
> I just delete the .o and .a files?  I did a few experiments and it seems to
> work OK, although it seems that things break if I delete the .hi files,
> even though I'd expect only the .dyn_hi files would be used.
>
> -Andi
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20131005/a20fea98/attachment.html>



More information about the ghc-devs mailing list