diff --git a/dotnet/Makefile b/dotnet/Makefile index ee37cce87a..7473662d75 100644 --- a/dotnet/Makefile +++ b/dotnet/Makefile @@ -178,7 +178,7 @@ Workloads/Microsoft.NET.Sdk.$(1)/WorkloadManifest.json: Makefile $(TOP)/Make.con Workloads/Microsoft.NET.Sdk.$(1)/WorkloadManifest.targets: Makefile $(TOP)/Make.config.inc $(TOP)/.git/HEAD $(TOP)/.git/index Makefile generate-workloadmanifest-targets.csharp | Workloads/Microsoft.NET.Sdk.$(1) $$(Q) rm -f $$@.tmp - $$(Q_GEN) ./generate-workloadmanifest-targets.csharp "$(1)" "$$@.tmp" "$$(DOTNET_WINDOWS_PLATFORMS)" "$$(SUPPORTED_API_VERSIONS_$(4))" "$$(DEFAULT_TARGET_PLATFORM_VERSIONS_$(4))" + $$(Q_GEN) ./generate-workloadmanifest-targets.csharp "$(1)" "$$@.tmp" "$$(DOTNET_WINDOWS_PLATFORMS)" "$$(SUPPORTED_API_VERSIONS_$(4))" "$$(DEFAULT_TARGET_PLATFORM_VERSIONS_$(4))" "$$(DOTNET_TFM)-$($(4)_NUGET_OS_VERSION)" $$(Q) mv $$@.tmp $$@ Workloads/Microsoft.NET.Sdk.$(1)/LICENSE: $(TOP)/LICENSE | Workloads/Microsoft.NET.Sdk.$(1) diff --git a/dotnet/generate-workloadmanifest-targets.csharp b/dotnet/generate-workloadmanifest-targets.csharp index e80185bcc2..b4333d11d4 100755 --- a/dotnet/generate-workloadmanifest-targets.csharp +++ b/dotnet/generate-workloadmanifest-targets.csharp @@ -6,7 +6,7 @@ using System.IO; using System.Xml; var args = Environment.GetCommandLineArgs (); -var expectedArgumentCount = 5; +var expectedArgumentCount = 6; if (args.Length != expectedArgumentCount + 3 /* 2 default arguments (executable + script) + 'expectedArgumentCount' arguments we're interested in */) { // first arg is "/Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/4.5/csharp.exe" // second arg the script itself @@ -23,6 +23,7 @@ var windowsPlatforms = args [argumentIndex++].Split (new char [] { ' ' }, String var hasWindows = Array.IndexOf (windowsPlatforms, platform) >= 0; var supportedApiVersions = args [argumentIndex++].Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries); var defaultTargetPlatformVersions = args [argumentIndex++].Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries); +var currentApiVersion = args [argumentIndex++].Replace ('-', '_'); var platformLowerCase = platform.ToLowerInvariant (); @@ -64,13 +65,13 @@ using (var writer = new StreamWriter (outputPath)) { writer.WriteLine ($" "); writer.WriteLine ($" "); - writer.WriteLine ($" v).Last ().Replace ('-', '_')}\" />"); + writer.WriteLine ($" "); writer.WriteLine ($" "); writer.WriteLine (); writer.WriteLine ($" "); writer.WriteLine ($" "); - writer.WriteLine ($" v).Last ().Replace ('-', '_')}\" />"); + writer.WriteLine ($" "); writer.WriteLine ($" "); writer.WriteLine ($""); diff --git a/dotnet/targets/Xamarin.Shared.Sdk.props b/dotnet/targets/Xamarin.Shared.Sdk.props index e9625fa031..0bc9ed175e 100644 --- a/dotnet/targets/Xamarin.Shared.Sdk.props +++ b/dotnet/targets/Xamarin.Shared.Sdk.props @@ -177,6 +177,9 @@ false + + + true @@ -184,8 +187,5 @@ true - - - true diff --git a/dotnet/targets/Xamarin.Shared.Sdk.targets b/dotnet/targets/Xamarin.Shared.Sdk.targets index e5fb74f089..fba2c3a99f 100644 --- a/dotnet/targets/Xamarin.Shared.Sdk.targets +++ b/dotnet/targets/Xamarin.Shared.Sdk.targets @@ -460,27 +460,6 @@ Compile;_ComputeLinkerArguments;_ComputeManagedAssemblyToLink;SetupOSSpecificProps;PrepareForILLink;_XamarinComputeIlcCompileInputs - - - - true - - - @@ -1677,8 +1656,36 @@ + + + $(_BundlerDebug) + + + + + + + + + <_ComputePublishLocationDependsOn> + $(_ComputePublishLocationDependsOn); + _GenerateBundleName; + _ParseBundlerArguments; + _ComputeMonoLibraries; + _DetectSigningIdentity; + _PrepareResourceRules; + _AddDebugSymbolsToBundle; + + + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index c1d46f9959..884167821e 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,8 +1,8 @@ - + https://github.com/dotnet/installer - a6b903004774fb1b4e638f47c602fc968b43a8c0 + ec56994f9c0ff74869d707f145b4e0796d28f3bc https://github.com/dotnet/runtime @@ -74,9 +74,9 @@ https://github.com/dotnet/templating - + https://github.com/dotnet/xharness - 1446eababf78d7787af2aa86d5393c342c4b1b0b + a3a749a7056623c665bba226fe843152f413f044 diff --git a/eng/Versions.props b/eng/Versions.props index 8c17777f0e..f11c78311c 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -2,7 +2,7 @@ - 8.0.100-rc.2.23462.1 + 8.0.100-rc.2.23463.8 8.0.0-rc.2.23431.9 6.0.0-beta.21212.6 8.0.0-rc.2.23431.9 @@ -10,7 +10,7 @@ 7.0.7 7.0.100-alpha.1.21601.1 0.11.4-alpha.23428.2 - 8.0.0-prerelease.23431.1 + 8.0.0-prerelease.23456.2 $(MicrosoftNETWorkloadEmscriptenCurrentManifest80100TransportVersion) $(MicrosoftNETWorkloadEmscriptenCurrentManifest80100TransportVersion) diff --git a/global.json b/global.json index 2d9fbddc79..eb5debe0e5 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "8.0.100-rc.2.23462.1" + "version": "8.0.100-rc.2.23463.8" } } diff --git a/src/ObjCRuntime/RegistrarHelper.cs b/src/ObjCRuntime/RegistrarHelper.cs index 99dc2d3d5b..a790af23ec 100644 --- a/src/ObjCRuntime/RegistrarHelper.cs +++ b/src/ObjCRuntime/RegistrarHelper.cs @@ -194,12 +194,6 @@ namespace ObjCRuntime { return entry.Registrar.LookupUnmanagedFunction (symbol, id); } - [MethodImpl(MethodImplOptions.NoInlining)] - static bool RuntimeTypeHandleEquals (ref RuntimeTypeHandle typeHandle, RuntimeTypeHandle otherTypeHandle) - { - return typeHandle.Equals (otherTypeHandle); - } - internal static Type LookupRegisteredType (Assembly assembly, uint id) { var entry = GetMapEntry (assembly); diff --git a/src/bgen/AttributeManager.cs b/src/bgen/AttributeManager.cs index 1ef10146e6..a5143afccf 100644 --- a/src/bgen/AttributeManager.cs +++ b/src/bgen/AttributeManager.cs @@ -219,6 +219,8 @@ public class AttributeManager { return typeof (System.Runtime.Versioning.SupportedOSPlatformAttribute); case "System.Runtime.Versioning.UnsupportedOSPlatformAttribute": return typeof (System.Runtime.Versioning.UnsupportedOSPlatformAttribute); + case "System.Runtime.Versioning.ObsoletedOSPlatformAttribute": + return typeof (System.Runtime.Versioning.ObsoletedOSPlatformAttribute); #endif } @@ -338,6 +340,14 @@ public class AttributeManager { return AttributeFactory.CreateNewAttribute (up).Yield (); else return Enumerable.Empty (); + case "ObsoletedOSPlatformAttribute": + var oarg = attribute.ConstructorArguments [0].Value as string; + (var op, var ov) = ParseOSPlatformAttribute (oarg); + // might have been available for a while... + if (ov is null) + return AttributeFactory.CreateNewAttribute (op).Yield (); + else + return AttributeFactory.CreateNewAttribute (op, ov.Major, ov.Minor).Yield (); #endif default: return Enumerable.Empty (); diff --git a/tests/bgen/Makefile b/tests/bgen/Makefile index e1cca50ff1..f387cc61da 100644 --- a/tests/bgen/Makefile +++ b/tests/bgen/Makefile @@ -2,4 +2,4 @@ TOP=../.. include $(TOP)/Make.config run-tests: - $(DOTNET) test + $(DOTNET) test $(TEST_FILTER) diff --git a/tests/common/Configuration.cs b/tests/common/Configuration.cs index 37cbe79c84..24426d1bf7 100644 --- a/tests/common/Configuration.cs +++ b/tests/common/Configuration.cs @@ -479,6 +479,12 @@ namespace Xamarin.Tests { return GetVariable (variableName, variableName + " not found"); } + public static string GetNuGetOsVersion (ApplePlatform platform) + { + var variableName = platform.AsString ().ToUpper () + "_NUGET_OS_VERSION"; + return GetVariable (variableName, variableName + " not found"); + } + public static string GetDotNetRoot () { if (IsVsts) { @@ -811,13 +817,18 @@ namespace Xamarin.Tests { } } - public static IEnumerable GetRefLibraries () { foreach (var platform in GetIncludedPlatforms (true)) yield return Path.Combine (GetRefDirectory (platform), GetBaseLibraryName (platform, true)); } + + public static string GetRefLibrary (ApplePlatform platform) + { + return GetBaseLibrary (platform, true); + } + public static string GetTargetFramework (Profile profile) { switch (profile) { diff --git a/tests/dotnet/UnitTests/BundleStructureTest.cs b/tests/dotnet/UnitTests/BundleStructureTest.cs index 4acaa75e9c..3e9ad5e413 100644 --- a/tests/dotnet/UnitTests/BundleStructureTest.cs +++ b/tests/dotnet/UnitTests/BundleStructureTest.cs @@ -292,7 +292,7 @@ namespace Xamarin.Tests { expectedFiles.Add (Path.Combine (assemblyDirectory, "Touch.Client.dll")); if (includeDebugFiles) expectedFiles.Add (Path.Combine (assemblyDirectory, "Touch.Client.pdb")); - AddMultiRidAssembly (platform, expectedFiles, assemblyDirectory, Path.GetFileNameWithoutExtension (Configuration.GetBaseLibraryName (platform, true)), runtimeIdentifiers, forceSingleRid: (platform == ApplePlatform.MacCatalyst && !isReleaseBuild) || platform == ApplePlatform.MacOSX, hasPdb: false, includeDebugFiles: includeDebugFiles); + AddMultiRidAssembly (platform, expectedFiles, assemblyDirectory, Path.GetFileNameWithoutExtension (Configuration.GetBaseLibraryName (platform, true)), runtimeIdentifiers, forceSingleRid: (platform == ApplePlatform.MacCatalyst && !isReleaseBuild) || platform == ApplePlatform.MacOSX, includeDebugFiles: includeDebugFiles); expectedFiles.Add (Path.Combine (assemblyDirectory, "runtimeconfig.bin")); switch (platform) { @@ -423,11 +423,11 @@ namespace Xamarin.Tests { } - static void AddMultiRidAssembly (ApplePlatform platform, List expectedFiles, string assemblyDirectory, string assemblyName, string [] runtimeIdentifiers, bool forceSingleRid = false, bool hasPdb = true, bool addConfig = false, bool includeDebugFiles = false) + static void AddMultiRidAssembly (ApplePlatform platform, List expectedFiles, string assemblyDirectory, string assemblyName, string [] runtimeIdentifiers, bool forceSingleRid = false, bool addConfig = false, bool includeDebugFiles = false) { if (forceSingleRid || runtimeIdentifiers.Length == 1) { expectedFiles.Add (Path.Combine (assemblyDirectory, $"{assemblyName}.dll")); - if (hasPdb && includeDebugFiles) + if (includeDebugFiles) expectedFiles.Add (Path.Combine (assemblyDirectory, $"{assemblyName}.pdb")); if (addConfig) expectedFiles.Add (Path.Combine (assemblyDirectory, $"{assemblyName}.dll.config")); @@ -436,7 +436,7 @@ namespace Xamarin.Tests { foreach (var rid in runtimeIdentifiers) { expectedFiles.Add (Path.Combine (Path.Combine (assemblyDirectory, ".xamarin", $"{rid}"))); expectedFiles.Add (Path.Combine (Path.Combine (assemblyDirectory, ".xamarin", $"{rid}", $"{assemblyName}.dll"))); - if (hasPdb && includeDebugFiles) + if (includeDebugFiles) expectedFiles.Add (Path.Combine (Path.Combine (assemblyDirectory, ".xamarin", $"{rid}", $"{assemblyName}.pdb"))); if (addConfig) expectedFiles.Add (Path.Combine (Path.Combine (assemblyDirectory, ".xamarin", $"{rid}", $"{assemblyName}.dll.config"))); diff --git a/tests/dotnet/UnitTests/PackTest.cs b/tests/dotnet/UnitTests/PackTest.cs index cf210a65e6..ad20817217 100644 --- a/tests/dotnet/UnitTests/PackTest.cs +++ b/tests/dotnet/UnitTests/PackTest.cs @@ -180,6 +180,7 @@ namespace Xamarin.Tests { // Get all the supported API versions var supportedApiVersion = Configuration.GetVariableArray ($"SUPPORTED_API_VERSIONS_{platform.AsString ().ToUpperInvariant ()}"); + supportedApiVersion = DotNetProjectTest.RemovePostCurrentOnMacCatalyst (supportedApiVersion, platform); var targetFrameworks = string.Join (";", supportedApiVersion.Select (v => v.Replace ("-", "-" + platform.AsString ().ToLowerInvariant ()))); var project = "MultiTargetingLibrary"; diff --git a/tests/dotnet/UnitTests/ProjectTest.cs b/tests/dotnet/UnitTests/ProjectTest.cs index 5247cab1b8..72e04713df 100644 --- a/tests/dotnet/UnitTests/ProjectTest.cs +++ b/tests/dotnet/UnitTests/ProjectTest.cs @@ -1504,6 +1504,7 @@ namespace Xamarin.Tests { // Get all the supported API versions var supportedApiVersion = Configuration.GetVariableArray ($"SUPPORTED_API_VERSIONS_{platform.AsString ().ToUpperInvariant ()}"); + supportedApiVersion = RemovePostCurrentOnMacCatalyst (supportedApiVersion, platform); var targetFrameworks = string.Join (";", supportedApiVersion.Select (v => v.Replace ("-", "-" + platform.AsString ().ToLowerInvariant ()))); var project = "MultiTargetingLibrary"; @@ -1515,6 +1516,19 @@ namespace Xamarin.Tests { rv.AssertNoWarnings (); } + // Mac Catalyst projects can't be built with an earlier version of Xcode (even library projects), + // which means that we can't build for target frameworks > than the current one (because we'll only have + // the Xcode installed for the current target framework, especially on bots). + // So filter out any target framework on Mac Catalyst that's after the current one. + internal static IList RemovePostCurrentOnMacCatalyst (IList self, ApplePlatform platform) + { + if (platform == ApplePlatform.MacCatalyst) { + var current = Configuration.DotNetTfm + "_" + Configuration.GetNuGetOsVersion (platform); + return self.Where (v => string.Compare (v, current, StringComparison.Ordinal) <= 0).ToList (); + } + return self; + } + [Test] [TestCase (ApplePlatform.MacCatalyst)] [TestCase (ApplePlatform.iOS)] diff --git a/tests/dotnet/size-comparison/common.mk b/tests/dotnet/size-comparison/common.mk index 96d3b177db..188fadfd66 100644 --- a/tests/dotnet/size-comparison/common.mk +++ b/tests/dotnet/size-comparison/common.mk @@ -23,8 +23,10 @@ PROJECT_NEW_FILE?=./dotnet/$(PROJECT_NEW_NAME).csproj PROJECT_OLD_APP?=./oldnet/bin/iPhone/Release/$(PROJECT_NEW_NAME).app PROJECT_NEW_APP?=./dotnet/bin/iPhone/Release/$(DOTNET_TFM)-ios/ios-arm64/$(PROJECT).app +APPCOMPARE?=appcompare + report: - appcompare \ + $(APPCOMPARE) \ $(abspath $(PROJECT_OLD_APP)) \ $(abspath $(PROJECT_NEW_APP)) \ --output-markdown $(abspath ./report.md) \ diff --git a/tests/generator/BGenTests.cs b/tests/generator/BGenTests.cs index 2773988476..908003eed1 100644 --- a/tests/generator/BGenTests.cs +++ b/tests/generator/BGenTests.cs @@ -1405,6 +1405,21 @@ namespace GeneratorTests { Assert.That (failures, Is.Empty, "Failures"); } +#if !NET + [Ignore ("This only applies to .NET")] +#endif + [Test] + [TestCase (Profile.iOS)] + public void ObsoletedOSPlatform (Profile profile) + { + Configuration.IgnoreIfIgnoredPlatform (profile.AsPlatform ()); + var bgen = new BGenTool (); + bgen.Profile = profile; + bgen.AddTestApiDefinition ("tests/obsoletedosplatform.cs"); + bgen.CreateTemporaryBinding (); + bgen.AssertExecute ("build"); + } + BGenTool BuildFile (Profile profile, params string [] filenames) { return BuildFile (profile, true, false, filenames); diff --git a/tests/generator/tests/obsoletedosplatform.cs b/tests/generator/tests/obsoletedosplatform.cs new file mode 100644 index 0000000000..2d739475ca --- /dev/null +++ b/tests/generator/tests/obsoletedosplatform.cs @@ -0,0 +1,10 @@ +using System.Runtime.Versioning; +using Foundation; +using UIKit; + +namespace iosbindinglib { + [Protocol, Model] + [BaseType (typeof (UIApplicationDelegate))] + public interface TestDelegate { + } +} diff --git a/tests/linker/ios/link all/LinkAllTest.cs b/tests/linker/ios/link all/LinkAllTest.cs index 0c4d22b932..19796568a4 100644 --- a/tests/linker/ios/link all/LinkAllTest.cs +++ b/tests/linker/ios/link all/LinkAllTest.cs @@ -163,6 +163,24 @@ namespace LinkAll { Assert.True (default_value, "DefaultValue"); } +#if NET + static void Check (string calendarName, bool present) + { + var type = Type.GetType ("System.Globalization." + calendarName); + bool success = present == (type is not null); + Assert.AreEqual (present, type is not null, calendarName); + } + + [Test] + public void Calendars () + { + Check ("GregorianCalendar", true); + Check ("UmAlQuraCalendar", true); + Check ("HijriCalendar", true); + Check ("ThaiBuddhistCalendar", true); + } +#endif // NET + public enum CertificateProblem : long { CertEXPIRED = 0x800B0101, CertVALIDITYPERIODNESTING = 0x800B0102, diff --git a/tests/linker/mac/link all/LinkAllTest.cs b/tests/linker/mac/link all/LinkAllTest.cs index f2feea185f..60059c532d 100644 --- a/tests/linker/mac/link all/LinkAllTest.cs +++ b/tests/linker/mac/link all/LinkAllTest.cs @@ -15,7 +15,7 @@ namespace LinkAllTests { [TestFixture] [Preserve (AllMembers = true)] public class LinkAllTest { - +#if !NET // this test is in a file shared with all platforms for .NET static void Check (string calendarName, bool present) { var type = Type.GetType ("System.Globalization." + calendarName); @@ -27,16 +27,11 @@ namespace LinkAllTests { public void Calendars () { Check ("GregorianCalendar", true); -#if NET && __MACOS__ // I'm not sure if this is the expected behavior for macOS, or if it's a bug somewhere. - Check ("UmAlQuraCalendar", true); - Check ("HijriCalendar", true); - Check ("ThaiBuddhistCalendar", true); -#else Check ("UmAlQuraCalendar", false); Check ("HijriCalendar", false); Check ("ThaiBuddhistCalendar", false); -#endif } +#endif // !NET [Test] public void EnsureUIThreadException () diff --git a/tests/monotouch-test/CoreServices/FSEventStreamTest.cs b/tests/monotouch-test/CoreServices/FSEventStreamTest.cs index fa9eac0df7..5c76c0778c 100644 --- a/tests/monotouch-test/CoreServices/FSEventStreamTest.cs +++ b/tests/monotouch-test/CoreServices/FSEventStreamTest.cs @@ -117,6 +117,8 @@ namespace MonoTouchFixtures.CoreServices { long maxFilesToCreate) : base (new [] { rootPath }, TimeSpan.Zero, createFlags) { + log.Add ($"{DateTime.Now} Creating monitor"); + _rootPath = rootPath; _createFlags = createFlags; @@ -128,6 +130,7 @@ namespace MonoTouchFixtures.CoreServices { { SetDispatchQueue (_dispatchQueue); Assert.IsTrue (Start ()); + log.Add ($"{DateTime.Now} Started monitor"); var isWorking = true; @@ -144,6 +147,7 @@ namespace MonoTouchFixtures.CoreServices { while (isWorking) NSRunLoop.Current.RunUntil (NSDate.Now.AddSeconds (0.1)); + log.Add ($"{DateTime.Now} Done looping while working"); Invalidate (); @@ -174,6 +178,9 @@ namespace MonoTouchFixtures.CoreServices { void CreateFilesAndWaitForFSEventsThread () { + lock (_monitor) + log.Add ($"{DateTime.Now} Starting creating stuff"); + for (var i = 0; i < _directoriesToCreate; i++) { var level1Path = Path.Combine (_rootPath, Guid.NewGuid ().ToString ()); @@ -195,6 +202,9 @@ namespace MonoTouchFixtures.CoreServices { FlushSync (); } + lock (_monitor) + log.Add ($"{DateTime.Now} Done creating stuff"); + while (true) { int createdDirCount; int createdFileCount; @@ -221,13 +231,18 @@ namespace MonoTouchFixtures.CoreServices { throw new TimeoutException ( $"test has timed out at {s_testTimeout.TotalSeconds}s; " + "increase the timeout or reduce the number of files created. " + - $"Created directories: {createdDirCount} Created files: {createdFileCount} Removed files: {removedFileCount} Created then removed files: {createdThenRemovedFileCount}"); + $"Created directories: {createdDirCount} (exit condition: 0) Created files: {createdFileCount} (exit condition: 0) Removed files: {removedFileCount} Created then removed files: {createdThenRemovedFileCount}\n{log.Count} Log lines:\n\t{string.Join ("\n\t", log)}"); } } + List log = new (); + protected override void OnEvents (FSEvent [] events) { try { + lock (_monitor) + log.Add ($"{DateTime.Now} OnEvents ({events.Length} events)"); + foreach (var evnt in events) { lock (_monitor) { HandleEvent (evnt); @@ -241,6 +256,7 @@ namespace MonoTouchFixtures.CoreServices { void HandleEvent (FSEvent evnt) { + log.Add ($"{DateTime.Now} HandleEvent ({evnt}) Path: {evnt.Path} Flags: {evnt.Flags}"); Assert.IsNotNull (evnt.Path); // Roslyn analyzer doesn't consider the assert above wrt nullability if (evnt.Path is null) diff --git a/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/DetectSdkLocationsTaskTests.cs b/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/DetectSdkLocationsTaskTests.cs index cdf95684df..d730191c0a 100644 --- a/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/DetectSdkLocationsTaskTests.cs +++ b/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/DetectSdkLocationsTaskTests.cs @@ -6,6 +6,7 @@ using NUnit.Framework; using Xamarin.iOS.Tasks; using Xamarin.Tests; +using Xamarin.Utils; namespace Xamarin.MacDev.Tasks { [TestFixture] @@ -13,6 +14,7 @@ namespace Xamarin.MacDev.Tasks { [Test] public void InvalidXamarinSdkRoot () { + Configuration.IgnoreIfIgnoredPlatform (ApplePlatform.iOS); var task = CreateTask (); task.XamarinSdkRoot = "XYZ"; task.TargetFrameworkMoniker = "Xamarin.iOS,v1.0"; @@ -25,6 +27,7 @@ namespace Xamarin.MacDev.Tasks { public void InexistentSDKVersion () { Configuration.AssertLegacyXamarinAvailable (); + Configuration.IgnoreIfIgnoredPlatform (ApplePlatform.iOS); var task = CreateTask (); task.SdkVersion = "4.0"; task.TargetFrameworkMoniker = "Xamarin.iOS,v1.0"; diff --git a/tests/xharness/Jenkins/NUnitTestTasksEnumerable.cs b/tests/xharness/Jenkins/NUnitTestTasksEnumerable.cs index 49367ae2e0..2a6caaf7db 100644 --- a/tests/xharness/Jenkins/NUnitTestTasksEnumerable.cs +++ b/tests/xharness/Jenkins/NUnitTestTasksEnumerable.cs @@ -105,7 +105,7 @@ namespace Xharness.Jenkins { Platform = TestPlatform.iOS, TestName = "MTouch tests", Timeout = TimeSpan.FromMinutes (180), - Ignored = !jenkins.TestSelection.IsEnabled (TestLabel.Mtouch), + Ignored = !jenkins.TestSelection.IsEnabled (TestLabel.Mtouch) || !jenkins.TestSelection.IsEnabled (PlatformLabel.iOS), InProcess = true, }; yield return nunitExecutionMTouch; diff --git a/tools/devops/automation/scripts/bash/install-workloads.sh b/tools/devops/automation/scripts/bash/install-workloads.sh index e15161e36e..709523c676 100755 --- a/tools/devops/automation/scripts/bash/install-workloads.sh +++ b/tools/devops/automation/scripts/bash/install-workloads.sh @@ -40,7 +40,10 @@ fi # Start working make global.json +make -C builds dotnet + # Check if .NET is even enabled +# Note that we do this after downloading .NET, because we need .NET to build some of our tests that may contain legacy tests (such as the MSBuild tests). var=$(make -C "$BUILD_SOURCESDIRECTORY/xamarin-macios/tools/devops" print-variable VARIABLE=ENABLE_DOTNET) ENABLE_DOTNET=${var#*=} if test -z "$ENABLE_DOTNET"; then @@ -48,8 +51,6 @@ if test -z "$ENABLE_DOTNET"; then exit 0 fi -make -C builds dotnet - var=$(make -C "$BUILD_SOURCESDIRECTORY/xamarin-macios/tools/devops" print-variable VARIABLE=DOTNET) DOTNET=${var#*=} echo "Using dotnet found at $DOTNET" diff --git a/tools/dotnet-linker/AppBundleRewriter.cs b/tools/dotnet-linker/AppBundleRewriter.cs index 8f29f8fed6..9c997c8730 100644 --- a/tools/dotnet-linker/AppBundleRewriter.cs +++ b/tools/dotnet-linker/AppBundleRewriter.cs @@ -513,13 +513,9 @@ namespace Xamarin.Linker { public MethodReference RuntimeTypeHandle_Equals { get { - if (configuration.Application.XamarinRuntime == XamarinRuntime.MonoVM) { - return RegistrarHelper_RuntimeTypeHandleEquals; - } return GetMethodReference (CorlibAssembly, System_RuntimeTypeHandle, "Equals", isStatic: false, System_RuntimeTypeHandle); } } - public MethodReference MethodBase_Invoke { get { return GetMethodReference (CorlibAssembly, System_Reflection_MethodBase, "Invoke", (v) => @@ -770,20 +766,6 @@ namespace Xamarin.Linker { } } - public MethodReference RegistrarHelper_RuntimeTypeHandleEquals { - get { - return GetMethodReference (PlatformAssembly, - ObjCRuntime_RegistrarHelper, - "RuntimeTypeHandleEquals", - (v) => v.IsStatic - && v.HasParameters - && v.Parameters.Count == 2 - && v.Parameters [0].ParameterType is ByReferenceType brt1 && brt1.ElementType.Is ("System", "RuntimeTypeHandle") - && v.Parameters [1].ParameterType.Is ("System", "RuntimeTypeHandle") - && !v.HasGenericParameters); - } - } - public MethodReference IManagedRegistrar_LookupUnmanagedFunction { get { return GetMethodReference (PlatformAssembly, diff --git a/tools/dotnet-linker/Steps/ManagedRegistrarLookupTablesStep.cs b/tools/dotnet-linker/Steps/ManagedRegistrarLookupTablesStep.cs index 803a063e1d..c2c8c00410 100644 --- a/tools/dotnet-linker/Steps/ManagedRegistrarLookupTablesStep.cs +++ b/tools/dotnet-linker/Steps/ManagedRegistrarLookupTablesStep.cs @@ -188,7 +188,8 @@ namespace Xamarin.Linker { types.RemoveAll (v => IsTrimmed (v.Definition)); // We also want all the protocol wrapper types - foreach (var type in registrarType.Module.Types) { + var allTypes = IterateTypes (registrarType.Module.Types); + foreach (var type in allTypes) { if (IsTrimmed (type)) continue; var wrapperType = StaticRegistrar.GetProtocolAttributeWrapperType (type); @@ -204,6 +205,17 @@ namespace Xamarin.Linker { return types; } + IEnumerable IterateTypes (IEnumerable types) + { + foreach (var type in types) { + yield return type; + if (type.HasNestedTypes) { + foreach (var td in IterateTypes (type.NestedTypes)) + yield return td; + } + } + } + IEnumerable GetRelevantTypes (Func isRelevant) => StaticRegistrar.GetAllTypes (abr.CurrentAssembly) .Cast () diff --git a/tools/dotnet-linker/Steps/ManagedRegistrarStep.cs b/tools/dotnet-linker/Steps/ManagedRegistrarStep.cs index 43164d2293..40c8808a18 100644 --- a/tools/dotnet-linker/Steps/ManagedRegistrarStep.cs +++ b/tools/dotnet-linker/Steps/ManagedRegistrarStep.cs @@ -162,12 +162,6 @@ namespace Xamarin.Linker { if (modified) abr.SaveCurrentAssembly (); - if (App.XamarinRuntime == XamarinRuntime.MonoVM) { - var md = abr.RegistrarHelper_RuntimeTypeHandleEquals.Resolve (); - md.IsPublic = true; - Annotations.Mark (md); - } - // TODO: Move this to a separate "MakeEverythingWorkWithNativeAOTStep" linker step if (App.XamarinRuntime == XamarinRuntime.NativeAOT && Configuration.Profile.IsProductAssembly (assembly)) { ImplementNSObjectRegisterToggleRefMethodStub ();