[net8.0-xcode15] Merge net8.0 into net8.0-xcode15.

This commit is contained in:
Rolf Bjarne Kvinge 2023-09-18 18:28:24 +02:00
Родитель e2dc23e651 1cb265bfad
Коммит 79ff82d046
26 изменённых файлов: 171 добавлений и 85 удалений

Просмотреть файл

@ -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)

Просмотреть файл

@ -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 ($" <!-- Using a .NET version we no longer support -->");
writer.WriteLine ($" <ImportGroup Condition=\" '$(TargetPlatformIdentifier)' == '{platform}' And '$(_AppleSdkLoaded)' != 'true' And '$(TargetFrameworkVersion)' != '' And $([MSBuild]::VersionLessThan('$(TargetFrameworkVersion)', '{minDotNetVersion}'))\">");
writer.WriteLine ($" <Import Project=\"Sdk-eol.props\" Sdk=\"Microsoft.{platform}.Sdk.{supportedApiVersions.OrderBy (v => v).Last ().Replace ('-', '_')}\" />");
writer.WriteLine ($" <Import Project=\"Sdk-eol.props\" Sdk=\"Microsoft.{platform}.Sdk.{currentApiVersion}\" />");
writer.WriteLine ($" </ImportGroup>");
writer.WriteLine ();
writer.WriteLine ($" <!-- Using a specific, but unsupported, target platform version -->");
writer.WriteLine ($" <ImportGroup Condition=\" '$(TargetPlatformIdentifier)' == '{platform}' And '$(_AppleSdkLoaded)' != 'true'\">");
writer.WriteLine ($" <Import Project=\"Sdk-error.props\" Sdk=\"Microsoft.{platform}.Sdk.{supportedApiVersions.OrderBy (v => v).Last ().Replace ('-', '_')}\" />");
writer.WriteLine ($" <Import Project=\"Sdk-error.props\" Sdk=\"Microsoft.{platform}.Sdk.{currentApiVersion}\" />");
writer.WriteLine ($" </ImportGroup>");
writer.WriteLine ($"</Project>");

Просмотреть файл

@ -177,6 +177,9 @@
<PropertyGroup Condition="'$(PublishAot)' == 'true'">
<!-- This turns off some NativeAOT logic we don't want nor need -->
<NativeCompilationDuringPublish>false</NativeCompilationDuringPublish>
<!-- We must find the BCL libraries using the runtime pack instead of using the built-in NativeAOT BCL -->
<PublishAotUsingRuntimePack>true</PublishAotUsingRuntimePack>
</PropertyGroup>
<PropertyGroup Condition="'$(PublishAot)' == 'true' And '$(_IsPublishing)' == 'true'">
<!-- Disable our own assembly IL stripping logic, because ILC does that already -->
@ -184,8 +187,5 @@
<!-- We're using our own native main function when using NativeAOT -->
<CustomNativeMain>true</CustomNativeMain>
<!-- We must find the BCL libraries using the runtime pack instead of using the built-in NativeAOT BCL -->
<PublishAotUsingRuntimePack>true</PublishAotUsingRuntimePack>
</PropertyGroup>
</Project>

Просмотреть файл

