From 8adc238e26b5f199103430247f7ed3cd127adfb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Thu, 18 Apr 2024 10:57:04 +0200 Subject: [PATCH 1/6] Run trimming tests as AOT tests Not everything is passing, so I baselined this. Some we'll probably exclude permanently, others are more concerning and we need to determine if it's test issues or product issues. --- .../linker/SupportFiles/Directory.Build.props | 1 + eng/testing/linker/trimmingTests.targets | 4 ++-- src/libraries/tests.proj | 16 ++++++++++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/eng/testing/linker/SupportFiles/Directory.Build.props b/eng/testing/linker/SupportFiles/Directory.Build.props index 5a54c83e569231..4e33801ab12837 100644 --- a/eng/testing/linker/SupportFiles/Directory.Build.props +++ b/eng/testing/linker/SupportFiles/Directory.Build.props @@ -11,6 +11,7 @@ false true + true $(NoWarn);IL2121 diff --git a/eng/testing/linker/trimmingTests.targets b/eng/testing/linker/trimmingTests.targets index 926bafa52cfef4..4db54d492b8290 100644 --- a/eng/testing/linker/trimmingTests.targets +++ b/eng/testing/linker/trimmingTests.targets @@ -88,7 +88,7 @@ .Replace('{NetCoreAppMaximumVersion}', '$(NetCoreAppMaximumVersion)') .Replace('{UseMonoRuntime}','$(UseMonoRuntime)') .Replace('{RuntimeIdentifier}','%(TestConsoleApps.TestRuntimeIdentifier)') - .Replace('{PublishAot}','$(IsNativeAotTestProject)') + .Replace('{PublishAot}','$(RunNativeAotTestApps)') .Replace('{ExtraTrimmerArgs}', '%(TestConsoleApps.ExtraTrimmerArgs)') .Replace('{AdditionalProperties}', '$(_additionalPropertiesString)') .Replace('{ToolsILLinkDir}', '$(ToolsILLinkDir)') @@ -142,7 +142,7 @@ + Properties="Configuration=$(Configuration);BuildProjectReferences=false;TargetOS=$(TargetOS);TargetArchitecture=$(TargetArchitecture);_IsPublishing=true" /> - + + + + + + + + + + + From 156a35950ba0096fa230e0cc04bf25421935f38e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Thu, 18 Apr 2024 14:49:44 +0200 Subject: [PATCH 2/6] Dummy change to trigger the legs that test this --- src/coreclr/nativeaot/Bootstrap/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/nativeaot/Bootstrap/main.cpp b/src/coreclr/nativeaot/Bootstrap/main.cpp index 16ffe8f9dbcb06..8772e4d92ba8db 100644 --- a/src/coreclr/nativeaot/Bootstrap/main.cpp +++ b/src/coreclr/nativeaot/Bootstrap/main.cpp @@ -228,7 +228,7 @@ int main(int argc, char* argv[]) #ifdef HAS_ADDRESS_SANITIZER // We need to build the bootstrapper as a single object file, to ensure // the linker can detect that we have ASAN components early enough in the build. -// Include our asan support sources for executable projects here to ensure they +// Include our ASAN support sources for executable projects here to ensure they // are compiled into the bootstrapper object. #include "minipal/asansupport.cpp" #endif // HAS_ADDRESS_SANITIZER From 83799e89cbb31b872729386f876d373486ca5073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Fri, 19 Apr 2024 09:38:39 +0200 Subject: [PATCH 3/6] Revert "Dummy change to trigger the legs that test this" This reverts commit 156a35950ba0096fa230e0cc04bf25421935f38e. --- src/coreclr/nativeaot/Bootstrap/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/nativeaot/Bootstrap/main.cpp b/src/coreclr/nativeaot/Bootstrap/main.cpp index 8772e4d92ba8db..16ffe8f9dbcb06 100644 --- a/src/coreclr/nativeaot/Bootstrap/main.cpp +++ b/src/coreclr/nativeaot/Bootstrap/main.cpp @@ -228,7 +228,7 @@ int main(int argc, char* argv[]) #ifdef HAS_ADDRESS_SANITIZER // We need to build the bootstrapper as a single object file, to ensure // the linker can detect that we have ASAN components early enough in the build. -// Include our ASAN support sources for executable projects here to ensure they +// Include our asan support sources for executable projects here to ensure they // are compiled into the bootstrapper object. #include "minipal/asansupport.cpp" #endif // HAS_ADDRESS_SANITIZER From 4150e0b7b37cfda6b87e72692370581796261abf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Fri, 19 Apr 2024 09:39:00 +0200 Subject: [PATCH 4/6] FB --- Directory.Build.props | 10 +++--- eng/testing/linker/trimmingTests.props | 4 ++- eng/testing/linker/trimmingTests.targets | 3 ++ src/libraries/Directory.Build.props | 2 +- src/libraries/Directory.Build.targets | 2 +- ...stics.DiagnosticSource.NativeAotTests.proj | 10 ------ .../DiagnosticSourceEventSourceTests.cs | 0 .../System.Diagnostics.DiagnosticSource.proj | 2 ++ src/libraries/tests.proj | 31 ++++++++----------- 9 files changed, 27 insertions(+), 37 deletions(-) delete mode 100644 src/libraries/System.Diagnostics.DiagnosticSource/tests/NativeAotTests/System.Diagnostics.DiagnosticSource.NativeAotTests.proj rename src/libraries/System.Diagnostics.DiagnosticSource/tests/{NativeAotTests => TrimmingTests}/DiagnosticSourceEventSourceTests.cs (100%) diff --git a/Directory.Build.props b/Directory.Build.props index b1ac2559f9ed1e..ef0e8c1b44d76d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -397,12 +397,10 @@ true true - true - true - true + true - false + false @@ -413,7 +411,7 @@ '$(IsReferenceAssemblyProject)' != 'true' and '$(IsGeneratorProject)' != 'true' and '$(IsTestProject)' != 'true' and - '$(IsPublishedAppTestProject)' != 'true' and + '$(IsTrimmingTestProject)' != 'true' and '$(IsTestSupportProject)' != 'true' and '$(UsingMicrosoftDotNetSharedFrameworkSdk)' != 'true' and '$(MSBuildProjectExtension)' != '.pkgproj' and @@ -464,7 +462,7 @@ - + true diff --git a/eng/testing/linker/trimmingTests.props b/eng/testing/linker/trimmingTests.props index b917cd5fe38268..b822294a93d04c 100644 --- a/eng/testing/linker/trimmingTests.props +++ b/eng/testing/linker/trimmingTests.props @@ -1,6 +1,8 @@ - $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'trimmingTests')) + $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'trimmingTests')) + $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'aotTests')) + $([MSBuild]::NormalizeDirectory('$(TrimmingTestDir)', 'projects')) $(MSBuildThisFileDirectory)project.csproj.template true diff --git a/eng/testing/linker/trimmingTests.targets b/eng/testing/linker/trimmingTests.targets index 4db54d492b8290..0b2baf6fe46b68 100644 --- a/eng/testing/linker/trimmingTests.targets +++ b/eng/testing/linker/trimmingTests.targets @@ -81,6 +81,9 @@ <_additionalPropertiesString>@(_propertiesAsItems->'<%(Identity)>%(Value)</%(Identity)>', '%0a ') + + + - + diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index b219e7cf41a913..e3d599b2d8276a 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -131,7 +131,7 @@ - + diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/NativeAotTests/System.Diagnostics.DiagnosticSource.NativeAotTests.proj b/src/libraries/System.Diagnostics.DiagnosticSource/tests/NativeAotTests/System.Diagnostics.DiagnosticSource.NativeAotTests.proj deleted file mode 100644 index 8001203352b581..00000000000000 --- a/src/libraries/System.Diagnostics.DiagnosticSource/tests/NativeAotTests/System.Diagnostics.DiagnosticSource.NativeAotTests.proj +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/NativeAotTests/DiagnosticSourceEventSourceTests.cs b/src/libraries/System.Diagnostics.DiagnosticSource/tests/TrimmingTests/DiagnosticSourceEventSourceTests.cs similarity index 100% rename from src/libraries/System.Diagnostics.DiagnosticSource/tests/NativeAotTests/DiagnosticSourceEventSourceTests.cs rename to src/libraries/System.Diagnostics.DiagnosticSource/tests/TrimmingTests/DiagnosticSourceEventSourceTests.cs diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/TrimmingTests/System.Diagnostics.DiagnosticSource.proj b/src/libraries/System.Diagnostics.DiagnosticSource/tests/TrimmingTests/System.Diagnostics.DiagnosticSource.proj index ca9483e224ffb4..919c0b7614b145 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/tests/TrimmingTests/System.Diagnostics.DiagnosticSource.proj +++ b/src/libraries/System.Diagnostics.DiagnosticSource/tests/TrimmingTests/System.Diagnostics.DiagnosticSource.proj @@ -2,6 +2,8 @@ + diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 4d272e20de6808..145dcd12ee7395 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -649,29 +649,24 @@ BuildInParallel="$(BuildTestInParallel)" /> + + + + + + + + + + + + - - - - - - - - - - - - - - Date: Fri, 19 Apr 2024 09:47:31 +0200 Subject: [PATCH 5/6] Different pipeline --- eng/pipelines/coreclr/nativeaot-post-build-steps.yml | 8 -------- eng/pipelines/libraries/execute-trimming-tests-steps.yml | 6 ++++++ eng/pipelines/runtime-linker-tests.yml | 1 + 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/eng/pipelines/coreclr/nativeaot-post-build-steps.yml b/eng/pipelines/coreclr/nativeaot-post-build-steps.yml index 94761028f48ab0..bc29a657c456ce 100644 --- a/eng/pipelines/coreclr/nativeaot-post-build-steps.yml +++ b/eng/pipelines/coreclr/nativeaot-post-build-steps.yml @@ -21,11 +21,3 @@ steps: nativeAotTest: true helixQueues: ${{ parameters.helixQueues }} liveLibrariesBuildConfig: ${{ parameters.liveLibrariesBuildConfig }} - - # Can't run arm/arm64 tests on x64 build machines - - ${{ if and(ne(parameters.archType, 'arm'), ne(parameters.archType, 'arm64')) }}: - - # Publishing tooling doesn't support different configs between runtime and libs, so only run tests in Release config - - ${{ if eq(parameters.buildConfig, 'release') }}: - - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) -s libs.tests -c $(_BuildConfig) $(crossArg) $(_nativeSanitizersArg) /p:TestAssemblies=false /p:RunNativeAotTestApps=true $(_officialBuildParameter) /bl:$(Build.SourcesDirectory)/artifacts/log/$(buildConfigUpper)/NativeAotTests.binlog ${{ parameters.extraTestArgs }} - displayName: Run NativeAot Library Tests diff --git a/eng/pipelines/libraries/execute-trimming-tests-steps.yml b/eng/pipelines/libraries/execute-trimming-tests-steps.yml index 567abab0bb984e..13778ee0ab63a5 100644 --- a/eng/pipelines/libraries/execute-trimming-tests-steps.yml +++ b/eng/pipelines/libraries/execute-trimming-tests-steps.yml @@ -1,8 +1,14 @@ parameters: archType: '' extraTestArgs: '' + runAotTests: true steps: # Execute tests - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) -s libs.tests -c $(_BuildConfig) $(crossArg) /p:TestAssemblies=false /p:TestTrimming=true $(_officialBuildParameter) /bl:$(Build.SourcesDirectory)/artifacts/log/$(buildConfigUpper)/TrimmingTests.binlog ${{ parameters.extraTestArgs }} displayName: Run Trimming Tests + + # Execute AOT test app tests + - ${{ if eq(parameters.runAotTests, true) }}: + - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) -s libs.tests -c $(_BuildConfig) $(crossArg) /p:TestAssemblies=false /p:RunNativeAotTestApps=true $(_officialBuildParameter) /bl:$(Build.SourcesDirectory)/artifacts/log/$(buildConfigUpper)/NativeAotTestAppTests.binlog ${{ parameters.extraTestArgs }} + displayName: Run Native AOT Test App Tests diff --git a/eng/pipelines/runtime-linker-tests.yml b/eng/pipelines/runtime-linker-tests.yml index aec5e1057ac538..2b001b769f50f9 100644 --- a/eng/pipelines/runtime-linker-tests.yml +++ b/eng/pipelines/runtime-linker-tests.yml @@ -135,3 +135,4 @@ extends: - template: /eng/pipelines/libraries/execute-trimming-tests-steps.yml parameters: extraTestArgs: '/p:WasmBuildNative=false' + runAotTests: false From b070d3d090944143e3cd4570123d93f54ed499ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Mon, 22 Apr 2024 07:53:46 +0200 Subject: [PATCH 6/6] FB --- eng/testing/linker/trimmingTests.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/testing/linker/trimmingTests.targets b/eng/testing/linker/trimmingTests.targets index 0b2baf6fe46b68..9ff325e82972c0 100644 --- a/eng/testing/linker/trimmingTests.targets +++ b/eng/testing/linker/trimmingTests.targets @@ -81,7 +81,7 @@ <_additionalPropertiesString>@(_propertiesAsItems->'<%(Identity)>%(Value)</%(Identity)>', '%0a ') - +