From 6d01e68fb52a0f5a51a8e389708d25c8705be3e0 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 5 Apr 2024 13:15:58 +0200 Subject: [PATCH 01/19] Add ILLink support to build machines This commit introduces the EnableAggressiveTrimming parameter in the Apple mobile targets for build machines. It ensures that parameters and items used by the ILLink target are passed correctly. --- .../runtime-extra-platforms-ioslike.yml | 2 +- eng/testing/tests.ioslike.targets | 74 +++++++++++++------ eng/testing/tests.mobile.targets | 4 +- 3 files changed, 55 insertions(+), 25 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml index 051cb8b286bde9..63163ef8c8da24 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml @@ -35,7 +35,7 @@ jobs: testGroup: innerloop nameSuffix: AllSubsets_Mono isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }} - buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true /p:IsManualOrRollingBuild=true + buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true /p:IsManualOrRollingBuild=true /p:EnableAggressiveTrimming=true timeoutInMinutes: 480 # extra steps, run tests postBuildSteps: diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets index 50f89bfef82a46..b7a9bf8b1fdc8b 100644 --- a/eng/testing/tests.ioslike.targets +++ b/eng/testing/tests.ioslike.targets @@ -16,7 +16,7 @@ <_AOTBuildCommand Condition="'$(ContinuousIntegrationBuild)' != 'true'">$(_AOTBuildCommand) /p:RuntimeSrcDir=$(RepoRoot) /p:RuntimeConfig=$(Configuration) - <_AOTBuildCommand>$(_AOTBuildCommand) /p:XHARNESS_EXECUTION_DIR="$XHARNESS_EXECUTION_DIR" /p:RunAOTCompilation=$(RunAOTCompilation) /p:UseNativeAOTRuntime=$(UseNativeAOTRuntime) /p:TargetOS=$(TargetOS) /p:TargetArchitecture=$(TargetArchitecture) /p:MonoForceInterpreter=$(MonoForceInterpreter) /p:MonoEnableLLVM=true /p:DevTeamProvisioning=$(DevTeamProvisioning) /p:UsePortableRuntimePack=true /p:Configuration=$(Configuration) + <_AOTBuildCommand>$(_AOTBuildCommand) /p:XHARNESS_EXECUTION_DIR="$XHARNESS_EXECUTION_DIR" /p:RunAOTCompilation=$(RunAOTCompilation) /p:UseNativeAOTRuntime=$(UseNativeAOTRuntime) /p:TargetOS=$(TargetOS) /p:TargetArchitecture=$(TargetArchitecture) /p:MonoForceInterpreter=$(MonoForceInterpreter) /p:MonoEnableLLVM=true /p:DevTeamProvisioning=$(DevTeamProvisioning) /p:UsePortableRuntimePack=true /p:Configuration=$(Configuration) /p:EnableAggressiveTrimming=$(EnableAggressiveTrimming) <_AOTBuildCommand Condition="'$(NativeLib)' != ''">$(_AOTBuildCommand) /p:NativeLib=$(NativeLib) /p:BundlesResources=$(BundlesResources) /p:ForceLibraryModeGenerateAppBundle=$(ForceLibraryModeGenerateAppBundle) <_AOTBuildCommand>$(_AOTBuildCommand) @@ -46,11 +46,11 @@ PrepareForAppleBuildApp;$(AppleBuildDependsOn);_CopyTestArchive - + AppleBuild $(BundleTestAppleAppDependsOn);_BundleAOTTestAppleAppForHelix;_CopyTestArchive - + $(BundleDir)publish - + <_MainAssemblyPath Condition="'%(AppleAssembliesToBundle.FileName)' == $(AssemblyName) and '%(AppleAssembliesToBundle.Extension)' == '.dll'">%(AppleAssembliesToBundle.Identity) $([System.IO.Path]::ChangeExtension($(_MainAssemblyPath), '.runtimeconfig.json')) @@ -76,6 +76,8 @@ + @@ -104,41 +106,69 @@ <_RuntimePackFiles Include="$(MicrosoftNetCoreAppRuntimePackRidLibTfmDir)**\*.*" /> <_RuntimePackFiles Include="$(MicrosoftNetCoreAppRuntimePackNativeDir)*.*" /> - + <_UnusedRuntimePackFiles Include="@(_PublishBundleFiles)" Exclude="@(_RuntimePackFiles->'$(AppBundlePath)/%(FileName)%(Extension)')" /> <_UsedRuntimePackFiles Include="@(_PublishBundleFiles)" Exclude="@(_UnusedRuntimePackFiles)" /> - + <_RuntimePackFilesToDelete Include="@(_RuntimePackFiles->'$(AppBundlePath)/%(FileName)%(Extension)')" /> + + + + + - <_ApplePropertyNames Include="InvariantGlobalization" /> - <_ApplePropertyNames Include="HybridGlobalization" /> + <_ApplePropertyNames Include="AssemblyName" /> - <_ApplePropertyNames Include="MonoEnableLLVM" /> + <_ApplePropertyNames Include="IncludesTestRunner" /> <_ApplePropertyNames Include="MainLibraryFileName" /> + <_ApplePropertyNames Include="MonoEnableLLVM" /> + <_ApplePropertyNames Include="ShouldILStrip" /> <_ApplePropertyNames Include="UseConsoleUITemplate" /> <_ApplePropertyNames Include="UseRuntimeComponents" /> - <_ApplePropertyNames Include="IncludesTestRunner" /> - <_ApplePropertyNames Include="ShouldILStrip" /> + + + <_ApplePropertyNames Include="HybridGlobalization" /> + <_ApplePropertyNames Include="InvariantGlobalization" /> + + + <_ApplePropertyNames Include="_NetCoreAppToolCurrent" /> + <_ApplePropertyNames Include="DebuggerSupport" /> + <_ApplePropertyNames Include="EventSourceSupport" /> + <_ApplePropertyNames Include="JsonSerializerIsReflectionEnabledByDefault" /> + <_ApplePropertyNames Include="MetadataUpdaterSupport" /> + + + <_AppleUsedRuntimePackFiles + Include="@(_UsedRuntimePackFiles->'%(FileName)%(Extension)')" + RemoveMetadata="_IsNative;TargetDir" /> <_ApplePropertiesToPass - Include="$(%(_ApplePropertyNames.Identity))" - Name="%(_ApplePropertyNames.Identity)" - ConditionToUse__="%(_ApplePropertyNames.ConditionToUse__)" /> - - <_AppleUsedRuntimePackFiles - Include="@(_UsedRuntimePackFiles->'%(FileName)%(Extension)')" - RemoveMetadata="_IsNative;TargetDir" /> - + Include="$(%(_ApplePropertyNames.Identity))" + Name="%(_ApplePropertyNames.Identity)" + ConditionToUse__="%(_ApplePropertyNames.ConditionToUse__)" /> + <_AppleItemsToPass Include="@(_AppleUsedRuntimePackFiles)" OriginalItemName__="_AppleUsedRuntimePackFiles" /> + <_AppleItemsToPass Include="@(AppleReferenceSharedPathFiles->'%(FileName)%(Extension)')" + OriginalItemName__="AppleReferenceSharedPathFiles" /> + + <_AppleItemsToPass Include="@(ReferenceExtraPathFiles->'%(FileName)%(Extension)')" + OriginalItemName__="AppleReferenceExtraPathFiles" /> + + <_AppleItemsToPass Include="@(RuntimeHostConfigurationOption)" + OriginalItemName__="_AppleUsedRuntimeHostConfigurationOption" /> + + <_AppleItemsToPass Include="@(TrimmerRootAssembly)" + OriginalItemName__="TrimmerRootAssembly" /> + true @@ -124,7 +124,7 @@ as a root --> + Include="%(ResolvedFileToPublish.FileName)" /> From 0b3566cf2beb298f0610b9efa47afc61dcaaaef4 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 5 Apr 2024 13:32:04 +0200 Subject: [PATCH 02/19] Add ILLink support on Helix This commit introduces the EnableAggressiveTrimming parameter in the proxy project. Additionally, it ensures that ILLink props and targets are included into the payload. --- .../apple/build/AppleBuild.LocalBuild.props | 17 +++--- .../apple/build/AppleBuild.LocalBuild.targets | 53 ++++++++++++++++++- .../apple/data/ProxyProjectForAOTOnHelix.proj | 35 +++++++++--- 3 files changed, 91 insertions(+), 14 deletions(-) diff --git a/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props b/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props index ed8be7e3ac38e6..1fc8e6647f0a23 100644 --- a/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props +++ b/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props @@ -34,15 +34,19 @@ $([MSBuild]::NormalizeDirectory($(MicrosoftNetCoreAppRuntimePackLocationToUse), 'runtimes', '$(TargetOS)-$(TargetArchitecture.ToLowerInvariant())', 'lib', '$(_NetCoreAppCurrent)')) $([MSBuild]::NormalizeDirectory($(MicrosoftNetCoreAppRuntimePackLocationToUse), 'runtimes', '$(TargetOS)-$(TargetArchitecture.ToLowerInvariant())', 'native')) - $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'AppleAppBuilder', 'Debug', '$(_NetCoreAppToolCurrent)')) - $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'LibraryBuilder', 'Debug', '$(_NetCoreAppToolCurrent)')) - $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'MonoAOTCompiler', 'Debug', '$(_NetCoreAppToolCurrent)')) - $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'MonoTargetsTasks', 'Debug', '$(_NetCoreAppToolCurrent)')) + $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'AppleAppBuilder', '$(Configuration)', '$(_NetCoreAppToolCurrent)')) + $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'LibraryBuilder', '$(Configuration)', '$(_NetCoreAppToolCurrent)')) + $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'MonoAOTCompiler', '$(Configuration)', '$(_NetCoreAppToolCurrent)')) + $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'MonoTargetsTasks', '$(Configuration)', '$(_NetCoreAppToolCurrent)')) $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'mono', '$(TargetOS).$(TargetArchitecture).$(RuntimeConfig)')) $([MSBuild]::NormalizePath($(MonoArtifactsPath), 'cross', '$(TargetOS)-$(TargetArchitecture.ToLowerInvariant())')) <_MonoAotCrossCompilerPath>$([MSBuild]::NormalizePath($(MonoAotCrossDir), 'mono-aot-cross')) <_MonoAotCrossCompilerPath Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">$(_MonoAotCrossCompilerPath).exe + + $([MSBuild]::NormalizePath('$(ArtifactsBinDir)', 'ILLink.Tasks', '$(Configuration)', '$(_NetCoreAppToolCurrent)', 'build', 'Microsoft.NET.ILLink.Tasks.props')) + $([MSBuild]::NormalizePath('$(ArtifactsBinDir)', 'ILLink.Tasks', '$(Configuration)', '$(_NetCoreAppToolCurrent)', 'build', 'Microsoft.NET.ILLink.targets')) + <_ILLinkTasksAssembly>$([MSBuild]::NormalizePath('$(ArtifactsBinDir)', 'ILLink.Tasks', '$(Configuration)', '$(_NetCoreAppToolCurrent)', 'ILLink.Tasks.dll')) @@ -64,8 +68,9 @@ $([MSBuild]::NormalizeDirectory('$(BuildBaseDir)', 'aotsdk')) $(MicrosoftNetCoreAppRuntimePackLibDir) $(MicrosoftNetCoreAppRuntimePackNativeDir) - $([MSBuild]::NormalizePath('$(BuildBaseDir)', 'microsoft.net.illink.tasks', '$(_NetCoreAppToolCurrent)', 'build', 'Microsoft.NET.ILLink.targets')) - $([MSBuild]::NormalizePath('$(BuildBaseDir)', 'microsoft.net.illink.tasks', '$(_NetCoreAppToolCurrent)', 'ILLink.Tasks.dll')) + $([MSBuild]::NormalizePath('$(BuildBaseDir)', '$(_NetCoreAppToolCurrent)', 'build', ''Microsoft.NET.ILLink.Tasks.props'')) + $([MSBuild]::NormalizePath('$(BuildBaseDir)', '$(_NetCoreAppToolCurrent)', 'build', 'Microsoft.NET.ILLink.targets')) + <_ILLinkTasksAssembly>$([MSBuild]::NormalizePath('$(BuildBaseDir)', '$(_NetCoreAppToolCurrent)', 'ILLink.Tasks.dll')) <_MonoAotCrossCompilerPath>$([MSBuild]::NormalizePath($(MonoAotCrossDir), 'mono-aot-cross')) <_MonoAotCrossCompilerPath Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">$(_MonoAotCrossCompilerPath).exe diff --git a/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.targets b/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.targets index 05bdce89bf8432..fcc6f72aff2dfc 100644 --- a/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.targets +++ b/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.targets @@ -34,8 +34,59 @@ false + + + true + $(NoWarn);IL2103;IL2105;IL2025;IL2111 + + $(NoWarn);IL2035 + + false + + + + + + copyused + + + + + + + + + + + + + + + + + + + + + + + + + + + + %(Filename)%(Extension) + + + + - + ConfigureTrimming;_TrimApp;$(AppleBuildDependsOn) + _PublishRuntimePack;_PrepareForAppleBuildAppOnHelix;$(AppleBuildDependsOn);_AfterAppleBuildOnHelix + + true + $(OriginalPublishDir) @@ -18,12 +22,9 @@ <_IsApplePlatform>true true <_targetOS>$(TargetOS) - - - true - + $(OriginalPublishDir) static @@ -46,17 +47,18 @@ + - + true AppleTestRunner.dll - + $(OriginalPublishDir) $(TestRootDir)AppBundle\ @@ -89,6 +91,13 @@ + + + + + + + + + + + + + + + + + + + From 514ca0b5d367869ae6eae39a96bc468579d0b1ea Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 5 Apr 2024 13:58:49 +0200 Subject: [PATCH 03/19] Fix trimming-related test failures This commit adds ILLink descriptor files to preserve types needed for tests. Additionally, it disables tests that are not trim-compatible. --- .../TestUtilities/System/PlatformDetection.cs | 2 +- .../tests/Common/ConfigurationBinderTests.cs | 4 +- .../tests/NewLateBindingTests.cs | 1 + .../tests/ILLink.Descriptors.xml | 6 +++ ...guration.ConfigurationManager.Tests.csproj | 1 + .../tests/ILLink.Descriptors.xml | 3 ++ .../tests/System.Data.Common.Tests.csproj | 1 + .../tests/System/Data/XmlDataReaderTest.cs | 1 + .../ILLink.Descriptors.xml | 3 ++ ...m.Diagnostics.FileVersionInfo.Tests.csproj | 1 + .../tests/TrimCompatibilityTests.cs | 1 + .../System.Linq/tests/ILLink.Descriptors.xml | 5 +++ .../tests/System.Linq.Tests.csproj | 1 + .../System.Net.Security.Tests.csproj | 2 +- .../ObservableCollection_Serialization.cs | 1 + .../Decoding/SignatureDecoderTests.cs | 2 +- .../tests/ILLink.Descriptors.xml | 1 + ...eflection.MetadataLoadContext.Tests.csproj | 2 +- .../tests/ILLink.Descriptors.xml | 3 ++ .../tests/ModuleTests.cs | 1 + ...tem.Reflection.TypeExtensions.Tests.csproj | 3 +- .../tests/ILLink.Descriptors.xml | 4 ++ .../System.Resources.Extensions.Tests.csproj | 9 +++-- .../tests/System.Runtime.Loader.Tests.csproj | 4 +- .../Serialization/Schema/RoundTripTest.cs | 1 + .../tests/DataContractSerializer.cs | 2 + .../ExporterApiTests.cs | 1 + .../ILLink.Descriptors.xml | 5 +++ .../System.Globalization.Tests.csproj | 1 + .../ILLink.Descriptors.xml | 3 ++ ...ileSystem.DisabledFileLocking.Tests.csproj | 1 + .../ILLink.Descriptors.xml | 3 ++ .../System.IO.FileSystem.Tests.csproj | 1 + .../ILLink.Descriptors.iOS.xml | 40 +++++++++++++++++++ .../System.Runtime.Tests.csproj | 4 +- .../System/NullableMetadataTests.cs | 1 + .../tests/ILLink.Descriptors.xml | 5 +++ ...tem.Security.Cryptography.Xml.Tests.csproj | 3 ++ .../ILLink.Descriptors.xml | 9 +++++ .../System.Text.Json.Tests.csproj | 11 +++-- src/libraries/sendtohelix-mobile.targets | 8 ++-- 41 files changed, 141 insertions(+), 20 deletions(-) create mode 100644 src/libraries/System.Configuration.ConfigurationManager/tests/ILLink.Descriptors.xml create mode 100644 src/libraries/System.Data.Common/tests/ILLink.Descriptors.xml create mode 100644 src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/ILLink.Descriptors.xml create mode 100644 src/libraries/System.Linq/tests/ILLink.Descriptors.xml create mode 100644 src/libraries/System.Reflection.TypeExtensions/tests/ILLink.Descriptors.xml create mode 100644 src/libraries/System.Resources.Extensions/tests/ILLink.Descriptors.xml create mode 100644 src/libraries/System.Runtime/tests/System.Globalization.Tests/ILLink.Descriptors.xml create mode 100644 src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/DisabledFileLockingTests/ILLink.Descriptors.xml create mode 100644 src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/ILLink.Descriptors.xml create mode 100644 src/libraries/System.Runtime/tests/System.Runtime.Tests/ILLink.Descriptors.iOS.xml create mode 100644 src/libraries/System.Security.Cryptography.Xml/tests/ILLink.Descriptors.xml create mode 100644 src/libraries/System.Text.Json/tests/System.Text.Json.Tests/ILLink.Descriptors.xml diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index 210e8b6fc99f7c..3c93c2b4670989 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -283,7 +283,7 @@ public static bool IsMetadataTokenSupported public static bool UsesMobileAppleCrypto => IsMacCatalyst || IsiOS || IstvOS; // Changed to `true` when trimming - public static bool IsBuiltWithAggressiveTrimming => IsNativeAot; + public static bool IsBuiltWithAggressiveTrimming => IsNativeAot || IsAppleMobile; public static bool IsNotBuiltWithAggressiveTrimming => !IsBuiltWithAggressiveTrimming; public static bool IsTrimmedWithILLink => IsBuiltWithAggressiveTrimming && !IsNativeAot; diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.cs index 366c7ed44d8235..1b79fb60f95892 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.cs @@ -2118,7 +2118,7 @@ public void ComplexObj_As_Enumerable_Element() } #if !BUILDING_SOURCE_GENERATOR_TESTS - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser), nameof(PlatformDetection.IsNotAppleMobile))] public void TraceSwitchTest() { var dic = new Dictionary @@ -2147,7 +2147,7 @@ private void ValidateGeolocation(IGeolocation location) [Fact] #if !BUILDING_SOURCE_GENERATOR_TESTS - [ActiveIssue("Investigate Build browser-wasm linux Release LibraryTests_EAT CI failure for reflection impl", TestPlatforms.Browser)] + [ActiveIssue("Investigate Build browser-wasm linux Release LibraryTests_EAT CI failure for reflection impl", TestPlatforms.Browser | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] #endif public void TestGraphWithUnsupportedMember() { diff --git a/src/libraries/Microsoft.VisualBasic.Core/tests/NewLateBindingTests.cs b/src/libraries/Microsoft.VisualBasic.Core/tests/NewLateBindingTests.cs index b247e1e8b6c21c..956362d2383052 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/tests/NewLateBindingTests.cs +++ b/src/libraries/Microsoft.VisualBasic.Core/tests/NewLateBindingTests.cs @@ -96,6 +96,7 @@ public static IEnumerable LateCall_OptionalValues_Data() [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/51834", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/51834", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsAppleMobile))] [MemberData(nameof(LateCall_OptionalValues_Data))] public void LateCall_OptionalValues(string memberName, object[] arguments, Type[] typeArguments, string expectedValue) { diff --git a/src/libraries/System.Configuration.ConfigurationManager/tests/ILLink.Descriptors.xml b/src/libraries/System.Configuration.ConfigurationManager/tests/ILLink.Descriptors.xml new file mode 100644 index 00000000000000..8eb200db1924eb --- /dev/null +++ b/src/libraries/System.Configuration.ConfigurationManager/tests/ILLink.Descriptors.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/libraries/System.Configuration.ConfigurationManager/tests/System.Configuration.ConfigurationManager.Tests.csproj b/src/libraries/System.Configuration.ConfigurationManager/tests/System.Configuration.ConfigurationManager.Tests.csproj index e7881df77eb922..2a24b7ffaad07f 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/tests/System.Configuration.ConfigurationManager.Tests.csproj +++ b/src/libraries/System.Configuration.ConfigurationManager/tests/System.Configuration.ConfigurationManager.Tests.csproj @@ -97,6 +97,7 @@ + diff --git a/src/libraries/System.Data.Common/tests/ILLink.Descriptors.xml b/src/libraries/System.Data.Common/tests/ILLink.Descriptors.xml new file mode 100644 index 00000000000000..54b7989e54db6e --- /dev/null +++ b/src/libraries/System.Data.Common/tests/ILLink.Descriptors.xml @@ -0,0 +1,3 @@ + + + diff --git a/src/libraries/System.Data.Common/tests/System.Data.Common.Tests.csproj b/src/libraries/System.Data.Common/tests/System.Data.Common.Tests.csproj index 84d25bfe8e5c26..ed37aab0c75388 100644 --- a/src/libraries/System.Data.Common/tests/System.Data.Common.Tests.csproj +++ b/src/libraries/System.Data.Common/tests/System.Data.Common.Tests.csproj @@ -123,5 +123,6 @@ + diff --git a/src/libraries/System.Data.Common/tests/System/Data/XmlDataReaderTest.cs b/src/libraries/System.Data.Common/tests/System/Data/XmlDataReaderTest.cs index 5e56718d833d81..6de3301b4f018c 100644 --- a/src/libraries/System.Data.Common/tests/System/Data/XmlDataReaderTest.cs +++ b/src/libraries/System.Data.Common/tests/System/Data/XmlDataReaderTest.cs @@ -36,6 +36,7 @@ public class XmlDataReaderTest { [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/51369", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/51369", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsAppleMobile))] public void XmlLoadTest() { var ds = new DataSet(); diff --git a/src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/ILLink.Descriptors.xml b/src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/ILLink.Descriptors.xml new file mode 100644 index 00000000000000..ed3c59f0b70fb5 --- /dev/null +++ b/src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/ILLink.Descriptors.xml @@ -0,0 +1,3 @@ + + + diff --git a/src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/System.Diagnostics.FileVersionInfo.Tests.csproj b/src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/System.Diagnostics.FileVersionInfo.Tests.csproj index 41cc56f94fdf77..cdadf742e3d976 100644 --- a/src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/System.Diagnostics.FileVersionInfo.Tests.csproj +++ b/src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/System.Diagnostics.FileVersionInfo.Tests.csproj @@ -52,5 +52,6 @@ + diff --git a/src/libraries/System.Linq.Queryable/tests/TrimCompatibilityTests.cs b/src/libraries/System.Linq.Queryable/tests/TrimCompatibilityTests.cs index 86faa014ef1db7..89021695eb35d3 100644 --- a/src/libraries/System.Linq.Queryable/tests/TrimCompatibilityTests.cs +++ b/src/libraries/System.Linq.Queryable/tests/TrimCompatibilityTests.cs @@ -17,6 +17,7 @@ public class TrimCompatibilityTests /// [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/50712", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50712", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsAppleMobile))] public static void QueryableMethodsContainCorrectDynamicDependency() { IEnumerable dependentMethods = diff --git a/src/libraries/System.Linq/tests/ILLink.Descriptors.xml b/src/libraries/System.Linq/tests/ILLink.Descriptors.xml new file mode 100644 index 00000000000000..1e87b73c07d147 --- /dev/null +++ b/src/libraries/System.Linq/tests/ILLink.Descriptors.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/libraries/System.Linq/tests/System.Linq.Tests.csproj b/src/libraries/System.Linq/tests/System.Linq.Tests.csproj index de5d8b642a3d14..33d584fe8f6a15 100644 --- a/src/libraries/System.Linq/tests/System.Linq.Tests.csproj +++ b/src/libraries/System.Linq/tests/System.Linq.Tests.csproj @@ -5,6 +5,7 @@ + diff --git a/src/libraries/System.Net.Security/tests/FunctionalTests/System.Net.Security.Tests.csproj b/src/libraries/System.Net.Security/tests/FunctionalTests/System.Net.Security.Tests.csproj index fe9c74708ad615..182b664ed2ce75 100644 --- a/src/libraries/System.Net.Security/tests/FunctionalTests/System.Net.Security.Tests.csproj +++ b/src/libraries/System.Net.Security/tests/FunctionalTests/System.Net.Security.Tests.csproj @@ -5,7 +5,7 @@ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-unix;$(NetCoreAppCurrent)-browser;$(NetCoreAppCurrent)-osx;$(NetCoreAppCurrent)-ios true true - true + true diff --git a/src/libraries/System.ObjectModel/tests/ObservableCollection/ObservableCollection_Serialization.cs b/src/libraries/System.ObjectModel/tests/ObservableCollection/ObservableCollection_Serialization.cs index ad46a712462f33..22179a67a5129a 100644 --- a/src/libraries/System.ObjectModel/tests/ObservableCollection/ObservableCollection_Serialization.cs +++ b/src/libraries/System.ObjectModel/tests/ObservableCollection/ObservableCollection_Serialization.cs @@ -28,6 +28,7 @@ public void SerializeDeserialize_Roundtrips(ObservableCollection c) [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/57588", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/57588", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsAppleMobile))] public void OnDeserialized_MonitorNotInitialized_ExpectSuccess() { var observableCollection = new ObservableCollection(); diff --git a/src/libraries/System.Reflection.Metadata/tests/Metadata/Decoding/SignatureDecoderTests.cs b/src/libraries/System.Reflection.Metadata/tests/Metadata/Decoding/SignatureDecoderTests.cs index e11c3e32445a47..95e72ed21b8cd2 100644 --- a/src/libraries/System.Reflection.Metadata/tests/Metadata/Decoding/SignatureDecoderTests.cs +++ b/src/libraries/System.Reflection.Metadata/tests/Metadata/Decoding/SignatureDecoderTests.cs @@ -129,7 +129,7 @@ public static void VarArgsCaller() } // Test as much as we can with simple C# examples inline below. - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles), nameof(PlatformDetection.IsNotAppleMobile))] public void SimpleSignatureProviderCoverage() { using (FileStream stream = File.OpenRead(AssemblyPathHelper.GetAssemblyLocation(typeof(SignaturesToDecode<>).GetTypeInfo().Assembly))) diff --git a/src/libraries/System.Reflection.MetadataLoadContext/tests/ILLink.Descriptors.xml b/src/libraries/System.Reflection.MetadataLoadContext/tests/ILLink.Descriptors.xml index fdb5d5f8422c41..c5be88bbbae199 100644 --- a/src/libraries/System.Reflection.MetadataLoadContext/tests/ILLink.Descriptors.xml +++ b/src/libraries/System.Reflection.MetadataLoadContext/tests/ILLink.Descriptors.xml @@ -6,4 +6,5 @@ --> + diff --git a/src/libraries/System.Reflection.MetadataLoadContext/tests/System.Reflection.MetadataLoadContext.Tests.csproj b/src/libraries/System.Reflection.MetadataLoadContext/tests/System.Reflection.MetadataLoadContext.Tests.csproj index cba4079733816c..4840625d1a6f17 100644 --- a/src/libraries/System.Reflection.MetadataLoadContext/tests/System.Reflection.MetadataLoadContext.Tests.csproj +++ b/src/libraries/System.Reflection.MetadataLoadContext/tests/System.Reflection.MetadataLoadContext.Tests.csproj @@ -86,7 +86,7 @@ - + diff --git a/src/libraries/System.Reflection.TypeExtensions/tests/ILLink.Descriptors.xml b/src/libraries/System.Reflection.TypeExtensions/tests/ILLink.Descriptors.xml new file mode 100644 index 00000000000000..573b67e7172d49 --- /dev/null +++ b/src/libraries/System.Reflection.TypeExtensions/tests/ILLink.Descriptors.xml @@ -0,0 +1,3 @@ + + + diff --git a/src/libraries/System.Reflection.TypeExtensions/tests/ModuleTests.cs b/src/libraries/System.Reflection.TypeExtensions/tests/ModuleTests.cs index 9017b400f280ac..695ce373521acb 100644 --- a/src/libraries/System.Reflection.TypeExtensions/tests/ModuleTests.cs +++ b/src/libraries/System.Reflection.TypeExtensions/tests/ModuleTests.cs @@ -24,6 +24,7 @@ public void GetModuleVersionId_HasModuleVersionId_BehaveConsistently() // This calls Assembly.Load, but xUnit turn is into a LoadFrom because TinyAssembly is just a Content item in the project. [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))] + [SkipOnPlatform(TestPlatforms.Browser | TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "TinyAssembly GUID differs when trimming is enabled.")] public void GetModuleVersionId_KnownAssembly_ReturnsExpected() { Module module = Assembly.Load(new AssemblyName("TinyAssembly")).ManifestModule; diff --git a/src/libraries/System.Reflection.TypeExtensions/tests/System.Reflection.TypeExtensions.Tests.csproj b/src/libraries/System.Reflection.TypeExtensions/tests/System.Reflection.TypeExtensions.Tests.csproj index 233e848ac80ee8..4cec27f2eab318 100644 --- a/src/libraries/System.Reflection.TypeExtensions/tests/System.Reflection.TypeExtensions.Tests.csproj +++ b/src/libraries/System.Reflection.TypeExtensions/tests/System.Reflection.TypeExtensions.Tests.csproj @@ -22,5 +22,6 @@ TinyAssembly.dll PreserveNewest + - \ No newline at end of file + diff --git a/src/libraries/System.Resources.Extensions/tests/ILLink.Descriptors.xml b/src/libraries/System.Resources.Extensions/tests/ILLink.Descriptors.xml new file mode 100644 index 00000000000000..cec64e4a9de62e --- /dev/null +++ b/src/libraries/System.Resources.Extensions/tests/ILLink.Descriptors.xml @@ -0,0 +1,4 @@ + + + + diff --git a/src/libraries/System.Resources.Extensions/tests/System.Resources.Extensions.Tests.csproj b/src/libraries/System.Resources.Extensions/tests/System.Resources.Extensions.Tests.csproj index c1b004ee91105b..a0533c343614c6 100644 --- a/src/libraries/System.Resources.Extensions/tests/System.Resources.Extensions.Tests.csproj +++ b/src/libraries/System.Resources.Extensions/tests/System.Resources.Extensions.Tests.csproj @@ -2,6 +2,7 @@ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-unix;$(NetFrameworkMinimum) true + true @@ -15,7 +16,7 @@ - + @@ -25,7 +26,9 @@ - + + + + diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/NullableMetadataTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/NullableMetadataTests.cs index cb18c5e0222b31..3da8fb830320bd 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/NullableMetadataTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/NullableMetadataTests.cs @@ -132,6 +132,7 @@ public static void NullableAttributesOnPublicApiOnly(Type type) [Theory] [InlineData("mscorlib")] [InlineData("System.Threading.Overlapped")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst, "ILLink doesn't root forwarded types from rooted assemblies: https://github.com/dotnet/runtime/issues/99592")] public static void ShimsHaveOnlyTypeForwards(string assemblyName) { Assembly assembly = Assembly.Load(assemblyName); diff --git a/src/libraries/System.Security.Cryptography.Xml/tests/ILLink.Descriptors.xml b/src/libraries/System.Security.Cryptography.Xml/tests/ILLink.Descriptors.xml new file mode 100644 index 00000000000000..3e8cdae693f7b4 --- /dev/null +++ b/src/libraries/System.Security.Cryptography.Xml/tests/ILLink.Descriptors.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/libraries/System.Security.Cryptography.Xml/tests/System.Security.Cryptography.Xml.Tests.csproj b/src/libraries/System.Security.Cryptography.Xml/tests/System.Security.Cryptography.Xml.Tests.csproj index b4704975b8215c..858a44b23608f9 100644 --- a/src/libraries/System.Security.Cryptography.Xml/tests/System.Security.Cryptography.Xml.Tests.csproj +++ b/src/libraries/System.Security.Cryptography.Xml/tests/System.Security.Cryptography.Xml.Tests.csproj @@ -74,4 +74,7 @@ + + + diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/ILLink.Descriptors.xml b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/ILLink.Descriptors.xml new file mode 100644 index 00000000000000..2c692431c3ac27 --- /dev/null +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/ILLink.Descriptors.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/System.Text.Json.Tests.csproj b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/System.Text.Json.Tests.csproj index 61bea23cac8200..490167bc8362c8 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/System.Text.Json.Tests.csproj +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/System.Text.Json.Tests.csproj @@ -12,10 +12,13 @@ - true + true - true + true true + + true true @@ -302,5 +305,7 @@ - + + + diff --git a/src/libraries/sendtohelix-mobile.targets b/src/libraries/sendtohelix-mobile.targets index b003014bdcd265..0a3a091fdf4fc9 100644 --- a/src/libraries/sendtohelix-mobile.targets +++ b/src/libraries/sendtohelix-mobile.targets @@ -81,7 +81,7 @@ Destination="build/BuildIntegration" /> - + @@ -94,7 +94,7 @@ - $(AppleTestTarget) @@ -116,8 +116,8 @@ - false From a833a581a7b54ba31d705cfa742eb85ba89256a1 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 5 Apr 2024 15:09:37 +0200 Subject: [PATCH 04/19] Fix ILLinkTasksAssembly path in AppleBuild.LocalBuild.props --- src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props b/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props index 1fc8e6647f0a23..286a6c0aeefdb6 100644 --- a/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props +++ b/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props @@ -46,7 +46,7 @@ $([MSBuild]::NormalizePath('$(ArtifactsBinDir)', 'ILLink.Tasks', '$(Configuration)', '$(_NetCoreAppToolCurrent)', 'build', 'Microsoft.NET.ILLink.Tasks.props')) $([MSBuild]::NormalizePath('$(ArtifactsBinDir)', 'ILLink.Tasks', '$(Configuration)', '$(_NetCoreAppToolCurrent)', 'build', 'Microsoft.NET.ILLink.targets')) - <_ILLinkTasksAssembly>$([MSBuild]::NormalizePath('$(ArtifactsBinDir)', 'ILLink.Tasks', '$(Configuration)', '$(_NetCoreAppToolCurrent)', 'ILLink.Tasks.dll')) + $([MSBuild]::NormalizePath('$(ArtifactsBinDir)', 'ILLink.Tasks', '$(Configuration)', '$(_NetCoreAppToolCurrent)', 'ILLink.Tasks.dll')) @@ -70,7 +70,7 @@ $(MicrosoftNetCoreAppRuntimePackNativeDir) $([MSBuild]::NormalizePath('$(BuildBaseDir)', '$(_NetCoreAppToolCurrent)', 'build', ''Microsoft.NET.ILLink.Tasks.props'')) $([MSBuild]::NormalizePath('$(BuildBaseDir)', '$(_NetCoreAppToolCurrent)', 'build', 'Microsoft.NET.ILLink.targets')) - <_ILLinkTasksAssembly>$([MSBuild]::NormalizePath('$(BuildBaseDir)', '$(_NetCoreAppToolCurrent)', 'ILLink.Tasks.dll')) + $([MSBuild]::NormalizePath('$(BuildBaseDir)', '$(_NetCoreAppToolCurrent)', 'ILLink.Tasks.dll')) <_MonoAotCrossCompilerPath>$([MSBuild]::NormalizePath($(MonoAotCrossDir), 'mono-aot-cross')) <_MonoAotCrossCompilerPath Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">$(_MonoAotCrossCompilerPath).exe From c6a9417d78b2a0428e5969cb2bfb94766ca6d1e2 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 5 Apr 2024 16:27:54 +0200 Subject: [PATCH 05/19] Override ILLinkTasksAssembly property --- .../msbuild/apple/build/AppleBuild.LocalBuild.props | 10 ++++++++-- .../msbuild/apple/data/ProxyProjectForAOTOnHelix.proj | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props b/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props index 286a6c0aeefdb6..6a618c65af83e6 100644 --- a/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props +++ b/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props @@ -46,7 +46,7 @@ $([MSBuild]::NormalizePath('$(ArtifactsBinDir)', 'ILLink.Tasks', '$(Configuration)', '$(_NetCoreAppToolCurrent)', 'build', 'Microsoft.NET.ILLink.Tasks.props')) $([MSBuild]::NormalizePath('$(ArtifactsBinDir)', 'ILLink.Tasks', '$(Configuration)', '$(_NetCoreAppToolCurrent)', 'build', 'Microsoft.NET.ILLink.targets')) - $([MSBuild]::NormalizePath('$(ArtifactsBinDir)', 'ILLink.Tasks', '$(Configuration)', '$(_NetCoreAppToolCurrent)', 'ILLink.Tasks.dll')) + <_ILLinkTasksAssembly>$([MSBuild]::NormalizePath('$(ArtifactsBinDir)', 'ILLink.Tasks', '$(Configuration)', '$(_NetCoreAppToolCurrent)', 'ILLink.Tasks.dll')) @@ -70,7 +70,7 @@ $(MicrosoftNetCoreAppRuntimePackNativeDir) $([MSBuild]::NormalizePath('$(BuildBaseDir)', '$(_NetCoreAppToolCurrent)', 'build', ''Microsoft.NET.ILLink.Tasks.props'')) $([MSBuild]::NormalizePath('$(BuildBaseDir)', '$(_NetCoreAppToolCurrent)', 'build', 'Microsoft.NET.ILLink.targets')) - $([MSBuild]::NormalizePath('$(BuildBaseDir)', '$(_NetCoreAppToolCurrent)', 'ILLink.Tasks.dll')) + <_ILLinkTasksAssembly>$([MSBuild]::NormalizePath('$(BuildBaseDir)', '$(_NetCoreAppToolCurrent)', 'ILLink.Tasks.dll')) <_MonoAotCrossCompilerPath>$([MSBuild]::NormalizePath($(MonoAotCrossDir), 'mono-aot-cross')) <_MonoAotCrossCompilerPath Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">$(_MonoAotCrossCompilerPath).exe @@ -88,6 +88,12 @@ $([MSBuild]::NormalizePath('$(MonoTargetsTasksDir)', 'MonoTargetsTasks.dll')) + + + + $(_ILLinkTasksAssembly) + + diff --git a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj index 4acbc2e9c8b6ff..9b2e339cfcb13b 100644 --- a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj +++ b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj @@ -47,7 +47,6 @@ - From 67741a8eb27306fdec4877427cac02fbd2a9642a Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 5 Apr 2024 16:59:49 +0200 Subject: [PATCH 06/19] Set ILLinkTasksAssembly for NativeAOT tests --- src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props b/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props index 6a618c65af83e6..ce1751cc91bf19 100644 --- a/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props +++ b/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props @@ -90,7 +90,7 @@ - + $(_ILLinkTasksAssembly) From f8b309227c0dbed095664df719c9cdba57ffdd50 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Tue, 9 Apr 2024 11:55:27 +0200 Subject: [PATCH 07/19] Remove ILLink properties as they may not be necessary --- eng/testing/tests.ioslike.targets | 9 +-------- .../System.Net.Security.Tests.csproj | 2 +- .../tests/System.Resources.Extensions.Tests.csproj | 1 - .../System.Text.Json.Tests.csproj | 13 +++++++++---- .../apple/build/AppleBuild.LocalBuild.targets | 2 -- 5 files changed, 11 insertions(+), 16 deletions(-) diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets index b7a9bf8b1fdc8b..dde49575d7ae44 100644 --- a/eng/testing/tests.ioslike.targets +++ b/eng/testing/tests.ioslike.targets @@ -132,19 +132,12 @@ <_ApplePropertyNames Include="ShouldILStrip" /> <_ApplePropertyNames Include="UseConsoleUITemplate" /> <_ApplePropertyNames Include="UseRuntimeComponents" /> + <_ApplePropertyNames Include="_NetCoreAppToolCurrent" /> <_ApplePropertyNames Include="HybridGlobalization" /> <_ApplePropertyNames Include="InvariantGlobalization" /> - - <_ApplePropertyNames Include="_NetCoreAppToolCurrent" /> - <_ApplePropertyNames Include="DebuggerSupport" /> - <_ApplePropertyNames Include="EventSourceSupport" /> - <_ApplePropertyNames Include="JsonSerializerIsReflectionEnabledByDefault" /> - <_ApplePropertyNames Include="MetadataUpdaterSupport" /> - - <_AppleUsedRuntimePackFiles Include="@(_UsedRuntimePackFiles->'%(FileName)%(Extension)')" RemoveMetadata="_IsNative;TargetDir" /> diff --git a/src/libraries/System.Net.Security/tests/FunctionalTests/System.Net.Security.Tests.csproj b/src/libraries/System.Net.Security/tests/FunctionalTests/System.Net.Security.Tests.csproj index 182b664ed2ce75..fe9c74708ad615 100644 --- a/src/libraries/System.Net.Security/tests/FunctionalTests/System.Net.Security.Tests.csproj +++ b/src/libraries/System.Net.Security/tests/FunctionalTests/System.Net.Security.Tests.csproj @@ -5,7 +5,7 @@ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-unix;$(NetCoreAppCurrent)-browser;$(NetCoreAppCurrent)-osx;$(NetCoreAppCurrent)-ios true true - true + true diff --git a/src/libraries/System.Resources.Extensions/tests/System.Resources.Extensions.Tests.csproj b/src/libraries/System.Resources.Extensions/tests/System.Resources.Extensions.Tests.csproj index a0533c343614c6..cdac299d8f7571 100644 --- a/src/libraries/System.Resources.Extensions/tests/System.Resources.Extensions.Tests.csproj +++ b/src/libraries/System.Resources.Extensions/tests/System.Resources.Extensions.Tests.csproj @@ -2,7 +2,6 @@ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-unix;$(NetFrameworkMinimum) true - true diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/System.Text.Json.Tests.csproj b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/System.Text.Json.Tests.csproj index 490167bc8362c8..42311cebf6fc1b 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/System.Text.Json.Tests.csproj +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/System.Text.Json.Tests.csproj @@ -12,14 +12,19 @@ - true + true - true + true true + + - true - + + true diff --git a/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.targets b/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.targets index fcc6f72aff2dfc..cf3bbeb98e7691 100644 --- a/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.targets +++ b/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.targets @@ -40,8 +40,6 @@ $(NoWarn);IL2103;IL2105;IL2025;IL2111 $(NoWarn);IL2035 - - false true diff --git a/src/libraries/System.Runtime.Loader/tests/System.Runtime.Loader.Tests.csproj b/src/libraries/System.Runtime.Loader/tests/System.Runtime.Loader.Tests.csproj index d08ffd73643c09..8bb2962a4e59ec 100644 --- a/src/libraries/System.Runtime.Loader/tests/System.Runtime.Loader.Tests.csproj +++ b/src/libraries/System.Runtime.Loader/tests/System.Runtime.Loader.Tests.csproj @@ -68,9 +68,10 @@ - + - + + diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/ILLink.Descriptors.iOS.xml b/src/libraries/System.Runtime/tests/System.Runtime.Tests/ILLink.Descriptors.iOS.xml index f90810cd0c9d15..b327a37c7a60be 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/ILLink.Descriptors.iOS.xml +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/ILLink.Descriptors.iOS.xml @@ -9,27 +9,11 @@ - - - - - - - - - - - - - - - - - + - + diff --git a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj index 9b2e339cfcb13b..787ce9f8619b33 100644 --- a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj +++ b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj @@ -7,7 +7,7 @@ $([MSBuild]::NormalizeDirectory($(TestRootDir), '..', 'extraFiles')) $([MSBuild]::NormalizeDirectory($(TestRootDir), '..', 'obj')) - ConfigureTrimming;_TrimApp;$(AppleBuildDependsOn) + ConfigureTrimming;_AdjustTrimmedAssembliesToBundle;$(AppleBuildDependsOn) _PublishRuntimePack;_PrepareForAppleBuildAppOnHelix;$(AppleBuildDependsOn);_AfterAppleBuildOnHelix true @@ -42,6 +42,12 @@ false + + + + + + @@ -107,16 +113,11 @@ <_RuntimePackFiles Condition="%(_AppleUsedRuntimePackFiles.Extension) != '.dll' or %(_AppleUsedRuntimePackFiles.FileName) == 'System.Private.CoreLib'" Include="@(_AppleUsedRuntimePackFiles->'$(MicrosoftNetCoreAppRuntimePackNativeDir)%(FileName)%(Extension)')" /> - - - - - - + From 2fdf8ee998f55dcb931813984696c6f0cf0b6a20 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Tue, 9 Apr 2024 17:17:40 +0200 Subject: [PATCH 09/19] Revert ILLink switch properties --- .../tests/System.Resources.Extensions.Tests.csproj | 1 + .../System.Text.Json.Tests/System.Text.Json.Tests.csproj | 9 ++------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/libraries/System.Resources.Extensions/tests/System.Resources.Extensions.Tests.csproj b/src/libraries/System.Resources.Extensions/tests/System.Resources.Extensions.Tests.csproj index cdac299d8f7571..a0533c343614c6 100644 --- a/src/libraries/System.Resources.Extensions/tests/System.Resources.Extensions.Tests.csproj +++ b/src/libraries/System.Resources.Extensions/tests/System.Resources.Extensions.Tests.csproj @@ -2,6 +2,7 @@ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-unix;$(NetFrameworkMinimum) true + true diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/System.Text.Json.Tests.csproj b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/System.Text.Json.Tests.csproj index 42311cebf6fc1b..cada80f5cee613 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/System.Text.Json.Tests.csproj +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/System.Text.Json.Tests.csproj @@ -16,15 +16,10 @@ true true - - - - + true + true From 1ad48a599ac17ef66419037caffe055896b1a6c0 Mon Sep 17 00:00:00 2001 From: Ivan Povazan Date: Wed, 10 Apr 2024 16:34:01 +0200 Subject: [PATCH 10/19] Split browser-specific configuration --- .../tests/System.Reflection.MetadataLoadContext.Tests.csproj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libraries/System.Reflection.MetadataLoadContext/tests/System.Reflection.MetadataLoadContext.Tests.csproj b/src/libraries/System.Reflection.MetadataLoadContext/tests/System.Reflection.MetadataLoadContext.Tests.csproj index 4840625d1a6f17..32518ce3efa431 100644 --- a/src/libraries/System.Reflection.MetadataLoadContext/tests/System.Reflection.MetadataLoadContext.Tests.csproj +++ b/src/libraries/System.Reflection.MetadataLoadContext/tests/System.Reflection.MetadataLoadContext.Tests.csproj @@ -86,11 +86,13 @@ - + + + From 9152b150a051f205d2f7a7b72f137c6218a4ce7a Mon Sep 17 00:00:00 2001 From: Ivan Povazan Date: Wed, 10 Apr 2024 16:34:34 +0200 Subject: [PATCH 11/19] Add description about _AdjustTrimmedAssembliesToBundle --- src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj index 787ce9f8619b33..0230c7d10d3a5d 100644 --- a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj +++ b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj @@ -117,6 +117,7 @@ DestinationFolder="$(OriginalPublishDir)" /> + From a078d5e16d0fb087ff33dc9526d95eaa427d44b7 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 11 Apr 2024 14:39:16 +0200 Subject: [PATCH 12/19] Use ActiveIssue with IsBuiltWithAggressiveTrimming for disabled tests --- .../tests/Common/ConfigurationBinderTests.cs | 6 ++++-- .../tests/Metadata/Decoding/SignatureDecoderTests.cs | 3 ++- .../System.Reflection.TypeExtensions/tests/ModuleTests.cs | 2 +- .../System.Runtime.Tests/System/NullableMetadataTests.cs | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.cs index 1b79fb60f95892..7b0a8ca7e7e385 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.cs @@ -2118,7 +2118,8 @@ public void ComplexObj_As_Enumerable_Element() } #if !BUILDING_SOURCE_GENERATOR_TESTS - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser), nameof(PlatformDetection.IsNotAppleMobile))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91923", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsAppleMobile))] public void TraceSwitchTest() { var dic = new Dictionary @@ -2147,7 +2148,8 @@ private void ValidateGeolocation(IGeolocation location) [Fact] #if !BUILDING_SOURCE_GENERATOR_TESTS - [ActiveIssue("Investigate Build browser-wasm linux Release LibraryTests_EAT CI failure for reflection impl", TestPlatforms.Browser | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] + [ActiveIssue("Investigate Build browser-wasm linux Release LibraryTests_EAT CI failure for reflection impl", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91923", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsAppleMobile))] #endif public void TestGraphWithUnsupportedMember() { diff --git a/src/libraries/System.Reflection.Metadata/tests/Metadata/Decoding/SignatureDecoderTests.cs b/src/libraries/System.Reflection.Metadata/tests/Metadata/Decoding/SignatureDecoderTests.cs index 95e72ed21b8cd2..7570404923a7ab 100644 --- a/src/libraries/System.Reflection.Metadata/tests/Metadata/Decoding/SignatureDecoderTests.cs +++ b/src/libraries/System.Reflection.Metadata/tests/Metadata/Decoding/SignatureDecoderTests.cs @@ -129,7 +129,8 @@ public static void VarArgsCaller() } // Test as much as we can with simple C# examples inline below. - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles), nameof(PlatformDetection.IsNotAppleMobile))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91923", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsAppleMobile))] public void SimpleSignatureProviderCoverage() { using (FileStream stream = File.OpenRead(AssemblyPathHelper.GetAssemblyLocation(typeof(SignaturesToDecode<>).GetTypeInfo().Assembly))) diff --git a/src/libraries/System.Reflection.TypeExtensions/tests/ModuleTests.cs b/src/libraries/System.Reflection.TypeExtensions/tests/ModuleTests.cs index 695ce373521acb..e2007cd0b171ba 100644 --- a/src/libraries/System.Reflection.TypeExtensions/tests/ModuleTests.cs +++ b/src/libraries/System.Reflection.TypeExtensions/tests/ModuleTests.cs @@ -24,7 +24,7 @@ public void GetModuleVersionId_HasModuleVersionId_BehaveConsistently() // This calls Assembly.Load, but xUnit turn is into a LoadFrom because TinyAssembly is just a Content item in the project. [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))] - [SkipOnPlatform(TestPlatforms.Browser | TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "TinyAssembly GUID differs when trimming is enabled.")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91923", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsAppleMobile))] public void GetModuleVersionId_KnownAssembly_ReturnsExpected() { Module module = Assembly.Load(new AssemblyName("TinyAssembly")).ManifestModule; diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/NullableMetadataTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/NullableMetadataTests.cs index 3da8fb830320bd..24a1de935ad2f2 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/NullableMetadataTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/NullableMetadataTests.cs @@ -132,7 +132,7 @@ public static void NullableAttributesOnPublicApiOnly(Type type) [Theory] [InlineData("mscorlib")] [InlineData("System.Threading.Overlapped")] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst, "ILLink doesn't root forwarded types from rooted assemblies: https://github.com/dotnet/runtime/issues/99592")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/99592", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsAppleMobile))] public static void ShimsHaveOnlyTypeForwards(string assemblyName) { Assembly assembly = Assembly.Load(assemblyName); From 76ce3d3519515a40f7c968d5e1b124834cc4ff74 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 11 Apr 2024 15:13:20 +0200 Subject: [PATCH 13/19] Trim tests only on PR builds --- .../runtime-extra-platforms-ioslike.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml index 63163ef8c8da24..20190b080108ac 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml @@ -35,8 +35,14 @@ jobs: testGroup: innerloop nameSuffix: AllSubsets_Mono isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }} - buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true /p:IsManualOrRollingBuild=true /p:EnableAggressiveTrimming=true - timeoutInMinutes: 480 + # Don't trim tests on rolling builds + buildArgs: >- + -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true /p:IsManualOrRollingBuild=true + ${{ if eq(variables['isRollingBuild'], true) }}: + /p:EnableAggressiveTrimming=false + ${{ else }}: + /p:EnableAggressiveTrimming=true + timeoutInMinutes: 480 # extra steps, run tests postBuildSteps: - template: /eng/pipelines/libraries/helix.yml From 8c7118a656580480ea6fd4bee34e7586477b56f7 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 11 Apr 2024 15:16:03 +0200 Subject: [PATCH 14/19] Enable aggressive trimming by default --- eng/pipelines/runtime.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 98dc5285250f45..043c11b87bbd37 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -1009,7 +1009,7 @@ extends: jobParameters: testGroup: innerloop nameSuffix: AllSubsets_Mono - buildArgs: -s mono+libs+libs.tests+host+packs -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true /p:RunSmokeTestsOnly=true /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true + buildArgs: -s mono+libs+libs.tests+host+packs -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true /p:RunSmokeTestsOnly=true /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true /p:EnableAggressiveTrimming=true timeoutInMinutes: 480 condition: >- or( From f184b2d308f5d75e7aff5a1461af55090bbb84d3 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 11 Apr 2024 15:27:50 +0200 Subject: [PATCH 15/19] Fix ident --- .../extra-platforms/runtime-extra-platforms-ioslike.yml | 8 ++++---- .../System.Reflection.TypeExtensions/tests/ModuleTests.cs | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml index 20190b080108ac..d4fc4554e79d10 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml @@ -38,10 +38,10 @@ jobs: # Don't trim tests on rolling builds buildArgs: >- -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true /p:IsManualOrRollingBuild=true - ${{ if eq(variables['isRollingBuild'], true) }}: - /p:EnableAggressiveTrimming=false - ${{ else }}: - /p:EnableAggressiveTrimming=true + ${{ if eq(variables['isRollingBuild'], true) }}: + /p:EnableAggressiveTrimming=false + ${{ else }}: + /p:EnableAggressiveTrimming=true timeoutInMinutes: 480 # extra steps, run tests postBuildSteps: diff --git a/src/libraries/System.Reflection.TypeExtensions/tests/ModuleTests.cs b/src/libraries/System.Reflection.TypeExtensions/tests/ModuleTests.cs index e2007cd0b171ba..4e9233de36a73e 100644 --- a/src/libraries/System.Reflection.TypeExtensions/tests/ModuleTests.cs +++ b/src/libraries/System.Reflection.TypeExtensions/tests/ModuleTests.cs @@ -24,12 +24,14 @@ public void GetModuleVersionId_HasModuleVersionId_BehaveConsistently() // This calls Assembly.Load, but xUnit turn is into a LoadFrom because TinyAssembly is just a Content item in the project. [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91923", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsAppleMobile))] public void GetModuleVersionId_KnownAssembly_ReturnsExpected() { Module module = Assembly.Load(new AssemblyName("TinyAssembly")).ManifestModule; Assert.True(module.HasModuleVersionId()); - Assert.Equal(Guid.Parse("{06BB2468-908C-48CF-ADE9-DB6DE4614004}"), module.GetModuleVersionId()); + if (!(PlatformDetection.IsMonoRuntime && PlatformDetection.IsAppleMobile && PlatformDetection.IsBuiltWithAggressiveTrimming)) + { + Assert.Equal(Guid.Parse("{06BB2468-908C-48CF-ADE9-DB6DE4614004}"), module.GetModuleVersionId()); + } } } } From 428d945846352e7d3679e43a5c35e96c62723531 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 11 Apr 2024 15:29:30 +0200 Subject: [PATCH 16/19] Fix buildArgs command --- .../extra-platforms/runtime-extra-platforms-ioslike.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml index d4fc4554e79d10..6cc85222bff594 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml @@ -36,12 +36,10 @@ jobs: nameSuffix: AllSubsets_Mono isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }} # Don't trim tests on rolling builds - buildArgs: >- - -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true /p:IsManualOrRollingBuild=true ${{ if eq(variables['isRollingBuild'], true) }}: - /p:EnableAggressiveTrimming=false + buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true /p:IsManualOrRollingBuild=true /p:EnableAggressiveTrimming=false ${{ else }}: - /p:EnableAggressiveTrimming=true + buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true /p:IsManualOrRollingBuild=true /p:EnableAggressiveTrimming=true timeoutInMinutes: 480 # extra steps, run tests postBuildSteps: From f972c45a4ea157bd4c07d9b0d01524542a371839 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 11 Apr 2024 15:33:34 +0200 Subject: [PATCH 17/19] Fix ident --- .../extra-platforms/runtime-extra-platforms-ioslike.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml index 6cc85222bff594..784adf38c4fec5 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml @@ -36,10 +36,10 @@ jobs: nameSuffix: AllSubsets_Mono isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }} # Don't trim tests on rolling builds - ${{ if eq(variables['isRollingBuild'], true) }}: - buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true /p:IsManualOrRollingBuild=true /p:EnableAggressiveTrimming=false - ${{ else }}: - buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true /p:IsManualOrRollingBuild=true /p:EnableAggressiveTrimming=true + ${{ if eq(variables['isRollingBuild'], true) }}: + buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true /p:IsManualOrRollingBuild=true /p:EnableAggressiveTrimming=false + ${{ else }}: + buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true /p:IsManualOrRollingBuild=true /p:EnableAggressiveTrimming=true timeoutInMinutes: 480 # extra steps, run tests postBuildSteps: From 74cf6c521de606cfe60d6e9841bbaf785e4df7f2 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 11 Apr 2024 15:43:17 +0200 Subject: [PATCH 18/19] Fix ident --- .../runtime-extra-platforms-ioslike.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml index 784adf38c4fec5..be6ef9c63c00b6 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml @@ -36,11 +36,11 @@ jobs: nameSuffix: AllSubsets_Mono isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }} # Don't trim tests on rolling builds - ${{ if eq(variables['isRollingBuild'], true) }}: - buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true /p:IsManualOrRollingBuild=true /p:EnableAggressiveTrimming=false - ${{ else }}: - buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true /p:IsManualOrRollingBuild=true /p:EnableAggressiveTrimming=true - timeoutInMinutes: 480 + ${{ if eq(variables['isRollingBuild'], true) }}: + buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true /p:IsManualOrRollingBuild=true /p:EnableAggressiveTrimming=false + ${{ else }}: + buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true /p:IsManualOrRollingBuild=true /p:EnableAggressiveTrimming=true + timeoutInMinutes: 480 # extra steps, run tests postBuildSteps: - template: /eng/pipelines/libraries/helix.yml From 37f41dd7abd6546cc55b8e89990159318b530a24 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 12 Apr 2024 10:46:54 +0200 Subject: [PATCH 19/19] Remove EnableSoftTrimming property --- eng/testing/tests.mobile.targets | 24 +++---------------- .../apple/build/AppleBuild.LocalBuild.targets | 23 ++---------------- 2 files changed, 5 insertions(+), 42 deletions(-) diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index 89a38eef579f6e..e87458abd06991 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -25,15 +25,11 @@ - + true true $(NoWarn);IL2103;IL2105;IL2025;IL2111 - - $(NoWarn);IL2035 - - false false @@ -94,10 +90,9 @@ - + - link - copyused + link @@ -108,19 +103,6 @@ TrimMode="" is needed so the root assemblies are correctly identified --> - - - - - - - - - - - - - false - + true $(NoWarn);IL2103;IL2105;IL2025;IL2111 - - $(NoWarn);IL2035 - - - copyused - - + @@ -57,19 +51,6 @@ TrimMode="" is needed so the root assemblies are correctly identified --> - - - - - - - - - - - - -