@ -460,27 +460,6 @@
<IlcCompileDependsOn>Compile;_ComputeLinkerArguments;_ComputeManagedAssemblyToLink;SetupOSSpecificProps;PrepareForILLink;_XamarinComputeIlcCompileInputs</IlcCompileDependsOn>
</PropertyGroup>
<!--
Workaround for SDK issue where setting PublishAot=true during build cannot resolve correct
runtime pack and IL compiler pack.
Setting PublishAotUsingRuntimePack=true unconditionally results in the runtime pack label to
be updated to "NativeAOT" instead of "Mono" and trying to build against NativeAOT runtime
pack instead of the Mono one.
Setting PublishAotUsingRuntimePack=false causes the NuGet resolution to check for known
ILCompiler packs and these don't exist for iOS-like platforms.
The workaround ensure that PublishAotUsingRuntimePack is false when SDK updates the runtime
pack labels, and thus the "Mono" label is used. We then set it to true right before
ProcessFrameworkReferences target to skip downloading the target ILCompiler pack.
-->
<Target Name="_WorkaroundAotRuntimePackResolution" BeforeTargets="ProcessFrameworkReferences" Condition="'$(PublishAot)' == 'true' And '$(_UseNativeAot)' != 'true'">
<PropertyGroup>
<PublishAotUsingRuntimePack>true</PublishAotUsingRuntimePack>
</PropertyGroup>
</Target>
<Target Name="_ComputeLinkerFeatures">
<PropertyGroup Condition="'$(PublishAot)' == 'true'">
<!-- Yep, we want to run ILLink as well, because we need our custom steps to run (NativeAOT sets this to false, so set it back to true) -->
@ -1677,8 +1656,36 @@
</ItemGroup>
</Target>
<!-- Add the pdb for Microsoft.<platform>.dll to the app bundle if we're debugging -->
<PropertyGroup>
<BundleDebugSymbolFileForSdkAssembly Condition="'$(BundleDebugSymbolFileForSdkAssembly)' == ''">$(_BundlerDebug)</BundleDebugSymbolFileForSdkAssembly>
</PropertyGroup>
<Target Name="_AddDebugSymbolsToBundle"
DependsOnTargets="ResolveRuntimePackAssets;_ComputeFrameworkVariables"
BeforeTargets="_ResolveCopyLocalAssetsForPublish"
Condition="'$(BundleDebugSymbolFileForSdkAssembly)' == 'true'"
>
<ItemGroup>
<ReferenceCopyLocalPaths
Include="@(ReferenceCopyLocalPaths->'%(RootDir)%(Directory)%(Filename).pdb')"
Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' == '$(_XamarinNugetPackageId)' and Exists('%(RootDir)%(Directory)%(Filename).pdb')" />
</ItemGroup>
</Target>
<PropertyGroup>
<_ComputePublishLocationDependsOn>
$(_ComputePublishLocationDependsOn);
_GenerateBundleName;
_ParseBundlerArguments;
_ComputeMonoLibraries;
_DetectSigningIdentity;
_PrepareResourceRules;
_AddDebugSymbolsToBundle;
</_ComputePublishLocationDependsOn>
</PropertyGroup>
<Target Name="_ComputePublishLocation"
DependsOnTargets="_GenerateBundleName;_ParseBundlerArguments;_ComputeMonoLibraries;_DetectSigningIdentity;_PrepareResourceRules"
DependsOnTargets="$(_ComputePublishLocationDependsOn)"
Condition="'$(_CanOutputAppBundle)' == 'true'"
>
<PropertyGroup>

Просмотреть файл

@ -1,8 +1,8 @@
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.Dotnet.Sdk.Internal" Version="8.0.100-rc.2.23462.1">
<Dependency Name="Microsoft.Dotnet.Sdk.Internal" Version="8.0.100-rc.2.23463.8">
<Uri>https://github.com/dotnet/installer</Uri>
<Sha>a6b903004774fb1b4e638f47c602fc968b43a8c0</Sha>
<Sha>ec56994f9c0ff74869d707f145b4e0796d28f3bc</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.ILLink.Tasks" Version="8.0.0-rc.2.23431.9" CoherentParentDependency="Microsoft.Dotnet.Sdk.Internal">
<Uri>https://github.com/dotnet/runtime</Uri>
@ -74,9 +74,9 @@
<Uri>https://github.com/dotnet/templating</Uri>
<Sha />
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.iOS.Shared" Version="8.0.0-prerelease.23431.1">
<Dependency Name="Microsoft.DotNet.XHarness.iOS.Shared" Version="8.0.0-prerelease.23456.2">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>1446eababf78d7787af2aa86d5393c342c4b1b0b</Sha>
<Sha>a3a749a7056623c665bba226fe843152f413f044</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>

Просмотреть файл

