Skip to content

gh-136687: allow manually excluding ncurses from the build#136696

Open
duaneg wants to merge 5 commits into
python:mainfrom
duaneg:gh-136687
Open

gh-136687: allow manually excluding ncurses from the build#136696
duaneg wants to merge 5 commits into
python:mainfrom
duaneg:gh-136687

Conversation

@duaneg

@duaneg duaneg commented Jul 15, 2025

Copy link
Copy Markdown
Contributor

Add an option to manually exclude ncurses from the build.

@sobolevn sobolevn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, don't forget to update Doc/using/configure.rst with the new option.

I haven't reviewed the AC code, because I am not an expert there :)

Comment thread Misc/NEWS.d/next/Build/2025-07-16-11-41-43.gh-issue-136687.ob_uIp.rst Outdated
…pping

building the python curses module as opposed to not using the system ncurses
library.

Remove mistakenly repeated test modules section.

Document configure option.
@duaneg

duaneg commented Jul 20, 2025

Copy link
Copy Markdown
Contributor Author

Please, don't forget to update Doc/using/configure.rst with the new option.

Ah, thanks! I didn't spot those docs, updated. On review I think it would be better to think of this from the higher-level user perspective of excluding the curses module, rather than the lower-level build perspective of "skipping a system library check". I've renamed the option --disable-curses, instead of disable-ncurses, accordingly.

Although that does prompt the question of whether we should allow excluding other modules at build time. I'm not sure if this has been discussed before or would be considered useful.

I haven't reviewed the AC code, because I am not an expert there :)

As it turns out, I had made a silly mistake and left a copy & pasted chunk of code in there, so I'm glad you didn't review it as yet 🙂

A tip for reviewing: most of the configure.ac changes are making the libncurses checks conditional, and hence mostly just change indentation. If you review them ignoring whitespace the diff is much easier to read.

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 27, 2026

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please resolve conflicts. A large amount of probes was added recently.

Comment thread Doc/using/configure.rst Outdated
Comment thread configure.ac Outdated
Comment thread configure.ac
AC_ARG_ENABLE([curses], [AS_HELP_STRING(
[--disable-curses],
[disable building curses module (default is no)])], [
AS_VAR_IF([enable_curses], [yes], [Py_CHECK_NCURSES=yes], [Py_CHECK_NCURSES=no])

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"curses" or "ncurses"? Inconsistent.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One ("curses") refers to the python module (whether to build it or not), while the other ("ncurses") refers to the system library (whether to look for it or not), so it is the referents that are inconsistent. I thought a higher-level option was better as a configure flag, with the existing system library check variable being essentially an implementation detail.

However, the inconsistency isn't ideal, agreed. If you prefer I'll switch the configure option back to ncurses. Or add a comment, if that would suffice.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The system library is not necessary ncurses.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@read-the-docs-community

read-the-docs-community Bot commented Jul 1, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33398569 | 📁 Comparing 541b1ab against main (34503f3)

  🔍 Preview build  

3 files changed
± c-api/module.html
± using/configure.html
± whatsnew/changelog.html

@serhiy-storchaka

Copy link
Copy Markdown
Member

I am sorry, but I changed the configure file again, breaking your PR.

Resolve conflicts in configure.ac/configure: the curses probes added on main
(nofilter, has_mouse, is_keypad, is_leaveok, new_prescr, use_screen, use_window,
key_defined, term_attrs, define_key, keyok, set_escdelay, set_tabsize, the
getmouse X/Open signature check, ESCDELAY/TABSIZE, scr_dump) now sit inside the
new --disable-curses (Py_CHECK_NCURSES) conditional, so they are skipped when
curses is disabled.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@serhiy-storchaka

Copy link
Copy Markdown
Member

I have resolved conflicts, but the question about ncurses remains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review stale Stale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants