GH-143842: Make optimizer color table static#143846
Merged
Fidget-Spinner merged 1 commit intopython:mainfrom Jan 14, 2026
Merged
GH-143842: Make optimizer color table static#143846Fidget-Spinner merged 1 commit intopython:mainfrom
Fidget-Spinner merged 1 commit intopython:mainfrom
Conversation
There was a problem hiding this comment.
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
COLORSarray 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes GH-143842.
When building a static Python with PGO+LTO and a static
_cursesextension, the optimizer’sCOLORSarray collided with the cursesCOLORSsymbol. Make the optimizer color tablestaticto avoid the global symbol clash.Tests: not run (build fix only).