Skip to content

Commit a8733cb

Browse files
GH-139727: Add --enable-stackref-debug flag to build.bat to enable Py_STACKREF_DEBUG build on Windows (GH-139728)
1 parent 20b69aa commit a8733cb

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

PCbuild/build.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ echo. --experimental-jit-off Ditto but off by default (PYTHON_JIT=1 enable
4141
echo. --experimental-jit-interpreter Enable the experimental Tier 2 interpreter.
4242
echo. --pystats Enable PyStats collection.
4343
echo. --tail-call-interp Enable tail-calling interpreter (requires LLVM 19 or higher).
44+
echo. --enable-stackref-debug Enable stackref debugging mode.
4445
echo.
4546
echo.Available flags to avoid building certain modules.
4647
echo.These flags have no effect if '-e' is not given:
@@ -98,6 +99,7 @@ if "%~1"=="--experimental-jit-interpreter-off" (set UseTIER2=6) & shift & goto C
9899
if "%~1"=="--without-remote-debug" (set DisableRemoteDebug=true) & shift & goto CheckOpts
99100
if "%~1"=="--pystats" (set PyStats=1) & shift & goto CheckOpts
100101
if "%~1"=="--tail-call-interp" (set UseTailCallInterp=true) & shift & goto CheckOpts
102+
if "%~1"=="--enable-stackref-debug" (set StackRefDebug=true) & shift & goto CheckOpts
101103
rem These use the actual property names used by MSBuild. We could just let
102104
rem them in through the environment, but we specify them on the command line
103105
rem anyway for visibility so set defaults after this
@@ -202,6 +204,7 @@ echo on
202204
/p:PyStats=%PyStats%^
203205
/p:UseTailCallInterp=%UseTailCallInterp%^
204206
/p:DisableRemoteDebug=%DisableRemoteDebug%^
207+
/p:StackRefDebug=%StackRefDebug%^
205208
%1 %2 %3 %4 %5 %6 %7 %8 %9
206209

207210
@echo off

PCbuild/pythoncore.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
<PreprocessorDefinitions Condition="'$(UseTailCallInterp)' == 'true'">_Py_TAIL_CALL_INTERP=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
111111
<PreprocessorDefinitions Condition="'$(WITH_COMPUTED_GOTOS)' != ''">HAVE_COMPUTED_GOTOS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
112112
<PreprocessorDefinitions Condition="'$(DisableRemoteDebug)' != 'true'">Py_REMOTE_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
113+
<PreprocessorDefinitions Condition="'$(StackRefDebug)' == 'true'">Py_STACKREF_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
113114
</ClCompile>
114115
<Link>
115116
<AdditionalDependencies>version.lib;ws2_32.lib;pathcch.lib;bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>

0 commit comments

Comments
 (0)