From adb4f38ca021e298c008d106e40a9e1835dae40c Mon Sep 17 00:00:00 2001 From: Manish Godse <61718172+mangod9@users.noreply.github.com> Date: Thu, 29 Jul 2021 10:56:07 -0700 Subject: [PATCH] undo gcname while running crossgen2 within standalone CI (#56361) * undo gcname while running crossgen2 * Fix couple more R2R tests to ignore standalone gc * Fix comments based on CR --- src/tests/Common/CLRTest.CrossGen.targets | 6 ++++++ src/tests/readytorun/multifolder/multifolder.csproj | 10 ++++++++++ src/tests/readytorun/r2rdump/FrameworkTests/R2RDumpTester.cs | 2 ++ 3 files changed, 18 insertions(+) diff --git a/src/tests/Common/CLRTest.CrossGen.targets b/src/tests/Common/CLRTest.CrossGen.targets index 8557a71..9c5ad60 100644 --- a/src/tests/Common/CLRTest.CrossGen.targets +++ b/src/tests/Common/CLRTest.CrossGen.targets @@ -82,9 +82,11 @@ if [ ! -z ${RunCrossGen2+x} ]%3B then local gcStressModeToRestore=$COMPlus_GCStress; local heapVerifyModeToRestore=$COMPlus_HeapVerify; local readyToRunModeToRestore=$COMPlus_ReadyToRun; + local gcstandaloneModeToRestore=$COMPlus_GCName; export COMPlus_GCStress= export COMPlus_HeapVerify= export COMPlus_ReadyToRun= + unset COMPlus_GCName __Command=$_DebuggerFullPath # Tests run locally need __TestDotNetCmd (set by runtest.py) or a compatible 5.0 dotnet runtime in the path @@ -113,6 +115,7 @@ if [ ! -z ${RunCrossGen2+x} ]%3B then $__Command __cg2ExitCode=$? + export COMPlus_GCName=$gcstandaloneModeToRestore export COMPlus_GCStress=$gcStressModeToRestore export COMPlus_HeapVerify=$heapVerifyModeToRestore export COMPlus_ReadyToRun=$readyToRunModeToRestore @@ -219,6 +222,8 @@ if defined RunCrossGen2 ( set COMPlus_HeapVerify= set __readyToRunModeToRestore=!COMPlus_ReadyToRun! set COMPlus_ReadyToRun= + set __gcStandaloneModeToRestore=!COMPlus_GCName! + set COMPlus_GCName= set __Command=!_DebuggerFullPath! REM Tests run locally need __TestDotNetCmd (set by runtest.py) or a compatible 5.0 dotnet runtime in the path @@ -253,6 +258,7 @@ if defined RunCrossGen2 ( set COMPlus_GCStress=!__gcStressModeToRestore! set COMPlus_HeapVerify=!__heapVerifyModeToRestore! set COMPlus_ReadyToRun=!__readyToRunModeToRestore! + set COMPlus_GCName=!__gcStandaloneModeToRestore! Exit /b 0 diff --git a/src/tests/readytorun/multifolder/multifolder.csproj b/src/tests/readytorun/multifolder/multifolder.csproj index 6b73ae6..4013343 100644 --- a/src/tests/readytorun/multifolder/multifolder.csproj +++ b/src/tests/readytorun/multifolder/multifolder.csproj @@ -40,6 +40,10 @@ $(CLRTestBatchPreCommands) echo %scriptPath%\..\FolderA\FolderA\FolderA.dll>>%__ResponseFile% echo %scriptPath%\..\FolderB\FolderB\FolderB.dll>>%__ResponseFile% + REM Suppress GC stand alone mode for the duration of Crossgen2 execution + set __gcStandaloneModeToRestore=!COMPlus_GCName! + set COMPlus_GCName= + set __Command=%_DebuggerFullPath% REM Tests run locally need __TestDotNetCmd (set by runtest.py) or a compatible 5.0 dotnet runtime in the path if defined __TestDotNetCmd ( @@ -61,6 +65,7 @@ $(CLRTestBatchPreCommands) set ExePath=multifolder\multifolder.dll set COMPlus_NativeImageSearchPaths=%scriptPath% + set COMPlus_GCName=!__gcStandaloneModeToRestore! ]]> >$__ResponseFile echo $__OutputDir/../FolderB/FolderB/FolderB.dll>>$__ResponseFile + # Suppress GC standalone mode for the duration of Crossgen2 execution + local gcstandaloneModeToRestore=$COMPlus_GCName; + unset COMPlus_GCName + __Command=$_DebuggerFullPath # Tests run locally need __TestDotNetCmd (set by runtest.py) or a compatible 5.0 dotnet runtime in the path if [ ! -z ${__TestDotNetCmd+x} ] %3B then @@ -99,6 +108,7 @@ $(BashCLRTestPreCommands) ExePath=multifolder/multifolder.dll export COMPlus_NativeImageSearchPaths=$__OutputDir + export COMPlus_GCName=$gcstandaloneModeToRestore ]]> diff --git a/src/tests/readytorun/r2rdump/FrameworkTests/R2RDumpTester.cs b/src/tests/readytorun/r2rdump/FrameworkTests/R2RDumpTester.cs index 18c1f0c..155fd38 100644 --- a/src/tests/readytorun/r2rdump/FrameworkTests/R2RDumpTester.cs +++ b/src/tests/readytorun/r2rdump/FrameworkTests/R2RDumpTester.cs @@ -46,6 +46,8 @@ namespace R2RDumpTests string CoreLibAbsolutePath = Path.Combine(CoreRootVar, CoreLibFile); string OutputFile = Path.GetTempFileName(); string TestDotNetCmdVar = Environment.GetEnvironmentVariable("__TestDotNetCmd"); + // Unset COMPlus_GCName since standalone GC doesnt exist in official "dotnet" deployment + Environment.SetEnvironmentVariable("COMPlus_GCName", String.Empty); string DotNetAbsolutePath = string.IsNullOrEmpty(TestDotNetCmdVar) ? FindExePath("dotnet") : TestDotNetCmdVar; ProcessStartInfo processStartInfo = new ProcessStartInfo -- 2.7.4