#13359 closed defect (fixed)
BUG: zsh-devel is built against /usr/include/curses.h and linked with MacPorts ncurses
Reported by: | vinc17@… | Owned by: | nox@… |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 1.5.2 |
Keywords: | Cc: | ||
Port: |
Description
"otool -L =zsh" shows that zsh-devel is dynamically linked against the MacPorts ncurses library: /opt/local/lib/libncurses.5.dylib
But it is built using "/usr/include/curses.h"! This can be shown by cd'ing to Src/Modules and using the line output by "make" after replacing "-o ..." by "-E":
prunille:...4.3.4/Src/Modules> /usr/bin/gcc-4.0 -c -I. -I/opt/local/include -DHAVE_CONFIG_H -DMODULE -O2 -fno-common terminfo.c -E | grep 'include.*curses' # 1 "/usr/include/curses.h" 1 3 4 # 58 "/usr/include/curses.h" 3 4 # 1 "/usr/include/ncurses_dll.h" 1 3 4 # 59 "/usr/include/curses.h" 2 3 4 # 99 "/usr/include/curses.h" 3 4 # 1 "/usr/include/curses.h" 1 3 4 # 103 "/usr/include/curses.h" 2 3 4 # 126 "/usr/include/curses.h" 3 4 # 136 "/usr/include/curses.h" 3 4 # 137 "/usr/include/curses.h" 2 3 4 # 174 "/usr/include/curses.h" 3 4 # 192 "/usr/include/curses.h" 3 4 # 282 "/usr/include/curses.h" 3 4 # 318 "/usr/include/curses.h" 3 4 # 501 "/usr/include/curses.h" 3 4 # 1398 "/usr/include/curses.h" 3 4 # 1442 "/usr/include/curses.h" 3 4
The problem is that the current zsh version only uses #include <curses.h> lines and that the ncurses port doesn't install curses compatibility symlinks. I mentioned the problem a year ago in the macports-dev list (subject: "compatibility symbolic links for ncurses and ncursesw"), but no-one replied (see also bug #12605 reported by someone else).
I sometimes get zsh crashes under Mac OS X when it has been sleeping for a long time (e.g. after a long ssh session to some other machine), just before the prompt is displayed (I do not have this problem under Debian). I wonder if the cause can be this build problem.
FYI, this bug will be fixed upstream in the next zsh version (see zsh-workers mailing-list, subject "zsh-4.3.4-dev-2.tar.gz").
Attachments (1)
Change History (10)
comment:1 Changed 17 years ago by nox@…
Cc: | vinc17@… removed |
---|---|
Status: | new → assigned |
comment:2 Changed 17 years ago by nox@…
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
r31399. Thanks for reporting.
% /usr/bin/gcc-4.0 -c -I. -I/opt/local/include -DHAVE_CONFIG_H -DMODULE -O2 -fno-common terminfo.c -E | fgrep curses.h # 1 "/usr/include/ncurses.h" 1 3 4 # 58 "/usr/include/ncurses.h" 3 4 # 59 "/usr/include/ncurses.h" 2 3 4 # 99 "/usr/include/ncurses.h" 3 4 # 1 "/usr/include/curses.h" 1 3 4 # 103 "/usr/include/ncurses.h" 2 3 4 # 126 "/usr/include/ncurses.h" 3 4 # 136 "/usr/include/ncurses.h" 3 4 # 137 "/usr/include/ncurses.h" 2 3 4 # 174 "/usr/include/ncurses.h" 3 4 # 192 "/usr/include/ncurses.h" 3 4 # 282 "/usr/include/ncurses.h" 3 4 # 318 "/usr/include/ncurses.h" 3 4 # 501 "/usr/include/ncurses.h" 3 4 # 1398 "/usr/include/ncurses.h" 3 4 # 1442 "/usr/include/ncurses.h" 3 4
comment:3 Changed 17 years ago by vinc17@…
Resolution: | fixed |
---|---|
Status: | closed → reopened |
/usr/include/ncurses.h is incorrect (this is just a symlink to curses.h, but this is not a header file from MacPorts). One needs to use the ncurses.h from MacPorts, which is, since zsh-devel depends on ncurses:
prunille:~> port contents ncurses | grep ncurses.h /opt/local/include/ncurses/ncurses.h
So, instead of replacing curses.h by ncurses.h, it needs to be replaced by ncurses/ncurses.h, probably with:
reinplace "s|curses\\.h|ncurses/ncurses.h|"
(not tested).
comment:4 Changed 17 years ago by nox@…
Mh, you're right! I don't know why I've done that. Thanks!
I think I'll append -I${prefix}/include/ncurses to the cppflags instead of modifying the reinplace
regular expression.
comment:5 Changed 17 years ago by nox@…
Sorry Vincent, but could you take care of this bug? I'm fighting against hordes of hideous kernel panics and I think I'm going to loose this battle, so I'm currently backing up all my data and I haven't got the time to fix this port.
Changed 17 years ago by vinc17@…
Portfile for zsh-devel 4.3.4-dev-5 (will be close to 4.3.5)
comment:6 Changed 17 years ago by vinc17@…
For those who are interested in testing a development version, I've attached a Portfile for zsh-devel 4.3.4-dev-5, which will be close to 4.3.5 (that should be released soon).
comment:7 Changed 17 years ago by vinc17@…
I forgot to say concerning this Portfile:
- The bug is fixed in this version (so that I could remove post-patch). In fact, zsh is now linked against ncursesw. So, the dependency should be modified...
- I've added a debug variant.
I think a simple reinplace in termcap.c and terminfo.c will fix this.