@ -2,7 +2,7 @@
<!--Package versions-->
<PropertyGroup>
<!-- Versions updated by maestro -->
<MicrosoftDotnetSdkInternalPackageVersion>8.0.100-rc.2.23462.1</MicrosoftDotnetSdkInternalPackageVersion>
<MicrosoftDotnetSdkInternalPackageVersion>8.0.100-rc.2.23463.8</MicrosoftDotnetSdkInternalPackageVersion>
<MicrosoftNETILLinkTasksPackageVersion>8.0.0-rc.2.23431.9</MicrosoftNETILLinkTasksPackageVersion>
<MicrosoftDotNetBuildTasksFeedPackageVersion>6.0.0-beta.21212.6</MicrosoftDotNetBuildTasksFeedPackageVersion>
<MicrosoftNETCoreAppRefPackageVersion>8.0.0-rc.2.23431.9</MicrosoftNETCoreAppRefPackageVersion>
@ -10,7 +10,7 @@
<MicrosoftNETRuntimeMonoTargetsSdkPackageVersion>7.0.7</MicrosoftNETRuntimeMonoTargetsSdkPackageVersion>
<MicrosoftTemplateEngineTasksVersion>7.0.100-alpha.1.21601.1</MicrosoftTemplateEngineTasksVersion>
<MicrosoftDotNetCecilPackageVersion>0.11.4-alpha.23428.2</MicrosoftDotNetCecilPackageVersion>
<MicrosoftDotNetXHarnessiOSSharedPackageVersion>8.0.0-prerelease.23431.1</MicrosoftDotNetXHarnessiOSSharedPackageVersion>
<MicrosoftDotNetXHarnessiOSSharedPackageVersion>8.0.0-prerelease.23456.2</MicrosoftDotNetXHarnessiOSSharedPackageVersion>
<!-- Manually updated versions -->
<Emscriptennet7WorkloadVersion>$(MicrosoftNETWorkloadEmscriptenCurrentManifest80100TransportVersion)</Emscriptennet7WorkloadVersion>
<EmscriptenWorkloadVersion>$(MicrosoftNETWorkloadEmscriptenCurrentManifest80100TransportVersion)</EmscriptenWorkloadVersion>

Просмотреть файл

@ -1,5 +1,5 @@
{
"sdk": {
"version": "8.0.100-rc.2.23462.1"
"version": "8.0.100-rc.2.23463.8"
}
}

Просмотреть файл

@ -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);

Просмотреть файл

@ -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<UnavailableAttribute> (up).Yield ();
else
return Enumerable.Empty<System.Attribute> ();
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<ObsoletedAttribute> (op).Yield ();
else
return AttributeFactory.CreateNewAttribute<ObsoletedAttribute> (op, ov.Major, ov.Minor).Yield ();
#endif
default:
return Enumerable.Empty<System.Attribute> ();

Просмотреть файл

@ -2,4 +2,4 @@ TOP=../..
include $(TOP)/Make.config
run-tests:
$(DOTNET) test
$(DOTNET) test $(TEST_FILTER)

Просмотреть файл

@ -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<string> 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) {

Просмотреть файл

@ -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<string> 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<string> 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")));

Просмотреть файл

@ -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";

Просмотреть файл

@ -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<string> RemovePostCurrentOnMacCatalyst (IList<string> 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)]

Просмотреть файл

@ -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) \

Просмотреть файл

@ -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);

Просмотреть файл

@ -0,0 +1,10 @@
using System.Runtime.Versioning;
using Foundation;
using UIKit;
namespace iosbindinglib {
[Protocol, Model]
[BaseType (typeof (UIApplicationDelegate))]
public interface TestDelegate {
}
}

Просмотреть файл

@ -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,

Просмотреть файл

@ -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 ()

Просмотреть файл

@ -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<string> 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)

Просмотреть файл

@ -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<DetectSdkLocations> ();
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<DetectSdkLocations> ();
task.SdkVersion = "4.0";
task.TargetFrameworkMoniker = "Xamarin.iOS,v1.0";

Просмотреть файл

@ -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;

Просмотреть файл

@ -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"

Просмотреть файл

@ -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,

Просмотреть файл

@ -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<TypeDefinition> IterateTypes (IEnumerable<TypeDefinition> types)
{
foreach (var type in types) {
yield return type;
if (type.HasNestedTypes) {
foreach (var td in IterateTypes (type.NestedTypes))
yield return td;
}
}
}
IEnumerable<TypeDefinition> GetRelevantTypes (Func<TypeDefinition, bool> isRelevant)
=> StaticRegistrar.GetAllTypes (abr.CurrentAssembly)
.Cast<TypeDefinition> ()

Просмотреть файл

@ -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 ();