Skip to content

[3.15] gh-154070: Build the curses module wide by capability, not by name (GH-154071)#154765

Open
serhiy-storchaka wants to merge 2 commits into
python:3.15from
serhiy-storchaka:backport-154071-3.15
Open

[3.15] gh-154070: Build the curses module wide by capability, not by name (GH-154071)#154765
serhiy-storchaka wants to merge 2 commits into
python:3.15from
serhiy-storchaka:backport-154071-3.15

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

Backport of GH-154071 to 3.15.

configure built the module wide (HAVE_NCURSESW) only for a library found under the name ncursesw. Probe for the wide API too, so a widec-built ncurses keeping the plain name (pkgsrc, macOS) is built wide.

Not a clean cherry-pick: 3.15 has no --with-curses (GH-153992 is main-only), so the probe is guarded on have_curses rather than on the selected backend, and it uses WITH_SAVE_ENV instead of saving CPPFLAGS by hand -- on 3.15 the outer WITH_SAVE_ENV has already closed at that point.

…ot by name (pythonGH-154071)

configure built the module wide (HAVE_NCURSESW) only for a library found
under the name ncursesw.  Probe for the wide API too, so a widec-built
ncurses keeping the plain name (pkgsrc, macOS) is built wide.

3.15 has no --with-curses, so the probe is guarded on curses being found
rather than on the selected backend.
(cherry picked from commit 2db8ca7)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The wide-character probe ran inside a nested WITH_SAVE_ENV, whose single
CPPFLAGS save slot is not reentrant, so the outer restore leaked
$CURSES_CFLAGS and $PANEL_CFLAGS (-D_XOPEN_SOURCE=600) into
CONFIGURE_CPPFLAGS and thus into every translation unit, producing a
'_XOPEN_SOURCE' redefined warning against pyconfig.h on every file.

Save and restore CPPFLAGS with a dedicated variable around the probe,
as on the main branch.
@serhiy-storchaka serhiy-storchaka added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 27, 2026
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @serhiy-storchaka for commit 603c80f 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F154765%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants