From 79c6554807a731cf97b6b50d9b3864278cac76b2 Mon Sep 17 00:00:00 2001 From: Adeel <3840695+am11@users.noreply.github.com> Date: Sat, 7 Jan 2023 02:01:40 +0200 Subject: [PATCH] Skip checked builds from AOT --- .../Microsoft.NETCore.App.Crossgen2.sfxproj | 2 +- src/tests/Common/Directory.Build.targets | 45 +++++++++-------- src/tests/Directory.Build.targets | 48 ++++++++----------- src/tests/build.cmd | 7 +++ src/tests/build.sh | 8 +++- 5 files changed, 57 insertions(+), 53 deletions(-) diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj index e35711d568345..b388179a6ce9d 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj @@ -65,7 +65,7 @@ + Condition="'$(TargetOS)' == '$(HostOS)' and '$(TargetArchitecture)' == '$(BuildArchitecture)' and '$(SkipRunPublishedCrossgen)' != 'true'"> diff --git a/src/tests/Common/Directory.Build.targets b/src/tests/Common/Directory.Build.targets index 41bc13f9928b1..c48199c064245 100644 --- a/src/tests/Common/Directory.Build.targets +++ b/src/tests/Common/Directory.Build.targets @@ -18,6 +18,8 @@ true true + true + true @@ -30,6 +32,24 @@ + + + + + + + @@ -92,11 +112,6 @@ - - + TargetDir="../crossgen2/" /> @@ -185,23 +200,7 @@ - - - - - - 0 $(NoWarn);CS2008 + true + true + + + + + + @@ -487,11 +507,6 @@ - - - True - - @@ -510,11 +525,6 @@ - - - - @@ -586,22 +594,6 @@ - - - - - - diff --git a/src/tests/build.cmd b/src/tests/build.cmd index 57c656ac2789a..9b432f8f28b5e 100644 --- a/src/tests/build.cmd +++ b/src/tests/build.cmd @@ -140,6 +140,7 @@ set "__BinDir=%__RootBinDir%\bin\coreclr\%__OSPlatformConfig%" set "__TestRootDir=%__RootBinDir%\tests\coreclr" set "__TestBinDir=%__TestRootDir%\%__OSPlatformConfig%" set "__TestIntermediatesDir=%__TestRootDir%\obj\%__OSPlatformConfig%" +set "CORE_ROOT=%__TestBinDir%\Tests\Core_Root" if "%__RebuildTests%" == "1" ( echo Removing test build dir^: !__TestBinDir! @@ -305,6 +306,12 @@ REM === REM ========================================================================================= :TestBuildDone +REM copy crossgen2 from temp location to destination. +REM without going through the temp location, MSBuild +REM fails to compute globs correctly. +rmdir /s /q "%CORE_ROOT%\crossgen2" 2>null +move "%CORE_ROOT%\..\crossgen2" "%CORE_ROOT%\crossgen2" 2>nul + echo %__MsgPrefix%Test build succeeded. Finished at %TIME% echo %__MsgPrefix%Test binaries are available at !__TestBinDir! exit /b 0 diff --git a/src/tests/build.sh b/src/tests/build.sh index 024af2df6ffee..ff647a706fe61 100755 --- a/src/tests/build.sh +++ b/src/tests/build.sh @@ -339,7 +339,6 @@ __Mono=0 __MonoAot=0 __MonoFullAot=0 __BuildLogRootName="TestBuild" -CORE_ROOT= source $__RepoRootDir/src/coreclr/_build-commons.sh @@ -387,6 +386,7 @@ __IntermediatesDir="$__RootBinDir/obj/coreclr/$__OSPlatformConfig" __TestIntermediatesDir="$__RootBinDir/tests/coreclr/obj/$__OSPlatformConfig" __CrossCompIntermediatesDir="$__IntermediatesDir/crossgen" __MonoBinDir="$__RootBinDir/bin/mono/$__OSPlatformConfig" +CORE_ROOT="$__TestBinDir/Tests/Core_Root" # CI_SPECIFIC - On CI machines, $HOME may not be set. In such a case, create a subfolder and set the variable to it. # This is needed by CLI to function. @@ -417,6 +417,12 @@ fi echo "${__MsgPrefix}Test build successful." echo "${__MsgPrefix}Test binaries are available at ${__TestBinDir}" +# copy crossgen2 from temp location to destination. +# without going through the temp location, MSBuild +# fails to compute globs correctly. +rm -rf "$CORE_ROOT/crossgen2" +mv "$CORE_ROOT/../crossgen2" "$CORE_ROOT/crossgen2" 2>/dev/null || true + if [[ "$__RunTests" -ne 0 ]]; then echo "Run Tests..."