Missing "dyn" libraries for possibly many packages

Now that bauerbill is building again, I'm starting to get errors about missing "dyn" libraries for a number of packages: [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) (Having previously failed to build this because of a missing external library, SDL_gfx, my first thought was: What -- another missing library, SDL_dyn? What's that?) :-) [haskell-zip-archive]: Codec/Archive/Zip.hs:69:17: Could not find module `Data.Digest.CRC32': Perhaps you haven't installed the "dyn" libraries for package `digest-0.0.0.8'? Use -v to see a list of the files searched for. Aborting... Searching around, I've found a couple of other instances of this: - Comments on haskell-missingh: http://aur.archlinux.org/packages.php?ID=17845 - Comments on haskell-digest: http://aur.archlinux.org/packages.php?ID=23078 Although these comments are automatically posted on the arch-haskell mailing list, it's easy to overlook them because their subjects refer to specific packages -- since I'm not interested in missingh or digest, I deleted them without reading, and probably many others did too. So, to consolidate the information here, I'll repost peti's advice on the haskell-digest package: Comment by: peti on Sun, 26 Dec 2010 15:19:40 +0000 Hi Frabjous, apparently, you are using the "haskell-bytestring" package from AUR. That package is kind of obsolete, because it became a part of GHC in version 6.12.3 or so. You probably installed it a while ago, before 6.12.3 was available? Anyway, this is no big deal, and the problem with the missing shared libraries that caused your build failure has been fixed. Still, I would recommend that you clean up your Haskell installation to make sure that everything conforms to the current state of the art. The best way to accomlish that is to run the commands "pacman -R --cascade ghc", then "rm -rf /usr/lib/ghc-*", and then to re-install everything that you actually need from scratch. It's optional to do that, of course. In any case, thanks for the bug report. I'm glad the problem is now fixed. I do wonder, though, about a few things. 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? 2. Does it still build static libraries as well? 3. If I build an executable program, without any special flags, is it going to use the dynamic or static libraries? 4. Is it possible for users to control whether dynamic or static libraries are built, or both, using tools such as bauerbill? -- ___ ___ __ _ / _ \ / _ \| | | | Gregory D. Weber, Associate Professor / /_\// / | | | /\ | | Indiana University East / /_\\/ /__| | |/ \| | http://mypage.iu.edu/~gdweber/ \____/\_____/\___/\__/ Tel. (765) 973-8420; FAX (765) 973-8550

On 08/01/11 22:37, gdweber@iue.edu wrote:
Now that bauerbill is building again, I'm starting to get errors about missing "dyn" libraries for a number of packages:
[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)
(Having previously failed to build this because of a missing external library, SDL_gfx, my first thought was: What -- another missing library, SDL_dyn? What's that?) :-)
[haskell-zip-archive]:
Codec/Archive/Zip.hs:69:17: Could not find module `Data.Digest.CRC32': Perhaps you haven't installed the "dyn" libraries for package `digest-0.0.0.8'? Use -v to see a list of the files searched for. Aborting...
Searching around, I've found a couple of other instances of this:
- Comments on haskell-missingh: http://aur.archlinux.org/packages.php?ID=17845 - Comments on haskell-digest: http://aur.archlinux.org/packages.php?ID=23078
Although these comments are automatically posted on the arch-haskell mailing list, it's easy to overlook them because their subjects refer to specific packages -- since I'm not interested in missingh or digest, I deleted them without reading, and probably many others did too.
So, to consolidate the information here, I'll repost peti's advice on the haskell-digest package:
Comment by: peti on Sun, 26 Dec 2010 15:19:40 +0000
Hi Frabjous, apparently, you are using the "haskell-bytestring" package from AUR. That package is kind of obsolete, because it became a part of GHC in version 6.12.3 or so. You probably installed it a while ago, before 6.12.3 was available? Anyway, this is no big deal, and the problem with the missing shared libraries that caused your build failure has been fixed. Still, I would recommend that you clean up your Haskell installation to make sure that everything conforms to the current state of the art. The best way to accomlish that is to run the commands "pacman -R --cascade ghc", then "rm -rf /usr/lib/ghc-*", and then to re-install everything that you actually need from scratch. It's optional to do that, of course. In any case, thanks for the bug report. I'm glad the problem is now fixed.
I do wonder, though, about a few things. 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?
The PKGBUILDs generated by cabal2arch where changed to create dyn libraries. This had the unfortunate effect of requiring a lot of re-compilation. AFAIK the same has been done for the packages in [extra]/[community].
2. Does it still build static libraries as well?
Indeed it does, and executables are actually only linked against the static so the use of makedepends for those packages is still correct. It is of course easy to check this for yourself: % pacman -Ql haskell-archlinux|grep '\.a$' haskell-archlinux /usr/lib/archlinux-0.3.5/ghc-6.12.3/libHSarchlinux-0.3.5.a
3. If I build an executable program, without any special flags, is it going to use the dynamic or static libraries?
It links against the static libs, as mentioned above. Again, you can check this easily yourself: % ldd /usr/bin/cabal2arch linux-vdso.so.1 => (0x00007fff86d77000) librt.so.1 => /lib/librt.so.1 (0x00007f8f24fa0000) libutil.so.1 => /lib/libutil.so.1 (0x00007f8f24d9d000) libdl.so.2 => /lib/libdl.so.2 (0x00007f8f24b99000) libgmp.so.10 => /usr/lib/libgmp.so.10 (0x00007f8f2492c000) libm.so.6 => /lib/libm.so.6 (0x00007f8f246aa000) libc.so.6 => /lib/libc.so.6 (0x00007f8f2434e000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007f8f24131000) /lib/ld-linux-x86-64.so.2 (0x00007f8f251a8000)
4. Is it possible for users to control whether dynamic or static libraries are built, or both, using tools such as bauerbill?
I don't think so, but Peter knows more about the details on the dyn libs and when they are used. He reported all about it to this list, check the archive please. /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@therning.org twitter: magthe http://therning.org/magnus

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
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 decision.
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 way.
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, Peter

On 2011-Jan-09, Peter Simons wrote:
Hi Gregory,
first of all, I noticed that you have submitted many qualified and helpful bug reports recently. Thanks a lot for your efforts.
You're welcome.
[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:
This was probably due to my having an outdated version of bauerbill, which was building packages in the wrong order, and is now fixed, I think. ...
I hope this helps, Peter
Indeed it does. Thanks to both you and Magnus for your very thorough answers. Greg -- ___ ___ __ _ / _ \ / _ \| | | | Gregory D. Weber, Associate Professor / /_\// / | | | /\ | | Indiana University East / /_\\/ /__| | |/ \| | http://mypage.iu.edu/~gdweber/ \____/\_____/\___/\__/ Tel. (765) 973-8420; FAX (765) 973-8550
participants (3)
-
gdweber@iue.edu
-
Magnus Therning
-
Peter Simons