This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: ncurses extension uses wrong include path
Type: compile error Stage:
Components: Build, Library (Lib) Versions: Python 3.7, Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Jeffrey.Kintscher, chargr, yan12125
Priority: normal Keywords:

Created on 2019-05-20 21:48 by chargr, last changed 2022-04-11 14:59 by admin.

Messages (2)
msg342957 - (view) Author: Chris Hargreaves (chargr) Date: 2019-05-20 21:48
This is similar to: https://bugs.python.org/issue28190

Not cross-compiling, but using a different ncurses version than is provided under /usr/include/ncursesw

Specifying CPPFLAGS to have "-I/path/to/ncurses/include" does not override the "/usr/include/ncursesw" in setup.py

        if curses_library == 'ncursesw':
            curses_defines.append(('HAVE_NCURSESW', '1'))
            if not cross_compiling:
                curses_includes.append('/usr/include/ncursesw')

Python 2.7.x does not have this issue, but 3.6.x and 3.7.x do.  2 and 3 have different ways of setting up the include path for curses when building the extension.

In my case, removing the curses_include.append from setup.py results in a working extension.

It probably makes sense that Extension(include_dirs=) take priority over Python build CPPFLAGS, setup.py may need to be more cautious about adding the ncurses include path.

Only tested in 2.7, 3.6, 3.7.
msg343502 - (view) Author: Jeffrey Kintscher (Jeffrey.Kintscher) * Date: 2019-05-25 18:55
This explains some of the build/linkage problems encountered in issue #36630, and that I encountered while working on issue #36982.
History
Date User Action Args
2022-04-11 14:59:15adminsetgithub: 81160
2019-05-25 18:55:15Jeffrey.Kintschersetnosy: + yan12125
messages: + msg343502
2019-05-22 10:09:46Jeffrey.Kintschersetnosy: + Jeffrey.Kintscher
2019-05-20 21:48:43chargrcreate