Skip to content

Commit e9da96f

Browse files
authored
Merge pull request #69582 from compnerd/early-exit
build: early exit on error
2 parents ff371f9 + 7ad5526 commit e9da96f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

utils/build-windows-toolchain.bat

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ echo set SKIP_UPDATE_CHECKOUT=%SKIP_UPDATE_CHECKOUT%>> %TEMP%\call-build.cmd
2525
echo set REPO_SCHEME=%REPO_SCHEME%>> %TEMP%\call-build.cmd
2626
echo "%~f0">> %TEMP%\call-build.cmd
2727
start /i /b /wait cmd.exe /env=default /c "%TEMP%\call-build.cmd"
28+
set ec=%errorlevel%
2829
del %TEMP%\call-build.cmd
29-
exit /b
30+
exit /b %ec%
3031

3132
:Start
3233

@@ -43,7 +44,7 @@ set BuildRoot=%SourceRoot%\build
4344

4445
md %BuildRoot%
4546
subst T: /d
46-
subst T: %BuildRoot% || (exit /b)
47+
subst T: %BuildRoot% || (exit /b 1)
4748
set BuildRoot=T:
4849

4950
:: Identify the PackageRoot
@@ -70,7 +71,7 @@ if "%TestArg:~-1%"=="," (set TestArg=%TestArg:~0,-1%) else (set TestArg= )
7071
set SkipPackagingArg=-SkipPackaging
7172
if not "%SKIP_PACKAGING%"=="1" set "SkipPackagingArg= "
7273

73-
call :CloneRepositories || (exit /b)
74+
call :CloneRepositories || (exit /b 1)
7475

7576
:: We only have write access to BuildRoot, so use that as the image root.
7677
powershell.exe -ExecutionPolicy RemoteSigned -File %~dp0build.ps1 ^
@@ -80,7 +81,7 @@ powershell.exe -ExecutionPolicy RemoteSigned -File %~dp0build.ps1 ^
8081
-BuildType %CMAKE_BUILD_TYPE% ^
8182
%SkipPackagingArg% ^
8283
%TestArg% ^
83-
-Stage %PackageRoot%
84+
-Stage %PackageRoot% || (exit /b 1)
8485

8586
:: Clean up the module cache
8687
rd /s /q %LocalAppData%\clang\ModuleCache

0 commit comments

Comments
 (0)