summaryrefslogtreecommitdiff
path: root/build-test.cmd
diff options
context:
space:
mode:
authorRuss Keldorph <Russ.Keldorph@microsoft.com>2018-12-05 15:58:32 -0800
committerRuss Keldorph <russ.keldorph@microsoft.com>2018-12-06 11:08:16 -0800
commit1c8dd79c74e8021f5e2fb9c05116e69848470c87 (patch)
tree633d142bcb67510a018d442b911c08de93aab227 /build-test.cmd
parent588faa52bd2269ca3158c2b0c9199b0b9f90ec11 (diff)
downloadcoreclr-1c8dd79c74e8021f5e2fb9c05116e69848470c87.tar.gz
coreclr-1c8dd79c74e8021f5e2fb9c05116e69848470c87.tar.bz2
coreclr-1c8dd79c74e8021f5e2fb9c05116e69848470c87.zip
Work around apparent bug in CMD's FOR /L
Hopefully this will mean that official build failures during the actual build phase will correctly be reported as failures. There could be other places that need to change, but this is all we know of right now. Fixes #18788 (at least part of it)
Diffstat (limited to 'build-test.cmd')
-rw-r--r--build-test.cmd8
1 files changed, 7 insertions, 1 deletions
diff --git a/build-test.cmd b/build-test.cmd
index 17ce589b86..a12fa097c6 100644
--- a/build-test.cmd
+++ b/build-test.cmd
@@ -343,7 +343,10 @@ for /l %%G in (1, 1, %__BuildLoopCount%) do (
echo %__BuildLog%
echo %__BuildWrn%
echo %__BuildErr%
- exit /b 1
+ REM This is necessary because of a(n apparent) bug in the FOR /L command. Under certain circumstances,
+ REM such as when this script is invoke with CMD /C "build-test.cmd", a non-zero exit directly from
+ REM within the loop body will not propagate to the caller. For some reason, goto works around it.
+ goto :Exit_Failure
)
set __SkipPackageRestore=true
@@ -633,3 +636,6 @@ ren "%CORE_ROOT%\temp.ni.dll" %2
echo Successfully precompiled %2
exit /b 0
+
+:Exit_Failure
+exit /b 1