Skip to content

Commit 5c5dae0

Browse files
authored
gh-148644: Propagate the PGO job exit code in PCbuild/build.bat (GH-148645)
1 parent 789120e commit 5c5dae0

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Errors during the PGO training job on Windows are no longer ignored, and a non-zero return code will cause the build to fail.

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)