Skip to content

GH-139727: Add --enable-stackref-debug flag to build.bat to enable Py_STACKREF_DEBUG build on Windows - #139728

Merged
zooba merged 3 commits into
python:mainfrom
sergey-miryanov:139727-stackref-debug-on-windows
Nov 21, 2025
Merged

GH-139727: Add --enable-stackref-debug flag to build.bat to enable Py_STACKREF_DEBUG build on Windows#139728
zooba merged 3 commits into
python:mainfrom
sergey-miryanov:139727-stackref-debug-on-windows

Conversation

@sergey-miryanov

@sergey-miryanovsergey-miryanov commented Oct 7, 2025

Copy link
Copy Markdown
Contributor

Working on #139384 I discovered that build.bat does not have easy way to enable Py_STACKREF_DEBUG build.

@sergey-miryanov

Copy link
Copy Markdown
ContributorAuthor

@zooba Could you please take a look? Is this a right way to add some specific flags to builds?

@zooba

Copy link
Copy Markdown
Member

Looks fine, does the CLI argument match the equivalent option to configure?

@efimov-mikhail

efimov-mikhail commented Nov 19, 2025

Copy link
Copy Markdown
Member

Looks fine, does the CLI argument match the equivalent option to configure?

Actually, there's no such option to configure.
I'd like to add this in some future PR, I've already tested those changes locally.

@zooba

Copy link
Copy Markdown
Member

Would it fit in? I mainly want the same option, and the configure maintainers are more opinionated about it, so let's make sure we pick a name that they'll be happy with.

@efimov-mikhail

Copy link
Copy Markdown
Member

I'm thinking about the following options:

--enable-stackref-debug[=no|yes|closed]

And this logic on it:

case $enable_stackref_debug in
no) stackref_debug_flags="" ;;
yes) stackref_debug_flags="-DPy_STACKREF_DEBUG" ;;
closed) stackref_debug_flags="-DPy_STACKREF_DEBUG -DPy_STACKREF_CLOSE_DEBUG" ;;

But at the time it's only my suggestion.

@sergey-miryanov

Copy link
Copy Markdown
ContributorAuthor

I'm OK with @efimov-mikhail suggestion. I'm also open to updating this PR accordingly.

@zooba

Copy link
Copy Markdown
Member

Hmm, except we don't really have any options with values. Let's just rename to --enable-stackref-debug and not support =<no|yes|etc.> in build.bat - that should be the same as the other options we've got.

If the eventual configure argument gets its name changed, we can update to match. The build.bat interface isn't really public API, so it can change more easily than Python.

@sergey-miryanov

Copy link
Copy Markdown
ContributorAuthor

@zooba I renamed it. Could you please take a look?

@zooba

Copy link
Copy Markdown
Member

Looks good to me now. Anything else you need to do, or is this good to merge?

@sergey-miryanov

Copy link
Copy Markdown
ContributorAuthor

It is good to merge.

@zooba
zooba merged commit a8733cb into python:mainNov 21, 2025
44 checks passed
@sergey-miryanov

Copy link
Copy Markdown
ContributorAuthor

Thanks!

@sergey-miryanovsergey-miryanov changed the title GH-139727: Add --stackref-debug flag to build.bat to enable Py_STACKREF_DEBUG build on WindowsGH-139727: Add --enable-stackref-debug flag to build.bat to enable Py_STACKREF_DEBUG build on WindowsNov 21, 2025
@sergey-miryanov
sergey-miryanov deleted the 139727-stackref-debug-on-windows branch November 21, 2025 12:19
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
ashm-dev pushed a commit to ashm-dev/cpython that referenced this pull request Dec 8, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@sergey-miryanov@zooba@efimov-mikhail