summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElinor Fung <47805090+elinor-fung@users.noreply.github.com>2019-06-06 14:03:18 -0700
committerGitHub <noreply@github.com>2019-06-06 14:03:18 -0700
commita0486f5970ed63a7e7fb987f9a22fc8349574505 (patch)
treea3fbb230a1d01fac06648d5b2ee97c05e0dd7d6b
parentca0dfce733ed41503b70a0dec4358bf110255b9f (diff)
downloadcoreclr-a0486f5970ed63a7e7fb987f9a22fc8349574505.tar.gz
coreclr-a0486f5970ed63a7e7fb987f9a22fc8349574505.tar.bz2
coreclr-a0486f5970ed63a7e7fb987f9a22fc8349574505.zip
Fix initializing BuildTools when the Platform environment variable is set (#24998)
* Make build-test.cmd exit if init-tools.cmd fails * Clear Platform variable before initializing BuildTools
-rw-r--r--build-test.cmd3
-rw-r--r--init-tools.cmd4
2 files changed, 7 insertions, 0 deletions
diff --git a/build-test.cmd b/build-test.cmd
index e1400c42d9..39c38d415e 100644
--- a/build-test.cmd
+++ b/build-test.cmd
@@ -166,6 +166,9 @@ REM ===
REM =========================================================================================
call "%__ProjectDir%\init-tools.cmd"
+if NOT [%ERRORLEVEL%]==[0] (
+ exit /b %ERRORLEVEL%
+)
@if defined _echo @echo on
set "__ToolsDir=%__ProjectDir%\Tools"
diff --git a/init-tools.cmd b/init-tools.cmd
index 32634ece12..0905e913b9 100644
--- a/init-tools.cmd
+++ b/init-tools.cmd
@@ -1,6 +1,10 @@
@if not defined _echo @echo off
setlocal
+:: Clear the 'Platform' environment variable for this session
+:: This avoids overriding the default value from BuildTools projects used for initialization
+set Platform=
+
set INIT_TOOLS_LOG=%~dp0init-tools.log
if [%PACKAGES_DIR%]==[] set PACKAGES_DIR=%~dp0.packages
if [%TOOLRUNTIME_DIR%]==[] set TOOLRUNTIME_DIR=%~dp0Tools