Fix precompiling CoreRoot overlay with crossgen for Windows arm/arm64 (dotnet/coreclr...
authorSergiy Kuryata <sergeyk@microsoft.com>
Mon, 15 Apr 2019 23:07:35 +0000 (16:07 -0700)
committerGitHub <noreply@github.com>
Mon, 15 Apr 2019 23:07:35 +0000 (16:07 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/a49cc4ad01b51b26165c371579be763c5ccc30f5

src/coreclr/build-test.cmd

index 774bd7c..424232e 100644 (file)
@@ -358,7 +358,7 @@ if exist "%CORE_ROOT%" rd /s /q "%CORE_ROOT%"
 if exist "%CORE_ROOT_STAGE%" rd /s /q "%CORE_ROOT_STAGE%"
 md "%CORE_ROOT%"
 md "%CORE_ROOT_STAGE%"
-xcopy "%__BinDir%" "%CORE_ROOT_STAGE%"
+xcopy /s "%__BinDir%" "%CORE_ROOT_STAGE%"
 
 REM =========================================================================================
 REM ===
@@ -562,7 +562,11 @@ echo "%2" | findstr /b "xunit." >nul && (
   exit /b 0
 )
 
-"%CORE_ROOT_STAGE%\crossgen.exe" /Platform_Assemblies_Paths "%CORE_ROOT%" /in "%1" /out "%CORE_ROOT%/temp.ni.dll" >nul 2>nul
+set __CrossgenExe="%CORE_ROOT_STAGE%\crossgen.exe"
+if /i "%__BuildArch%" == "arm" ( set __CrossgenExe="%CORE_ROOT_STAGE%\x86\crossgen.exe" )
+if /i "%__BuildArch%" == "arm64" ( set __CrossgenExe="%CORE_ROOT_STAGE%\x64\crossgen.exe" )
+
+"%__CrossgenExe%" /Platform_Assemblies_Paths "%CORE_ROOT%" /in "%1" /out "%CORE_ROOT%/temp.ni.dll" >nul 2>nul
 set /a __exitCode = %errorlevel%
 if "%__exitCode%" == "-2146230517" (
     echo %2 is not a managed assembly.
@@ -570,7 +574,7 @@ if "%__exitCode%" == "-2146230517" (
 )
 
 if %__exitCode% neq 0 (
-    echo Unable to precompile %2
+    echo Unable to precompile %2, Exit Code is %__exitCode%
     exit /b 0
 )