* [src] Build the .NET version of our product assemblies using a .NET 5 BCL.
We're not shipping the .NET product assemblies in any stable release, so we
can use a preview version of the .NET 5 BCL.
Also:
* Add all the nuget feeds we need to the top-level NuGet.config, even for .NET
5/6, there shouldn't be any conflicts with stable feeds since we use exact
version numbers.
* Generate a top-level global5.json which is copied to every directory that
needs a .NET 5 global.json (overriding the .NET 3.1 global.json in the root
directory).
* Use the expected dotnet binary during our local build.
* [tests] Fix the bgen tests to use .NET 5.
* [xharness] Set the current directory to the project directory when running .NET tests.
This way we end up using the dotnet version that's configured in global.json for the tests.
This test variation ends up being too big (1.5 GB), so it doesn't install
properly and the app crashes at startup.
So just skip it.
Fixes https://github.com/xamarin/maccore/issues/2282.
1. Assert that we got permission to CoreBluetooth before doing anything. This
makes it so that if permission has been denied, or if we're running on the
bots and permission has not been granted, these tests won't run. It does
not affect local test runs where permissions haven't been granted nor
denied.
2. Rework the code to wait for CoreBluetooth to power on in the SetUp method.
Mark the test as inconclusive if CoreBluetooth never powers on (this
happens if nobody answers the bluetooth permission dialog, quite typical
when running tests locally).
Fixes these tests when running locally on a tvOS device:
MonoTouchFixtures.CoreBluetooth.CBCentralManagerTest
[FAIL] Constructors
[FAIL] ScanForPeripherals
* Use the existing information we have in the Frameworks class to determine
whether a particular framework works in the simulator or not.
* Show a warning (MX5223) when we run into such a framework, but only if
the linker is enabled (otherwise we'll often get warnings for API the developer
doesn't use).
* [xcode12] Initial bump for Xcode 12 GM
* [tests][intro] We cannot load CoreNFC framework on iOS simulator anymore
* [tests][xtro] New Metal API are not abstract (before XAMCORE_4_0)
* [tests][intro] Fix crash when CSLocalizedString 'description' selector is called
* [tests][xtro] Add support for excluding platforms
Based on `Make.config` variables `INCLUDE_[IOS|TVOS|WATCH|MAC]`
This required moving some entries (common -> macOS) to keep the
sanitizer happy.
* [xtro] Ignore Intents watchOS differences since they will likely match iOS in the future
* Update to use Xcode 12 GMb instead of the old GM
* [tests][xtro] Remove OSLog for iOS and tvOS (changed in GM)
* [tests][msbuild] Disable FrameworkListTest based on the active/disabled platforms
* [tests][msbuild] Track new directory/file inside CoreML projects
* [mlaunch] Bump maccore and disable mlaunch if mac build is disabled
New commits in xamarin/maccore:
* xamarin/maccore@ba332d4d07 Disable mlaunch if Mac is not built (#2314)
Diff: 87a96d21c9..ba332d4d07
Co-authored-by: Sebastien Pouliot <sebastien.pouliot@microsoft.com>
Most fixes are inside Intents. Some types were not available on macOS
and marked as such, except it backfired.
* Adding `[NoMac]` on `XAMCORE_4_0` was fine
* Adding `[Obsolete]` outside `XAMCORE_4_0` was fine
* Removing the `[Mac (x,y)]` was not quite fine. It's true (since it was never on macOS) but removing it means it default to the oldest (10.9) macOS version we support. This is what the introspection tests were expecting.
Adding an `[Obsoleted (..., 10,0, ...)]` solve this.
Uncaught exceptions in a background thread will cause the process to crash.
Instead marshal any exceptions to the main thread, which asserts that no
exceptions were thrown.
* Fix links that point to master to point to main instead.
* Implement support in the sample tester for specifying the default branch for
each sample repo.
* Fix various text / documentation to say 'main' instead of 'master.'
* Push to 'main' instead of 'master' in xamarin-macios-data.
* Fix xharness to make 'main' the special branch with regards to documentation tests as opposed to 'master'.
* Fix various CI to use 'main' instead of 'master'.
This is a backport of PR #9561
Calling Uri.PathAndQuery is not allowed on a relative Uri, which made the
previous Uri -> NSUrl implicit operator always throw if given a relative
NSUrl.
So I fixed that, added several tests, and found another issue (it turns out
that 'url.RelativePath == url.Path' is not a reliable way to detect absolute
urls, because it's true for relative urls as well) and fixed that too.
Fixes https://github.com/xamarin/xamarin-macios/issues/9607.
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Some .NET test projects (monotouch-test) require this to set properties for
some test variations, and .NET projects are quite minimal, making it likely
that they won't have a particular property that needs to be set/modified.
This makes it possible to execute the various monotouch-test variations for
.NET in xharness (some of the variations still fail though, so they're still
ignored by default).
Fixes these linkall tests:
Linker.Shared.OptimizeGeneratedCodeTest
[FAIL] IsARM64CallingConvention : optimized: no ldsfld instruction
Expected: 0
But was: 1
at Linker.Shared.BaseOptimizeGeneratedCodeTest.IsARM64CallingConvention() in /Users/rolf/work/maccore/main/xamarin-macios/tests/linker/BaseOptimizeGeneratedCodeTest.cs:line 527
[FAIL] SetupBlockPerfTest : At least 6x speedup
Expected: greater than 6
But was: 1.0876440665344851d
at Linker.Shared.BaseOptimizeGeneratedCodeTest.SetupBlockPerfTest() in /Users/rolf/work/maccore/main/xamarin-macios/tests/linker/BaseOptimizeGeneratedCodeTest.cs:line 120
And linkall is now green for .NET/Debug.
Calling Uri.PathAndQuery is not allowed on a relative Uri, which made the
previous Uri -> NSUrl implicit operator always throw if given a relative
NSUrl.
So I fixed that, added several tests, and found another issue (it turns out
that 'url.RelativePath == url.Path' is not a reliable way to detect absolute
urls, because it's true for relative urls as well) and fixed that too.
Fixes https://github.com/xamarin/xamarin-macios/issues/9607.
* [dotnet] Pass the Optimize flags from the extra bundler arguments to the linker configuration.
Also call Application.InitializeCommon to initialize the application instance. The
important part here is that InitializeCommon calls Optimizations.Initialize to compute
the default optimizations. It also calls Set*ExceptionMode and sets the default EnableCoopGC
value (so we don't need to call/set those anymore), and it does a few other initialization
tasks which we don't need yet, but eventually will.
And finally remember to parse the bundler arguments before using them in the dotnet
build logic. How did this not cause problems before? 🤦
* [tests] Set the verbosity using the additional args instead of an internal variable.
The internal _BundlerVerbosity variable is overwritten now (with the verbosity
value from the additional args).
* [xharness] Disable tvOS generation for the introspection/.NET test, it incorrect and needs fixing.
Refactor the Optimizations class to have no conditionally compiled code, which makes
it re-usable from our dotnet-linker code.
Also return any errors or warnings instead of showing/throwing them, which makes
the caller able to show them using whatever means is easiest for the caller.
One test needed an update to the list of valid optimizations, because we now have
a per-platform map of valid optimizations, instead of just a iOS/tvOS/watchOS vs
macOS split ('remove-unsupported-il-for-bitcode' is only valid for watchOS, and now
we say so, while we previously said it was a valid optimization for iOS and tvOS
as well, even though we'd warn about it and do nothing if you tried to set it).
Prebuild the Touch.Client projects for macOS when packaging the Xamarin.Mac
tests, so that when we try to build all the Xamarin.Mac test projects in
parallel, we don't end up trying to build the Touch.Client projects from
multiple build processes at the same time, causing numerous random failures
because all the processes are stomping on eachother.
Fixes these test failures:
Linker.Sealer.SealerTest
[FAIL] Final : A
Expected: True
But was: False
at Linker.Sealer.SealerTest.Final()
[FAIL] Sealed : Sealable
Expected: True
But was: False
at Linker.Sealer.SealerTest.Sealed()
[FAIL] Virtual : C
Expected: False
But was: True
at Linker.Sealer.SealerTest.Virtual()
* [fileprovider] Update for Xcode 12 beta 6
This was quite noisy. Apple removed all API marked as
`FILEPROVIDER_API_AVAILABILITY_V3`.
```
```
Most were bound but they were (majority) decorated with `[NoiOS]` and
`[NoMac]` so they did not generated any bindings.
A few of them were modified or just became macOS-only.
Deprecation warnings also needed to be updated.
Also ignore the BindingsAndBeforeInitField test because we're missing a few linker bits to make it work.
Fixes this linkall test failure:
LinkAll.CommonLinkAllTest
[FAIL] BindingsAndBeforeInitField : one
Expected: 1
But was: 0
at LinkAll.CommonLinkAllTest.BindingsAndBeforeInitField() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/CommonLinkAllTest.cs:line 65
Fixes these test failures:
LinkAll.Layout.ClassLayoutTest
[FAIL] AutoLayoutClass : Length
Expected: 1
But was: 2
at LinkAll.Layout.ClassLayoutTest.AutoLayoutClass() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link all/ClassLayoutTest.cs:line 73
[FAIL] DefaultLayoutClass : Length
Expected: 1
But was: 2
at LinkAll.Layout.ClassLayoutTest.DefaultLayoutClass() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link all/ClassLayoutTest.cs:line 57
Ref: https://github.com/mono/linker/issues/1460
Fixes this test failure:
LinkAll.Serialization.DataContract.DataContractTest
[FAIL] Flags : System.NullReferenceException : Object reference not set to an instance of an object
at System.Runtime.Serialization.CodeGenerator.VerifyParameterCount(MethodInfo methodInfo, Int32 expectedCount)
at System.Runtime.Serialization.CodeGenerator.Call(Object thisObj, MethodInfo methodInfo, Object param1, Object param2)
at System.Runtime.Serialization.XmlFormatWriterGenerator.CriticalHelper.InternalSerialize(MethodInfo methodInfo, LocalBuilder memberValue, Type memberType, Boolean writeXsiType)
at System.Runtime.Serialization.XmlFormatWriterGenerator.CriticalHelper.WriteValue(LocalBuilder memberValue, Boolean writeXsiType)
at System.Runtime.Serialization.XmlFormatWriterGenerator.CriticalHelper.WriteMembers(ClassDataContract classContract, LocalBuilder extensionDataLocal, ClassDataContract derivedMostClassContract)
at System.Runtime.Serialization.XmlFormatWriterGenerator.CriticalHelper.WriteClass(ClassDataContract classContract)
at System.Runtime.Serialization.XmlFormatWriterGenerator.CriticalHelper.GenerateClassWriter(ClassDataContract classContract)
at System.Runtime.Serialization.XmlFormatWriterGenerator.GenerateClassWriter(ClassDataContract classContract)
at System.Runtime.Serialization.ClassDataContract.CreateXmlFormatWriterDelegate()
at System.Runtime.Serialization.ClassDataContract.get_XmlFormatWriterDelegate()
at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)
at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)
at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithoutXsiType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)
at System.Runtime.Serialization.DataContractSerializer.InternalWriteObjectContent(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
at System.Runtime.Serialization.DataContractSerializer.InternalWriteObject(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph)
at System.Runtime.Serialization.DataContractSerializer.WriteObject(XmlWriter writer, Object graph)
at LinkAll.Serialization.DataContract.DataContractTest.ToXml[TestClass](TestClass obj) in [...]/xamarin-macios/tests/linker/ios/link all/DataContractTest.cs:line 35
at LinkAll.Serialization.DataContract.DataContractTest.Flags() in [...]/xamarin-macios/tests/linker/ios/link all/DataContractTest.cs:line 73
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
Fixes this test failure:
LinkAll.CommonLinkAllTest
[FAIL] TypeConverter_Custom : ConverterTypeName
String lengths are both 88. Strings differ at index 43.
Expected: "...nk all, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
But was: "...nk all, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
------------------------------^
at LinkAll.CommonLinkAllTest.TypeConverter_Custom() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/CommonLinkAllTest.cs:line 88
Fixes this test failure:
LinkAll.CommonLinkAllTest
[FAIL] TypeConverter_BuiltIn : ConverterTypeName
Expected string length 113 but was 142. Strings differ at index 46.
Expected: "...Model.BooleanConverter, System, Version=2.0.5.0, Culture=n..."
But was: "...Model.BooleanConverter, System.ComponentModel.TypeConverte..."
--------------------------------------------^
at LinkAll.CommonLinkAllTest.TypeConverter_BuiltIn() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/CommonLinkAllTest.cs:line 79
This fixes this linkall test failure:
LinkAll.Attributes.PreserveTest
[FAIL] PreserveTypeWithoutMembers : members
Expected: null
But was: <System.String Absent>
at LinkAll.Attributes.PreserveTest.PreserveTypeWithoutMembers() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link all/PreserveTest.cs:line 76
There were more complications added than strictly required to make the above
test pass, but it seems like this way we make sure the linker isn't too smart
for the other tests as well, and we end up testing what we actually want to
test.