Summary of a long mail: on Arch Linux, either haskell-terminfo or libncurses is broken. If you can't get ghc to load the terminfo package when building yi, please read on, otherwise, it's probably boring for you.
Hi folks,
The newest darcs version of yi failed to build in its new module-linking step:
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
Loading package base ... linking ... done.
Loading package bytestring-0.9.1.4 ... linking ... done.
Loading package syb ... linking ... done.
Loading package array-0.2.0.0 ... linking ... done.
Loading package containers-0.2.0.0 ... linking ... done.
Loading package base-3.0.3.0 ... linking ... done.
Loading package terminfo-0.2.2.1 ... <command line>: can't load .so/.DLL for:
ncurses (/usr/lib/libncurses.so: file too short)
cabal: Error: some packages failed to install:
Looking at my libncurses package, that seems indeed possible:
% ll /usr/lib/libncurses*
lrwxrwxrwx 1 root root 15 2008-11-14 23:35 /usr/lib/libncurses++.a ->
libncurses++w.a
-rw-r--r-- 1 root root 141K 2008-11-14 23:36 /usr/lib/libncurses++w.a
lrwxrwxrwx 1 root root 13 2008-11-14 23:35 /usr/lib/libncurses.a ->
libncursesw.a
-rw-r--r-- 1 root root 18 2008-11-14 23:35 /usr/lib/libncurses.so
lrwxrwxrwx 1 root root 17 2008-11-14 23:36 /usr/lib/libncurses.so.5 ->
libncurses.so.5.7*
-rwxr-xr-x 1 root root 286K 2008-11-14 23:36 /usr/lib/libncurses.so.5.7*
-rw-r--r-- 1 root root 464K 2008-11-14 23:36 /usr/lib/libncursesw.a
lrwxrwxrwx 1 root root 26 2008-11-14 23:35 /usr/lib/libncursesw.so ->
../../lib/libncursesw.so.5*
18 bytes *is* small, and it's no link either. Not that I understand the
C-library system at all, maybe it does link in some way. Inspecting some of my
Curses-using programs:
[I]22:44 % ldd =vim|grep curses
libncursesw.so.5 => /lib/libncursesw.so.5 (0xb7f0d000)
[I]22:44 % ldd =ncmpc|grep curses
libncursesw.so.5 => /lib/libncursesw.so.5 (0xb7e76000)
[I]22:44 % ldd =screen|grep curses
libncursesw.so.5 => /lib/libncursesw.so.5 (0xb7f7d000)
(Interestingly, mutt *isn't* a Curses-using program…)
So it seems that most programs link against a specific version of the NCurses
library, whereas terminfo links against libncurses.so, directly. On my system
(Arch Linux) this seems to break the game. Looking at my Debian/sid server:
ls -l /usr/lib/libncurses*
-rw-r--r-- 1 root root 327510 2008-11-30 19:01 /usr/lib/libncurses.a
-rw-r--r-- 1 root root 144070 2008-11-30 19:01 /usr/lib/libncurses++.a
lrwxrwxrwx 1 root root 20 2008-12-01 07:03 /usr/lib/libncurses.so ->
/lib/libncurses.so.5
lrwxrwxrwx 1 root root 13 2008-03-20 22:13 /usr/lib/libncurses.so.5 ->
libtermcap.so
OK… so it seems that problem is *really* distro-specific. My FreeBSD server uses
a similar layout, but links libncurses.so to /lib/libncurses.so.6. Anyway,
moving /usr/lib/libncurses.so out of the way and replacing it with a symlink to
the real libncurses (libncurses.so.5.7) did fix the problem, without introducing
new ones (AFAICS). A quick `ldd /usr/bin/*|grep curses` revealed that this
operation is indeed probably safe, since no other program links there. Does
anyone know why terminfo would fall out of line to link against the generic
version of the library? And why Arch Linux is so different in this respect?
Otherwise, this is just an information for anyone trying to build a recent yi on
Arch Linux. As of now, it's not likely to work without that modification
(considering Arch is a typical Haskeller's distro and it's got yi packaged, this
could maybe affect other people.) If anyone has any further knowledge on the
issue, I'd be glad to find out more. So far, I don't know if it is an
* upstream libncurses issue
* upstream terminfo issue
* Arch's libncurses issue
* Arch's terminfo issue
Probably best would be to first try out the latter two choices… :-\
Best,
Aleks
pgpLf7GeV2d16.pgp
Description: PGP signature
