Refactor derive_setup_local function in the pythonbuild.cpython module - #1235
Merged
Conversation
jjhelmus
marked this pull request as ready for review
August 26, 2026 20:09
ewdurbin
approved these changes
Aug 27, 2026
Comment on lines
+676
to
+681
| # makesetup interprets lines containing = as configuration options. Move | ||
| # -Dname=value defines into Makefile overrides for legacy Python builds. | ||
| if not use_setup_stdlib: | ||
| for match in define_pattern.finditer(parsed["line"]): | ||
| for obj_path in sorted(parsed["posix_obj_paths"]): | ||
| extra_cflags.setdefault(bytes(obj_path), []).append(match.group(0)) |
Contributor
There was a problem hiding this comment.
a little nit, but passing in the extra_cflags just to mutate them in the function feels a little surprising given the name. should this function return the flags that need added and let the caller apply them?
Contributor
Author
There was a problem hiding this comment.
Good catch. I spotted this in one of the run throughs but never got a fix in.
I'll address this in #1237 as that shuffles this block around further.
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.
Refactor
derive_setup_localinto smaller, typed helpers while preserving existing extension module configuration and linkage behavior.