Skip to content

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

Merged
serhiy-storchaka merged 2 commits into
python:3.15from
serhiy-storchaka:backport-154071-3.15
Jul 28, 2026
Merged

[3.15] gh-154070: Build the curses module wide by capability, not by name (GH-154071)#154765
serhiy-storchaka merged 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
@serhiy-storchaka
serhiy-storchaka merged commit 383c7bd into python:3.15 Jul 28, 2026
131 of 147 checks passed
@serhiy-storchaka
serhiy-storchaka deleted the backport-154071-3.15 branch July 28, 2026 05:04
@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Jul 28, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Jul 28, 2026

Copy link
Copy Markdown

GH-154799 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jul 28, 2026
@bedevere-app

bedevere-app Bot commented Jul 28, 2026

Copy link
Copy Markdown

GH-154800 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Jul 28, 2026
serhiy-storchaka added a commit that referenced this pull request Jul 28, 2026
…name (GH-154071) (GH-154765) (GH-154799)

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.

(cherry picked from commit 2db8ca7)
(cherry picked from commit 383c7bd)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants