From 4c2fb74aed961a30860969e6101f87b0da8482bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Thu, 1 Apr 2021 12:18:04 +0200 Subject: [PATCH 01/25] Enable libraries testing --- eng/pipelines/runtimelab.yml | 2 +- .../runtimelab-post-build-steps.yml | 5 ++ eng/testing/default.rd.xml | 81 +++++++++++++++++++ eng/testing/tests.singlefile.targets | 21 ++++- eng/testing/tests.targets | 4 + src/libraries/Directory.Build.props | 2 + src/libraries/externals.csproj | 36 ++++++++- src/libraries/src.proj | 2 + src/libraries/tests.proj | 8 +- 9 files changed, 155 insertions(+), 6 deletions(-) create mode 100644 eng/testing/default.rd.xml diff --git a/eng/pipelines/runtimelab.yml b/eng/pipelines/runtimelab.yml index 2ff30e4ac994..86e2546f7a17 100644 --- a/eng/pipelines/runtimelab.yml +++ b/eng/pipelines/runtimelab.yml @@ -106,7 +106,7 @@ stages: timeoutInMinutes: 100 isOfficialBuild: ${{ variables.isOfficialBuild }} testGroup: innerloop - buildArgs: -s nativeaot.objwriter+nativeaot+libs+nativeaot.packages -c release + buildArgs: -s nativeaot+libs+nativeaot.packages -c release extraStepsTemplate: /eng/pipelines/runtimelab/runtimelab-post-build-steps.yml extraStepsParameters: uploadIntermediateArtifacts: ${{ variables.isOfficialBuild }} diff --git a/eng/pipelines/runtimelab/runtimelab-post-build-steps.yml b/eng/pipelines/runtimelab/runtimelab-post-build-steps.yml index c7e98e32bc70..85e880424f7f 100644 --- a/eng/pipelines/runtimelab/runtimelab-post-build-steps.yml +++ b/eng/pipelines/runtimelab/runtimelab-post-build-steps.yml @@ -13,6 +13,11 @@ parameters: steps: - ${{ if ne(parameters.archType, 'arm64') }}: + + - ${{ if eq(parameters.buildConfig, 'Release') }}: + - script: $(Build.SourcesDirectory)$(scriptExt) libs.tests -c Release -test + displayName: Build and run libraries tests + # Build coreclr native test output - ${{ if eq(parameters.osGroup, 'windows') }}: - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) nativeaot $(buildConfigUpper) ${{ parameters.archType }} /p:NativeAotMultimodule=true /p:SmokeTestsOnly=${{ parameters.smokeTestsOnly }} diff --git a/eng/testing/default.rd.xml b/eng/testing/default.rd.xml new file mode 100644 index 000000000000..c0aaef61d251 --- /dev/null +++ b/eng/testing/default.rd.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eng/testing/tests.singlefile.targets b/eng/testing/tests.singlefile.targets index 85ee6deb32db..f91516c32056 100644 --- a/eng/testing/tests.singlefile.targets +++ b/eng/testing/tests.singlefile.targets @@ -12,7 +12,7 @@ chmod +rwx $(AssemblyName) && ./$(AssemblyName) - + true true true @@ -20,6 +20,25 @@ $(SingleFileHostSourcePath).exe + + $(TestNativeAotCompilerRootPath) + $(TargetArchitecture) + true + $(NoWarn);IL9700;IL9701;IL1005 + + + + + + + + + + + + + + diff --git a/eng/testing/tests.targets b/eng/testing/tests.targets index 17cee3f712d6..d756ad54a5fd 100644 --- a/eng/testing/tests.targets +++ b/eng/testing/tests.targets @@ -20,6 +20,10 @@ $(RunScriptHostDir)dotnet + + true + + PrepareForRun diff --git a/src/libraries/Directory.Build.props b/src/libraries/Directory.Build.props index 724c8c1fbf89..205272590389 100644 --- a/src/libraries/Directory.Build.props +++ b/src/libraries/Directory.Build.props @@ -147,7 +147,9 @@ $(ArtifactsBinDir)pkg\aspnetcoreapp\lib $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'testhost', '$(BuildSettings)')) + $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'testaotc', '$(BuildSettings)')) $([MSBuild]::NormalizeDirectory('$(TestHostRootPath)', 'shared', '$(MicrosoftNetCoreAppFrameworkName)', '$(ProductVersion)')) + $([MSBuild]::NormalizeDirectory('$(TestNativeAotCompilerRootPath)', 'framework')) $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'microsoft.netcore.app.ref')) $([MSBuild]::NormalizeDirectory('$(MicrosoftNetCoreAppRefPackDir)', 'ref', '$(NetCoreAppCurrent)')) diff --git a/src/libraries/externals.csproj b/src/libraries/externals.csproj index bba05ff545da..ab1e7e4400dc 100644 --- a/src/libraries/externals.csproj +++ b/src/libraries/externals.csproj @@ -2,7 +2,7 @@ $(PackageRID) - true + true $(NetCoreAppCurrent) false @@ -26,7 +26,8 @@ + AfterTargets="AfterResolveReferences" + Condition="'$(ClrNativeAot)' != 'true'"> true @@ -61,7 +62,7 @@ + Condition="'$(RuntimeFlavor)' != 'Mono' and '$(ClrNativeAot)' != 'true'"> @@ -77,6 +78,35 @@ + + + <_CompilerFiles Include="$(CoreCLRILCompilerDir)*" /> + <_AotSdkFiles Include="$(CoreCLRAotSdkDir)*" /> + <_BuildIntegrationFiles Include="$(CoreCLRBuildIntegrationDir)*" /> + <_TaskFiles Include="$(CoreCLRILCompilerDir)netstandard\*" /> + + + + + + + + + + <_allSrc Include="$(MSBuildThisFileDirectory)*\src\*.csproj" Exclude="@(ProjectExclusions)" /> - + + + + + + + Date: Thu, 1 Apr 2021 12:49:49 +0200 Subject: [PATCH 02/25] Update runtimelab-post-build-steps.yml --- eng/pipelines/runtimelab/runtimelab-post-build-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/runtimelab/runtimelab-post-build-steps.yml b/eng/pipelines/runtimelab/runtimelab-post-build-steps.yml index 85e880424f7f..fe83d5e27bec 100644 --- a/eng/pipelines/runtimelab/runtimelab-post-build-steps.yml +++ b/eng/pipelines/runtimelab/runtimelab-post-build-steps.yml @@ -15,7 +15,7 @@ steps: - ${{ if ne(parameters.archType, 'arm64') }}: - ${{ if eq(parameters.buildConfig, 'Release') }}: - - script: $(Build.SourcesDirectory)$(scriptExt) libs.tests -c Release -test + - script: $(Build.SourcesDirectory)build$(scriptExt) libs.tests -c Release -test displayName: Build and run libraries tests # Build coreclr native test output From ffe5c4dd6f4f50e0d79c400088c82d85d7849cdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Thu, 1 Apr 2021 13:15:03 +0200 Subject: [PATCH 03/25] Update runtimelab-post-build-steps.yml --- eng/pipelines/runtimelab/runtimelab-post-build-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/runtimelab/runtimelab-post-build-steps.yml b/eng/pipelines/runtimelab/runtimelab-post-build-steps.yml index fe83d5e27bec..8f7b3ef38071 100644 --- a/eng/pipelines/runtimelab/runtimelab-post-build-steps.yml +++ b/eng/pipelines/runtimelab/runtimelab-post-build-steps.yml @@ -15,7 +15,7 @@ steps: - ${{ if ne(parameters.archType, 'arm64') }}: - ${{ if eq(parameters.buildConfig, 'Release') }}: - - script: $(Build.SourcesDirectory)build$(scriptExt) libs.tests -c Release -test + - script: $(Build.SourcesDirectory)/build$(scriptExt) libs.tests -c Release -test displayName: Build and run libraries tests # Build coreclr native test output From 4b918d289cf2e44afe5970acc4efb1c4c1b3fdac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Thu, 1 Apr 2021 14:01:07 +0200 Subject: [PATCH 04/25] asdf --- src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs | 1 + src/libraries/System.IO.FileSystem/tests/File/Exists.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs b/src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs index 44d07e2c7749..262b15241f5e 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs @@ -300,6 +300,7 @@ public void PathWithReservedDeviceNameAsPath_ReturnsFalse(string component) Assert.False(Exists(component)); } + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/901" /* NativeAot */)] [Theory, MemberData(nameof(UncPathsWithoutShareName))] public void UncPathWithoutShareNameAsPath_ReturnsFalse(string component) diff --git a/src/libraries/System.IO.FileSystem/tests/File/Exists.cs b/src/libraries/System.IO.FileSystem/tests/File/Exists.cs index 225ed8e04e89..f55f893a06b7 100644 --- a/src/libraries/System.IO.FileSystem/tests/File/Exists.cs +++ b/src/libraries/System.IO.FileSystem/tests/File/Exists.cs @@ -231,6 +231,7 @@ public void PathWithReservedDeviceNameAsPath_ReturnsFalse(string component) Assert.False(Exists(component)); } + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/901" /* NativeAot */)] [Theory, MemberData(nameof(UncPathsWithoutShareName))] public void UncPathWithoutShareNameAsPath_ReturnsFalse(string component) From d01f03ff41acdaf3bac9f9af12f0327d101c706b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Thu, 1 Apr 2021 14:02:34 +0200 Subject: [PATCH 05/25] More tests --- .../tests/System.Collections.Tests.csproj | 3 + .../System.Collections/tests/default.rd.xml | 154 ++++++ .../tests/System.Runtime.Tests.csproj | 3 + .../System.Runtime/tests/default.rd.xml | 503 ++++++++++++++++++ src/libraries/tests.proj | 3 + 5 files changed, 666 insertions(+) create mode 100644 src/libraries/System.Collections/tests/default.rd.xml create mode 100644 src/libraries/System.Runtime/tests/default.rd.xml diff --git a/src/libraries/System.Collections/tests/System.Collections.Tests.csproj b/src/libraries/System.Collections/tests/System.Collections.Tests.csproj index 66f5dee8d5ba..d681aafe746b 100644 --- a/src/libraries/System.Collections/tests/System.Collections.Tests.csproj +++ b/src/libraries/System.Collections/tests/System.Collections.Tests.csproj @@ -4,6 +4,9 @@ true true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests.csproj b/src/libraries/System.Runtime/tests/System.Runtime.Tests.csproj index 4d8c8213f274..89bd516a70ad 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests.csproj +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests.csproj @@ -7,6 +7,9 @@ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser disable + + + diff --git a/src/libraries/System.Runtime/tests/default.rd.xml b/src/libraries/System.Runtime/tests/default.rd.xml new file mode 100644 index 000000000000..510108b3a9d7 --- /dev/null +++ b/src/libraries/System.Runtime/tests/default.rd.xml @@ -0,0 +1,503 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 973d659005ea..dd4a051b4ca1 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -403,7 +403,10 @@ + + + From 5ac83699078848cc64d0e89083d6370344689030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Tue, 6 Apr 2021 20:08:52 +0200 Subject: [PATCH 06/25] asdf --- eng/pipelines/runtimelab.yml | 2 +- src/libraries/src.proj | 2 -- src/libraries/tests.proj | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/eng/pipelines/runtimelab.yml b/eng/pipelines/runtimelab.yml index 86e2546f7a17..2ff30e4ac994 100644 --- a/eng/pipelines/runtimelab.yml +++ b/eng/pipelines/runtimelab.yml @@ -106,7 +106,7 @@ stages: timeoutInMinutes: 100 isOfficialBuild: ${{ variables.isOfficialBuild }} testGroup: innerloop - buildArgs: -s nativeaot+libs+nativeaot.packages -c release + buildArgs: -s nativeaot.objwriter+nativeaot+libs+nativeaot.packages -c release extraStepsTemplate: /eng/pipelines/runtimelab/runtimelab-post-build-steps.yml extraStepsParameters: uploadIntermediateArtifacts: ${{ variables.isOfficialBuild }} diff --git a/src/libraries/src.proj b/src/libraries/src.proj index 7644ba0e2e0b..e73626b1ee45 100644 --- a/src/libraries/src.proj +++ b/src/libraries/src.proj @@ -5,8 +5,6 @@ - - <_allSrc Include="$(MSBuildThisFileDirectory)*\src\*.csproj" Exclude="@(ProjectExclusions)" /> - - From 75bae172f86fd68054e0731010455126525f6d17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Wed, 7 Apr 2021 11:06:07 +0200 Subject: [PATCH 07/25] Force unoptimized --- eng/testing/tests.singlefile.targets | 2 ++ src/libraries/tests.proj | 2 ++ 2 files changed, 4 insertions(+) diff --git a/eng/testing/tests.singlefile.targets b/eng/testing/tests.singlefile.targets index f91516c32056..a46e6f8ce75b 100644 --- a/eng/testing/tests.singlefile.targets +++ b/eng/testing/tests.singlefile.targets @@ -25,6 +25,8 @@ $(TargetArchitecture) true $(NoWarn);IL9700;IL9701;IL1005 + + false diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 0e0f99e4a287..4d190888114b 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -404,7 +404,9 @@ + + From f84bcf7bf34fbe16be1e5c18190252dcd9d8a382 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Wed, 7 Apr 2021 14:50:14 +0200 Subject: [PATCH 08/25] Update tests.proj --- src/libraries/tests.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 4d190888114b..fb4a3a53d574 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -405,7 +405,7 @@ - + From 7d0d3232b9a40963624ca39ad828ceb312a068d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Fri, 9 Apr 2021 11:09:31 +0200 Subject: [PATCH 09/25] Exclusions --- eng/testing/tests.singlefile.targets | 5 +++-- src/libraries/System.Runtime/tests/System/GCTests.cs | 2 ++ .../System.Runtime/tests/System/Reflection/ModuleTests.cs | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/eng/testing/tests.singlefile.targets b/eng/testing/tests.singlefile.targets index a46e6f8ce75b..c2177dcbe61d 100644 --- a/eng/testing/tests.singlefile.targets +++ b/eng/testing/tests.singlefile.targets @@ -25,8 +25,6 @@ $(TargetArchitecture) true $(NoWarn);IL9700;IL9701;IL1005 - - false @@ -39,6 +37,9 @@ + + + diff --git a/src/libraries/System.Runtime/tests/System/GCTests.cs b/src/libraries/System.Runtime/tests/System/GCTests.cs index 2e86776345c4..9f8ce1fd6578 100644 --- a/src/libraries/System.Runtime/tests/System/GCTests.cs +++ b/src/libraries/System.Runtime/tests/System/GCTests.cs @@ -914,6 +914,7 @@ long CallGetTotalAllocatedBytes(long previous) } } + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/939" /* NativeAot */)] [Fact] [OuterLoop] private static void AllocateUninitializedArray() @@ -968,6 +969,7 @@ private static void AllocateUninitializedArray() } } + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/939" /* NativeAot */)] [Fact] [OuterLoop] private static void AllocateArray() diff --git a/src/libraries/System.Runtime/tests/System/Reflection/ModuleTests.cs b/src/libraries/System.Runtime/tests/System/Reflection/ModuleTests.cs index 49554f51f422..dd34f88e57ab 100644 --- a/src/libraries/System.Runtime/tests/System/Reflection/ModuleTests.cs +++ b/src/libraries/System.Runtime/tests/System/Reflection/ModuleTests.cs @@ -270,6 +270,7 @@ public void ResolveTypeFail(int token) public static IEnumerable Methods => typeof(ModuleTests).GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.DeclaredOnly).Select(m => new object[] { m }); + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/901" /* NativeAot */)] [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMetadataTokenSupported))] [MemberData(nameof(Methods))] public void ResolveMethod(MethodInfo t) @@ -299,6 +300,7 @@ public void ResolveMethodFail(int token) public static IEnumerable Fields => typeof(ModuleTests).GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.DeclaredOnly).Select(f => new object[] { f }); + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/901" /* NativeAot */)] [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMetadataTokenSupported))] [MemberData(nameof(Fields))] public void ResolveField(FieldInfo t) From 382c93322b77ee643f1965070e0af620cebcb6b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Fri, 9 Apr 2021 13:51:19 +0200 Subject: [PATCH 10/25] Suppress --- eng/testing/tests.singlefile.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/testing/tests.singlefile.targets b/eng/testing/tests.singlefile.targets index c2177dcbe61d..a851aaf79c26 100644 --- a/eng/testing/tests.singlefile.targets +++ b/eng/testing/tests.singlefile.targets @@ -38,7 +38,7 @@ - + From 0a72b8fee0ccd1b699dc560bdb9c7c2e38c7d5bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Fri, 9 Apr 2021 14:41:34 +0200 Subject: [PATCH 11/25] Universal Build Accelerator(tm) --- eng/pipelines/runtimelab.yml | 2 +- src/libraries/src.proj | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/eng/pipelines/runtimelab.yml b/eng/pipelines/runtimelab.yml index 2ff30e4ac994..86e2546f7a17 100644 --- a/eng/pipelines/runtimelab.yml +++ b/eng/pipelines/runtimelab.yml @@ -106,7 +106,7 @@ stages: timeoutInMinutes: 100 isOfficialBuild: ${{ variables.isOfficialBuild }} testGroup: innerloop - buildArgs: -s nativeaot.objwriter+nativeaot+libs+nativeaot.packages -c release + buildArgs: -s nativeaot+libs+nativeaot.packages -c release extraStepsTemplate: /eng/pipelines/runtimelab/runtimelab-post-build-steps.yml extraStepsParameters: uploadIntermediateArtifacts: ${{ variables.isOfficialBuild }} diff --git a/src/libraries/src.proj b/src/libraries/src.proj index e73626b1ee45..7644ba0e2e0b 100644 --- a/src/libraries/src.proj +++ b/src/libraries/src.proj @@ -5,6 +5,8 @@ + + <_allSrc Include="$(MSBuildThisFileDirectory)*\src\*.csproj" Exclude="@(ProjectExclusions)" /> Date: Fri, 9 Apr 2021 16:33:48 +0200 Subject: [PATCH 12/25] Analyze nested types --- .../ReflectionMethodBodyScanner.cs | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReflectionMethodBodyScanner.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReflectionMethodBodyScanner.cs index 91d3278e2b6f..0117a53971f2 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReflectionMethodBodyScanner.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReflectionMethodBodyScanner.cs @@ -26,7 +26,8 @@ public static bool ResolveType(string name, ModuleDesc callingModule, TypeSystem // Consume type name part StringBuilder typeName = new StringBuilder(); StringBuilder typeNamespace = new StringBuilder(); - while (i < name.Length && (char.IsLetterOrDigit(name[i]) || name[i] == '.' || name[i] == '`')) + string containingTypeName = null; + while (i < name.Length && (char.IsLetterOrDigit(name[i]) || name[i] == '.' || name[i] == '`' || name[i] == '+')) { if (name[i] == '.') { @@ -35,6 +36,11 @@ public static bool ResolveType(string name, ModuleDesc callingModule, TypeSystem typeNamespace.Append(typeName); typeName.Clear(); } + else if (name[i] == '+') + { + containingTypeName = typeName.ToString(); + typeName.Clear(); + } else { typeName.Append(name[i]); @@ -42,6 +48,13 @@ public static bool ResolveType(string name, ModuleDesc callingModule, TypeSystem i++; } + string nestedTypeName = null; + if (containingTypeName != null) + { + nestedTypeName = typeName.ToString(); + typeName = new StringBuilder(containingTypeName); + } + // Consume any comma or white space while (i < name.Length && (name[i] == ' ' || name[i] == ',')) { @@ -69,14 +82,20 @@ public static bool ResolveType(string name, ModuleDesc callingModule, TypeSystem return false; // Resolve type in the assembly - type = referenceModule.GetType(typeNamespace.ToString(), typeName.ToString(), NotFoundBehavior.ReturnNull); - + MetadataType mdType = referenceModule.GetType(typeNamespace.ToString(), typeName.ToString(), NotFoundBehavior.ReturnNull); + if (mdType != null && nestedTypeName != null) + mdType = mdType.GetNestedType(nestedTypeName); + // If it didn't resolve and wasn't assembly-qualified, we also try core library - if (type == null && assemblyName.Length == 0) + if (mdType == null && assemblyName.Length == 0) { referenceModule = context.SystemModule; - type = referenceModule.GetType(typeNamespace.ToString(), typeName.ToString(), NotFoundBehavior.ReturnNull); + mdType = referenceModule.GetType(typeNamespace.ToString(), typeName.ToString(), NotFoundBehavior.ReturnNull); + if (mdType != null && nestedTypeName != null) + mdType = mdType.GetNestedType(nestedTypeName); } + + type = mdType; return type != null; } From e774270b8741c75c3c0d861571b33833b4963054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Tue, 13 Apr 2021 10:38:14 +0200 Subject: [PATCH 13/25] feljkndfaknjlnkfanklasdf --- .../Common/tests/TestUtilities/System/PlatformDetection.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index 8544a948b181..2a45786679ba 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -269,7 +269,7 @@ private static Version GetICUVersion() int version = 0; try { - Type interopGlobalization = Type.GetType("Interop+Globalization"); + Type interopGlobalization = Type.GetType("Interop+Globalization, System.Private.CoreLib"); if (interopGlobalization != null) { MethodInfo methodInfo = interopGlobalization.GetMethod("GetICUVersion", BindingFlags.NonPublic | BindingFlags.Static); From 92def4b3cff089eb6f951621bdff8660c3af353a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Tue, 13 Apr 2021 10:39:07 +0200 Subject: [PATCH 14/25] aaa --- src/libraries/tests.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index fb4a3a53d574..9c0cd44517c0 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -406,7 +406,7 @@ - + From 7e06e988217b0f35351f7ad52e3308f33ae6f985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Tue, 13 Apr 2021 12:06:09 +0200 Subject: [PATCH 15/25] abc --- src/libraries/System.Runtime/tests/default.rd.xml | 4 +++- src/libraries/tests.proj | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Runtime/tests/default.rd.xml b/src/libraries/System.Runtime/tests/default.rd.xml index 510108b3a9d7..72b0a4a60950 100644 --- a/src/libraries/System.Runtime/tests/default.rd.xml +++ b/src/libraries/System.Runtime/tests/default.rd.xml @@ -1,7 +1,9 @@ - + + + diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 9c0cd44517c0..a5fd6a827050 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -404,7 +404,7 @@ - + From e67809943a1fde83df8bef9d0c0c1d493db8b249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Tue, 13 Apr 2021 12:27:31 +0200 Subject: [PATCH 16/25] mac --- .../BuildIntegration/Microsoft.NETCore.Native.targets | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets index 85cdcaeeae69..895bb33912c4 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets @@ -338,7 +338,8 @@ The .NET Foundation licenses this file to you under the MIT license. - + + From 4446ca5a3a071abf3a86e6cc3013e378caa5b923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Tue, 20 Apr 2021 10:55:21 +0200 Subject: [PATCH 17/25] Revert "Analyze nested types" This reverts commit ca46750c52cf5d0e9ffd4b000d31bf1fe48e67b7. --- .../ReflectionMethodBodyScanner.cs | 29 ++++--------------- 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReflectionMethodBodyScanner.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReflectionMethodBodyScanner.cs index 0117a53971f2..91d3278e2b6f 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReflectionMethodBodyScanner.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReflectionMethodBodyScanner.cs @@ -26,8 +26,7 @@ public static bool ResolveType(string name, ModuleDesc callingModule, TypeSystem // Consume type name part StringBuilder typeName = new StringBuilder(); StringBuilder typeNamespace = new StringBuilder(); - string containingTypeName = null; - while (i < name.Length && (char.IsLetterOrDigit(name[i]) || name[i] == '.' || name[i] == '`' || name[i] == '+')) + while (i < name.Length && (char.IsLetterOrDigit(name[i]) || name[i] == '.' || name[i] == '`')) { if (name[i] == '.') { @@ -36,11 +35,6 @@ public static bool ResolveType(string name, ModuleDesc callingModule, TypeSystem typeNamespace.Append(typeName); typeName.Clear(); } - else if (name[i] == '+') - { - containingTypeName = typeName.ToString(); - typeName.Clear(); - } else { typeName.Append(name[i]); @@ -48,13 +42,6 @@ public static bool ResolveType(string name, ModuleDesc callingModule, TypeSystem i++; } - string nestedTypeName = null; - if (containingTypeName != null) - { - nestedTypeName = typeName.ToString(); - typeName = new StringBuilder(containingTypeName); - } - // Consume any comma or white space while (i < name.Length && (name[i] == ' ' || name[i] == ',')) { @@ -82,20 +69,14 @@ public static bool ResolveType(string name, ModuleDesc callingModule, TypeSystem return false; // Resolve type in the assembly - MetadataType mdType = referenceModule.GetType(typeNamespace.ToString(), typeName.ToString(), NotFoundBehavior.ReturnNull); - if (mdType != null && nestedTypeName != null) - mdType = mdType.GetNestedType(nestedTypeName); - + type = referenceModule.GetType(typeNamespace.ToString(), typeName.ToString(), NotFoundBehavior.ReturnNull); + // If it didn't resolve and wasn't assembly-qualified, we also try core library - if (mdType == null && assemblyName.Length == 0) + if (type == null && assemblyName.Length == 0) { referenceModule = context.SystemModule; - mdType = referenceModule.GetType(typeNamespace.ToString(), typeName.ToString(), NotFoundBehavior.ReturnNull); - if (mdType != null && nestedTypeName != null) - mdType = mdType.GetNestedType(nestedTypeName); + type = referenceModule.GetType(typeNamespace.ToString(), typeName.ToString(), NotFoundBehavior.ReturnNull); } - - type = mdType; return type != null; } From 8c735dc59151a72ef3067678ba052d10d3df524e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Tue, 13 Apr 2021 13:17:46 +0200 Subject: [PATCH 18/25] Update Microsoft.NETCore.Native.targets --- .../BuildIntegration/Microsoft.NETCore.Native.targets | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets index 895bb33912c4..05528855e389 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets @@ -339,7 +339,12 @@ The .NET Foundation licenses this file to you under the MIT license. - + + <_IgnoreLinkerWarnings>false + <_IgnoreLinkerWarnings Condition="'$(TargetOS)' == 'OSX'">true + + + From 7925d066c7fba61153703cd0c74c9d6cc39ca253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Tue, 20 Apr 2021 11:05:20 +0200 Subject: [PATCH 19/25] one more --- src/libraries/System.Runtime/tests/System/GCTests.cs | 2 -- src/libraries/tests.proj | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/libraries/System.Runtime/tests/System/GCTests.cs b/src/libraries/System.Runtime/tests/System/GCTests.cs index 9f8ce1fd6578..2e86776345c4 100644 --- a/src/libraries/System.Runtime/tests/System/GCTests.cs +++ b/src/libraries/System.Runtime/tests/System/GCTests.cs @@ -914,7 +914,6 @@ long CallGetTotalAllocatedBytes(long previous) } } - [ActiveIssue("https://github.com/dotnet/runtimelab/issues/939" /* NativeAot */)] [Fact] [OuterLoop] private static void AllocateUninitializedArray() @@ -969,7 +968,6 @@ private static void AllocateUninitializedArray() } } - [ActiveIssue("https://github.com/dotnet/runtimelab/issues/939" /* NativeAot */)] [Fact] [OuterLoop] private static void AllocateArray() diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index a5fd6a827050..4ac0dde07ccb 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -403,7 +403,7 @@ - + From 63ca3283a8739d84a969dcd9b4c81b438f3cf9d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Tue, 20 Apr 2021 15:46:39 +0200 Subject: [PATCH 20/25] Update GCTests.cs --- src/libraries/System.Runtime/tests/System/GCTests.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libraries/System.Runtime/tests/System/GCTests.cs b/src/libraries/System.Runtime/tests/System/GCTests.cs index 2e86776345c4..9f8ce1fd6578 100644 --- a/src/libraries/System.Runtime/tests/System/GCTests.cs +++ b/src/libraries/System.Runtime/tests/System/GCTests.cs @@ -914,6 +914,7 @@ long CallGetTotalAllocatedBytes(long previous) } } + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/939" /* NativeAot */)] [Fact] [OuterLoop] private static void AllocateUninitializedArray() @@ -968,6 +969,7 @@ private static void AllocateUninitializedArray() } } + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/939" /* NativeAot */)] [Fact] [OuterLoop] private static void AllocateArray() From f19c59f9097c5cab9931b81a82828cd5953bf943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Tue, 20 Apr 2021 16:30:21 +0200 Subject: [PATCH 21/25] reflection cache --- .../Common/tests/TestUtilities/System/PlatformDetection.cs | 2 ++ .../tests/System/Reflection/ReflectionCacheTests.cs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index 2a45786679ba..e51600427fd5 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -103,6 +103,8 @@ public static bool IsDrawingSupported public static bool IsInvokingStaticConstructorsSupported => !IsNativeAot; + public static bool IsMetadataUpdateSupported => !IsNativeAot; + // System.Security.Cryptography.Xml.XmlDsigXsltTransform.GetOutput() relies on XslCompiledTransform which relies // heavily on Reflection.Emit public static bool IsXmlDsigXsltTransformSupported => !PlatformDetection.IsInAppContainer; diff --git a/src/libraries/System.Runtime/tests/System/Reflection/ReflectionCacheTests.cs b/src/libraries/System.Runtime/tests/System/Reflection/ReflectionCacheTests.cs index 4136b2e1d2d5..8519247b601d 100644 --- a/src/libraries/System.Runtime/tests/System/Reflection/ReflectionCacheTests.cs +++ b/src/libraries/System.Runtime/tests/System/Reflection/ReflectionCacheTests.cs @@ -22,7 +22,7 @@ public void GetMethod_MultipleCalls_SameObjects() } [ActiveIssue("https://github.com/dotnet/runtime/issues/50978", TestRuntimes.Mono)] - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMetadataUpdateSupported))] public void InvokeBeforeUpdate_NoExceptions() { Action beforeUpdate = GetBeforeUpdateMethod(); @@ -33,7 +33,7 @@ public void InvokeBeforeUpdate_NoExceptions() } [ActiveIssue("https://github.com/dotnet/runtime/issues/50978", TestRuntimes.Mono)] - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMetadataUpdateSupported))] [InlineData(false)] [InlineData(true)] public void GetMethod_MultipleCalls_ClearCache_DifferentObjects(bool justSpecificType) From 92c64795280869139047e8d99a49e3914e3fcde7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Tue, 20 Apr 2021 16:33:03 +0200 Subject: [PATCH 22/25] wtf --- eng/testing/RunnerTemplate.cmd | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/testing/RunnerTemplate.cmd b/eng/testing/RunnerTemplate.cmd index 0d898b4aa182..275f1452f7e3 100644 --- a/eng/testing/RunnerTemplate.cmd +++ b/eng/testing/RunnerTemplate.cmd @@ -58,6 +58,7 @@ popd echo ----- end %DATE% %TIME% ----- exit code %ERRORLEVEL% ---------------------------------------------------------- :: The helix work item should not exit with non-zero if tests ran and produced results :: The special console runner for runtime returns 1 when tests fail +echo HELIX_WORKITEM_PAYLOAD is %HELIX_WORKITEM_PAYLOAD% if %ERRORLEVEL%==1 ( if not "%HELIX_WORKITEM_PAYLOAD%"=="" ( exit /b 0 From 11f139fc7e07f846148641adb6f47e1c306af0e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Tue, 20 Apr 2021 20:16:01 +0200 Subject: [PATCH 23/25] try this? --- eng/testing/tests.targets | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/testing/tests.targets b/eng/testing/tests.targets index d756ad54a5fd..a3aa9b406462 100644 --- a/eng/testing/tests.targets +++ b/eng/testing/tests.targets @@ -110,7 +110,8 @@ + IgnoreStandardErrorWarningFormat="true" + EnvironmentVariables="HELIX_WORKITEM_PAYLOAD=;"> From 09dbd4261fa2eae2cac643e38e433a70c10624a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Wed, 28 Apr 2021 15:32:29 +0200 Subject: [PATCH 24/25] deletes --- eng/Subsets.props | 2 +- eng/testing/RunnerTemplate.cmd | 1 - eng/testing/tests.singlefile.targets | 3 --- src/libraries/System.Runtime/tests/System/GCTests.cs | 2 -- 4 files changed, 1 insertion(+), 7 deletions(-) diff --git a/eng/Subsets.props b/eng/Subsets.props index 530e917111a7..a6c1ce4e07bd 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -50,7 +50,7 @@ clr.native+linuxdac+clr.corelib+clr.tools+clr.nativecorelib+clr.packages - clr.alljits+nativeaot.tools+nativeaot.libs + clr.jit+nativeaot.tools+nativeaot.libs mono.llvm+ mono.llvm+ diff --git a/eng/testing/RunnerTemplate.cmd b/eng/testing/RunnerTemplate.cmd index 275f1452f7e3..0d898b4aa182 100644 --- a/eng/testing/RunnerTemplate.cmd +++ b/eng/testing/RunnerTemplate.cmd @@ -58,7 +58,6 @@ popd echo ----- end %DATE% %TIME% ----- exit code %ERRORLEVEL% ---------------------------------------------------------- :: The helix work item should not exit with non-zero if tests ran and produced results :: The special console runner for runtime returns 1 when tests fail -echo HELIX_WORKITEM_PAYLOAD is %HELIX_WORKITEM_PAYLOAD% if %ERRORLEVEL%==1 ( if not "%HELIX_WORKITEM_PAYLOAD%"=="" ( exit /b 0 diff --git a/eng/testing/tests.singlefile.targets b/eng/testing/tests.singlefile.targets index a851aaf79c26..f91516c32056 100644 --- a/eng/testing/tests.singlefile.targets +++ b/eng/testing/tests.singlefile.targets @@ -37,9 +37,6 @@ - - - diff --git a/src/libraries/System.Runtime/tests/System/GCTests.cs b/src/libraries/System.Runtime/tests/System/GCTests.cs index 9f8ce1fd6578..2e86776345c4 100644 --- a/src/libraries/System.Runtime/tests/System/GCTests.cs +++ b/src/libraries/System.Runtime/tests/System/GCTests.cs @@ -914,7 +914,6 @@ long CallGetTotalAllocatedBytes(long previous) } } - [ActiveIssue("https://github.com/dotnet/runtimelab/issues/939" /* NativeAot */)] [Fact] [OuterLoop] private static void AllocateUninitializedArray() @@ -969,7 +968,6 @@ private static void AllocateUninitializedArray() } } - [ActiveIssue("https://github.com/dotnet/runtimelab/issues/939" /* NativeAot */)] [Fact] [OuterLoop] private static void AllocateArray() From fe0550304e59aea1954b30539899c93b35a63dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Wed, 28 Apr 2021 20:27:04 +0200 Subject: [PATCH 25/25] maybe this is it? --- eng/Subsets.props | 2 +- eng/pipelines/runtimelab.yml | 2 +- eng/testing/tests.targets | 1 + src/libraries/src.proj | 2 -- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/eng/Subsets.props b/eng/Subsets.props index a6c1ce4e07bd..530e917111a7 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -50,7 +50,7 @@ clr.native+linuxdac+clr.corelib+clr.tools+clr.nativecorelib+clr.packages - clr.jit+nativeaot.tools+nativeaot.libs + clr.alljits+nativeaot.tools+nativeaot.libs mono.llvm+ mono.llvm+ diff --git a/eng/pipelines/runtimelab.yml b/eng/pipelines/runtimelab.yml index 86e2546f7a17..2ff30e4ac994 100644 --- a/eng/pipelines/runtimelab.yml +++ b/eng/pipelines/runtimelab.yml @@ -106,7 +106,7 @@ stages: timeoutInMinutes: 100 isOfficialBuild: ${{ variables.isOfficialBuild }} testGroup: innerloop - buildArgs: -s nativeaot+libs+nativeaot.packages -c release + buildArgs: -s nativeaot.objwriter+nativeaot+libs+nativeaot.packages -c release extraStepsTemplate: /eng/pipelines/runtimelab/runtimelab-post-build-steps.yml extraStepsParameters: uploadIntermediateArtifacts: ${{ variables.isOfficialBuild }} diff --git a/eng/testing/tests.targets b/eng/testing/tests.targets index a3aa9b406462..e395ae302a92 100644 --- a/eng/testing/tests.targets +++ b/eng/testing/tests.targets @@ -107,6 +107,7 @@ + - - <_allSrc Include="$(MSBuildThisFileDirectory)*\src\*.csproj" Exclude="@(ProjectExclusions)" />