Repository navigation
Closed
Labels
buildThe build process and cross-buildextension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or error
Description
With Python 3.13.5 I see no way to tell ./configure to avoid using ncurses. I want to execute the final binary in a chrooted environment, where ncurses/curses/ncursesw are not available.
./configure --without-readline --with-lto --enable-shared --without-static-libpython --prefix=/root/chroot-n/python --disable-ipv6 --enable-optimizations CFLAGS='--sysroot=/root/chroot-n -Ichr/include -Wl,--dynamic-linker=/chr/lib/ld-linux-x86-64.so.2'
However on the host system ncursesw is available. The above command produces
checking for ncursesw... yes
checking for panelw... yes
checking for ncursesw/curses.h... no
checking for ncursesw/ncurses.h... no
checking for ncursesw/panel.h... no
checking for ncurses/curses.h... no
checking for ncurses/ncurses.h... no
checking for ncurses/panel.h... no
checking for curses.h... no
checking for ncurses.h... no
checking for panel.h... no
checking for library containing initscr... none required
checking for library containing update_panels... none required
checking for term.h... no
checking whether mvwdelch is an expression... no
checking whether WINDOW has _flags... no
checking for curses function is_pad... no
checking for curses function is_term_resized... no
checking for curses function resize_term... no
checking for curses function resizeterm... no
checking for curses function immedok... no
checking for curses function syncok... no
checking for curses function wchgat... no
checking for curses function filter... no
checking for curses function has_key... no
checking for curses function typeahead... no
checking for curses function use_env... no
…
checking for stdlib extension module _curses... yes
checking for stdlib extension module _curses_panel... yes
doing later make fails, as the header files are missing.
I want to be able to pass an option to ./configure so that it does not build curses/ncurses/ncursesw.
Linked PRs
Metadata
Metadata
Assignees
Labels
buildThe build process and cross-buildextension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or error
Projects
- StatusShow more project fieldsDone
Activity
30November commentedon Jul 15, 2025
Please explain more details like what is ncurses
dilyanpalauzov commentedon Jul 15, 2025
This is a library for building text user interfaces (GUI on the terminal).
When cpython is built, these are the error messages:
and so on 2000 lines.
picnixz commentedon Jul 15, 2025
I'm treating as a bug for now but it might because the paths where to look at do not have the header files. So it could be a configure issue or a feature.
duaneg commentedon Jul 15, 2025
FWIW I think this is a feature request to extend the build system to allow manual control over whether
ncursesshould be linked in, not a bug as such. It seems like a very reasonable thing to want to do when cross-compiling.ncursesis already optional and skipped if it isn't present on the host system, so hopefully it will be straight-forward to allow manual control.pythongh-136687: allow manually excluding ncurses from the build
dilyanpalauzov commentedon Jul 16, 2025
" (default is no)" is not necessary. This is implied by the
--disable-text on--help, see https://ab.bapha.be/posts/help-output/ . In short:--helpprovides only hints how to alter the default behaviour. But./configure --helpcurrently prints:--enable-gilas by default it is disabled.duaneg commentedon Jul 16, 2025
That all sounds very sensible and FWIW I generally agree, but as you say, at present that isn't the convention the help text uses. I'd be happy to drop the "(default is no)" once there is agreement that is the correct thing to do, but for now I think we should keep it consistent with the existing help text.
If/when #136700 is done I'll update it as part of that.
glandium commentedon Jan 15, 2026
Note that the build system does have an implicit way to disable ncurses, when its headers are not around. The problem is that the build still fails, because not everything that should be behind HAVE_TERM_H is behind HAVE_TERM_H, while
#include "term.h"is behind HAVE_TERM_H.Which leads to build failures such as:
Merge branch 'main' into pythongh-136687
pythongh-136687: Fix the wide-character probe for native curses
pythongh-136687: Match the panel and headers to the selected curses b…
gh-136687: Add ./configure --with-curses to select the curses backend (…
serhiy-storchaka commentedon Jul 19, 2026
I needed more control on the build, so I added
--with-curses=to select the curses backend. This allows to build without hacks against native curses on NetBSD and Solaris.--with-curses=noand--without-cursesexclude thecursesand_curses_panelmodules from the build.