Skip to content

Commit

Permalink
Fix initializing BuildTools when the Platform environment variable is…
Browse files Browse the repository at this point in the history
… set (dotnet/coreclr#24998)

* Make build-test.cmd exit if init-tools.cmd fails

* Clear Platform variable before initializing BuildTools


Commit migrated from dotnet/coreclr@a0486f5
  • Loading branch information
elinor-fung authored Jun 6, 2019
1 parent b2228fa commit 85708d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/coreclr/build-test.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions src/coreclr/init-tools.cmd
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 85708d8

Please sign in to comment.