Opened 4 years ago

Closed 20 months ago

Last modified 19 months ago

#16764 closed patch (fixed)

Pidgin/finch fails to build against ncurses 6.0 with WINDOW_OPAQUE set to 1

Reported by: dimstar Owned by: EionRobb
Milestone: 2.13.0 Component: unclassified
Version: 2.10.11 Keywords:
Cc:

Description (last modified by Robby)

openSUSE is in progress of updating ncurses to version 6.0 and WINDOW_OPAQUE is being set to 1.

This results in build failures of finch, with this kind of log:

[  868s]   CC       gntws.lo
[  868s] gntwm.c: In function 'work_around_for_ncurses_bug':
[  868s] gntwm.c:177:18: error: dereferencing pointer to incomplete type 'WINDOW {aka struct _win_st}'
[  868s]    sx = panel->win->_begx;
[  868s]                   ^
[  868s] Makefile:738: recipe for target 'gntwm.lo' failed

The issue being, that when WINDOW_OPAQUE is enabled in ncurses, the WINDOW struct is not supposed to be accessed directly, but only thruogh accessor functions

Attachments (1)

pidgin-ncurses-6.0-accessors.patch (2.4 KB) - added by dimstar 4 years ago.
Change pidgin/finch to use ncurses accessor functions…

Download all attachments as: .zip

Change History (16)

Changed 4 years ago by dimstar

Change pidgin/finch to use ncurses accessor functions...

comment:1 Changed 4 years ago by dimstar

With the attached patch, I managed to build pidgin/finch on openSUSE with ncurses 6.0

comment:2 Changed 4 years ago by QuLogic

Thanks! Will it also build with 5.1 using this patch (i.e., when were these functions added)?

comment:3 Changed 4 years ago by dimstar

The ncurses changelog mentions it at around:

20070331
        + add access-functions and macros to return properties of the WINDOW
          structure, e.g., when NCURSES_OPAQUE is set.

so, no, ncurses 5.1 does not have those accessors (5.1 was released 2000/07/08!)

Looking at the release history, 5.7 was the first release after 20070331

comment:4 Changed 4 years ago by QuLogic

Oh, wait, not sure where I got 5.1 from. There's actually no minimum specified in configure.ac, but I guess whatever's in a reasonably recent (and still supported) distro.

comment:5 Changed 3 years ago by bjoernv

The bug exists in default branch (Pidgin 3.0) too. The patch fixes the compilation errors.

comment:6 Changed 3 years ago by Robby

  • Description modified (diff)
  • Milestone set to Patches Needing Review
  • Type changed from defect to patch

comment:7 Changed 3 years ago by bjoernv

The patch resolves the build error. But does Finch really work with the patch and ncurses 6?

If I start Finch, the terminal window is cleared. After that I see my shell prompt again. But I can't type anything before I reset the terminal window with "reset".

comment:8 follow-up: Changed 3 years ago by dx

I don't get it. Arch linux here, ncurses 6.0, no patches applied to 2.10.12 and it builds just fine.

https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/pidgin

The only patch is unrelated, for python2/python3 fixes.

comment:9 in reply to: ↑ 8 Changed 3 years ago by bjoernv

Replying to dx:

I don't get it. Arch linux here, ncurses 6.0, no patches applied to 2.10.12 and it builds just fine.

https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/pidgin

The only patch is unrelated, for python2/python3 fixes.

The problem is only visible, if NCURSES_OPAQUE=1 (not WINDOW_OPAQUE like in the bug title) is set in /usr/include/ncurses.h. The configure switch --enable-reentrant triggers NCURSES_OPAQUE=1.

openSUSE Tumbleweed compiles ncurses with these switches:

%configure \
        --without-ada           \
        --without-debug         \
        --without-profile       \
        --without-manpage-tbl   \
        --with-shared           \
        --with-normal           \
        --with-manpage-format=gzip \
        --with-manpage-renames=${PWD}/man/man_db.renames \
        --with-manpage-aliases  \
        --with-ospeed=speed_t   \
%if 0%{?suse_version} > 1310
        --with-gpm=$(readlink %{_libdir}/libgpm.so) \
%else
        --with-gpm              \
%endif
        --with-dlsym            \
        --with-termlib=tinfo    \
        --with-ticlib=tic       \
        --with-xterm-kbs=del    \
        --disable-root-environ  \
        --disable-termcap       \
        --disable-overwrite     \
        --disable-rpath         \
        --disable-rpath-hack    \
        --disable-leaks         \
        --disable-xmc-glitch    \
        --enable-symlinks       \
        --enable-big-core       \
        --enable-const          \
        --enable-hashmap        \
        --enable-no-padding     \
        --enable-sigwinch       \
        --enable-colorfgbg      \
        --enable-sp-funcs       \
        --enable-interop        \
        --with-pthread          \
        --enable-reentrant      \
        --enable-ext-mouse      \
        --disable-widec         \
        --enable-ext-colors     \
        --enable-weak-symbols   \
        --enable-wgetch-events  \
        --enable-pthreads-eintr \
        --enable-string-hacks   \
        --prefix=%{_prefix}     \
        --exec-prefix=%{_prefix}\
        --libdir=%{_libdir}     \
        --datadir=%{_datadir}   \
        --mandir=%{_mandir}     \
        --includedir=%{_incdir} \
        "${WITHCHTYPE}"         \
        --disable-tic-depends   \
        --with-cxx-shared       \
        --with-pc-suffix        \
        --enable-pc-files       \
%if 0%{?_crossbuild}
        --with-fallbacks="$FALLBK" \
%else
        --with-fallbacks=""     \
%endif
%if %{with symversion}
        --with-versioned-syms=${PWD}/package/ncursest.map \
%endif
%if %{with hasheddb}
        --with-hashed-db        \
%endif
        --with-pkg-config-libdir=%{_libdir}/pkgconfig}}}

comment:10 follow-up: Changed 3 years ago by dx

Of those options, the following are in the "Experimental Code" section of the ncurses configure help

--enable-colorfgbg
--enable-interop
--enable-pthreads-eintr
--enable-reentrant
--enable-weak-symbols
--enable-wgetch-events
--with-pthread

Is there a good reason for all of these? Enabling experimental thread related features in production code seems like an awful idea.

Debian and arch don't enable any of these. Fedora enables colorfgbg only.

comment:11 in reply to: ↑ 10 Changed 3 years ago by bjoernv

Replying to dx:

Is there a good reason for all of these? Enabling experimental thread related features in production code seems like an awful idea.

Debian and arch don't enable any of these. Fedora enables colorfgbg only.

I don't know and I am not the package maintainer of ncurses or Pidgin packages in openSUSE project. There are some hits on "thread" options in ncurses.changes file. But I haven't found the answer of your question here:

https://build.opensuse.org/package/show?project=openSUSE%3AFactory&package=ncurses

comment:13 Changed 20 months ago by Gary Kramlich <grim@…>

  • Milestone changed from Patches Needing Review to 2.10.13
  • Resolution set to fixed
  • Status changed from new to closed

(In [7b4e9bdf079e]):
ChangeLog the pr and fix for ncurses 6.0 opaque structs. Fixes #16764

comment:14 Changed 20 months ago by Robby

  • Milestone changed from 2.10.13 to 2.12.1

Can someone please fix the post-commit hook?

comment:15 Changed 19 months ago by Robby

  • Milestone changed from 2.12.1 to 2.13.0
Note: See TracTickets for help on using tickets.
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!