Skip to content

Conversation

@mmangkad
Copy link
Contributor

Fixes GH-143842.

When building a static Python with PGO+LTO and a static _curses extension, the optimizer’s COLORS array collided with the curses COLORS symbol. Make the optimizer color table static to avoid the global symbol clash.

Tests: not run (build fix only).

Copilot AI review requested due to automatic review settings January 14, 2026 19:47
@python-cla-bot
Copy link

python-cla-bot bot commented Jan 14, 2026

All commit authors signed the Contributor License Agreement.

CLA signed

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request fixes a symbol collision between the Python optimizer and the curses library during static builds with PGO+LTO by making an internal color table static.

Changes:

  • Made the COLORS array in the optimizer static to prevent global symbol clash
  • Added NEWS entry documenting the build fix

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
Python/optimizer.c Changed COLORS array declaration from const char *COLORS[10] to static const char *COLORS[10] to prevent global symbol export
Misc/NEWS.d/next/Build/2026-01-15-03-36-16.gh-issue-143842.EZLutl.rst Added NEWS entry documenting the build fix for static builds with curses

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Fidget-Spinner Fidget-Spinner merged commit 499706b into python:main Jan 14, 2026
72 of 73 checks passed
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.

COLORS variable in Python/optimization.c can conflict with ncurses symbol

2 participants