Skip to content

Commit b1382ac

Browse files
committed
gh-148644: propagate PGO job exit code in PCbuild/build.bat
Replace the `if "%clean%"=="false" (...)` block with a `goto :RunPgoJob` so the job runs outside any parenthesized block, where `%ERRORLEVEL%` is not subject to eager evaluation. Save the exit code before `call :Kill` resets it, then propagate it if non-zero.
1 parent 1f6a09f commit b1382ac

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

PCbuild/build.bat

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,16 +170,20 @@ if "%do_pgo%"=="true" (
170170
del /s "%dir%\*.pgc"
171171
del /s "%dir%\..\Lib\*.pyc"
172172
set conf=PGUpdate
173-
if "%clean%"=="false" (
174-
echo on
175-
call "%dir%\..\python.bat" %pgo_job%
176-
@echo off
177-
call :Kill
178-
set target=Build
179-
)
173+
if "%clean%"=="false" goto :RunPgoJob
180174
)
181175
goto :Build
182176

177+
:RunPgoJob
178+
echo on
179+
call "%dir%\..\python.bat" %pgo_job%
180+
@echo off
181+
set pgo_errorlevel=%ERRORLEVEL%
182+
call :Kill
183+
if %pgo_errorlevel% NEQ 0 exit /B %pgo_errorlevel%
184+
set target=Build
185+
goto :Build
186+
183187
:Kill
184188
echo on
185189
%MSBUILD% "%dir%\pythoncore.vcxproj" /t:KillPython %verbose%^

0 commit comments

Comments
 (0)