[arch-haskell] Missing "dyn" libraries for possibly many packages

Peter Simons simons at cryp.to
Sat Oct 12 07:37:56 UTC 2013

Hi Gregory,

first of all, I noticed that you have submitted many qualified and helpful bug
reports recently. Thanks a lot for your efforts.

 > [haskell-sdl-gfx]:
 >     Graphics/UI/SDL/Rotozoomer.hs:19:7:
 >         Could not find module `Graphics.UI.SDL.Types':
 >           Perhaps you haven't installed the "dyn" libraries for package
 >           `SDL-0.6.2'?
 >           Use -v to see a list of the files searched for.
 >         Aborting...
 >     ERROR: makepkg exited with an error (512)

This error comes as a surprise. As you already know, that build fails because
the locally installed version of haskell-sdl hasn't been compiled with
--enable-shared. Thus, an attempt to build haskell-sdl-gfx with --enable-shared
will fail with the error message you cited above. However, this shouldn't be
happening, because we bumped the $pkgrel of haskell-sdl when --enable-shared
was activated:

 | commit 678ab5f30a159d2c44c48cd7670891421310eb93
 | Author: Peter Simons <simons at cryp.to>
 | Date:   Fri Dec 24 11:17:37 2010 +0100
 |     Regenerated all PKGBUILD files that didn't set "--enable-shared" with the
 |     latest tool-chain. Bumped $pkgrel of those packages, too.
 | diff --git a/haskell-sdl/PKGBUILD b/haskell-sdl/PKGBUILD
 | index 3bf1f60..b51f61a 100644
 | --- a/haskell-sdl/PKGBUILD
 | +++ b/haskell-sdl/PKGBUILD
 | @@ -2,7 +2,7 @@
 |  _hkgname=SDL
 |  pkgname=haskell-sdl
 |  pkgver=0.6.2
 | -pkgrel=1
 | +pkgrel=2
 |  pkgdesc="Binding to libSDL"
 |  url="http://hackage.haskell.org/package/${_hkgname}"
 |  license=('custom:BSD3')
 | @@ -14,7 +14,7 @@ source=(http://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkg
 |  install=${pkgname}.install
 |  build() {
 |      cd ${srcdir}/${_hkgname}-${pkgver}
 | -    runhaskell Setup configure --prefix=/usr --docdir=/usr/share/doc/${pkgname} -O --enable-split-objs
 | +    runhaskell Setup configure --prefix=/usr --docdir=/usr/share/doc/${pkgname} -O --enable-split-objs --enable-shared
 |      runhaskell Setup build
 |      runhaskell Setup haddock
 |      runhaskell Setup register   --gen-script

In other words, your installed copy of haskell-sdl should have been updated to
version 0.6.2-2 some time around Christmas, and consequently your installed
copy should have shared libraries for dynamic linking.

In case you can still re-produce the error on your machine, I'd be interested
to see the output from "pacman -Qi haskell-sdl"?

 > 1.  Why the dyn libraries are now needed.
 >     Is it because of a new version of GHC which does this by default?
 >     Or a change in the way Arch Haskell defines packages?

Traditionally, Haskell packages published on AUR did not enable building of
shared libraries. When those packages were moved to [extra], however, shared
library support was enabled. I don't believe that this policy has been
established based on an explicitly thought-out rationale ... it's just been
like that for some reason. Because of users requests, however, we enabled
building of shared libraries in AUR packages, too, so that all packages support
that feature consistently.

This is entirely a change of "policy". There is no technical background to this

 > 2.  Does it still build static libraries as well?

Yes, every library package is effectively compiled twice.

 > 3.  If I build an executable program, without any special flags,
 >     is it going to use the dynamic or static libraries?

No, GHC 6, at least, won't use shared linking unless explicitly told to with
the flag "-dynamic". I don't know about GHC 7, but I guess it behaves the same

 > 4.  Is it possible for users to control whether dynamic or static
 >     libraries are built, or both, using tools such as bauerbill?

It is possible, but it is a bit of an extra effort. You can use bauerbill's
"edit the pkgbuild" feature to manually add the option "--ghc-option=-dynamic"
to the command line of the configure stage. (Note that adding --enable-shared
won't have any effect when building executables.) If you do that, however, you
must also move all $makedepends entries into $depends. Otherwise, pacman would
allow you to un-install libraries that your package depends on, which would
silently break the executable.

I hope this helps,

More information about the arch-haskell mailing list