Fixes these errors:
xamarin-macios/tests/linker/ios/link sdk/LinkSdkRegressionTest.cs(1140,41): error CS0246: The type or namespace name 'NSApplication' could not be found (are you missing a using directive or an assembly reference?)
xamarin-macios/tests/linker/ios/link sdk/LinkSdkRegressionTest.cs(1156,4): error CS0103: The name 'NSApplication' does not exist in the current context
xamarin-macios/tests/linker/ios/link sdk/LinkSdkRegressionTest.cs(1157,4): error CS0103: The name 'NSApplication' does not exist in the current context
This also required changing some linker code to not have platform-specific conditional compilation,
because dotnet-linker is built only once for .NET (same binary for all platforms).
when (by default)
* the interpreter is not enabled (since new code might subclass or override the members analyzed at build time)
* building for release
Reverts c56b893b68
Fix https://github.com/xamarin/xamarin-macios/issues/9573
Notes
* Even if possible (in metadata) there is no point in setting `final` on
a method if we remove `virtual`. This match ILLink version of the sealer
and makes the same test pass on both.
* Don't apply optimization on non-AOT builds, e.g. simulators, since some
features (like XML serialization) checks for
`RuntimeFeature.IsDynamicCodeSupported` and that requires some types
to be subclassed thru SRE
This pull request updates the following dependencies
## From https://github.com/dotnet/installer
- **Subscription**: df3e6147-3e41-4928-6775-08d8f479343c
- **Build**: 20210720.12
- **Date Produced**: 7/21/2021 6:57 AM
- **Commit**: d7279fc09fcfb108c5fb97fa290dbbb11c4c441b
- **Branch**: refs/heads/main
- **Updates**:
- **Microsoft.Dotnet.Sdk.Internal**: [from 6.0.100-preview.7.21330.1 to 6.0.100-rc.1.21370.12][1]
- **Microsoft.NET.ILLink.Tasks**: [from 6.0.100-preview.6.21329.2 to 6.0.100-preview.6.21370.1][2]
[1]: 823ff33...d7279fc
[2]: f549b4e...6eae019
## Coherency Updates
The following updates ensure that dependencies with a *CoherentParentDependency*
attribute were produced in a build used as input to the parent dependency's build.
See [Dependency Description Format](https://github.com/dotnet/arcade/blob/master/Documentation/DependencyDescriptionFormat.md#dependency-description-overview)
- **Coherency Updates**:
- **Microsoft.NET.ILLink.Tasks**: from 6.0.100-preview.6.21329.2 to 6.0.100-preview.6.21370.1 (parent: Microsoft.Dotnet.Sdk.Internal)
It would create a file in the current directory, which is the root directory of the app bundle.
This would work in the simulator (because the directory is read-write), fail
on device (because the directory is read-only), and cause rebuilds to fail
with Mac Catalyst (because the directory is read-write the test would succeed,
but it would write files in the root directory of the app bundle, which is not
allowed for macOS apps, and thus codesign would fail when rebuilding the app).
So change the test to create any files in a temporary directory, and adjust it
to always expect the file to be created.
And just in case also delete the file at the end of the test.
* Update dependencies from https://github.com/dotnet/installer build 20210530.2
Microsoft.Dotnet.Sdk.Internal
From Version 6.0.100-preview.6.21274.3 -> To Version 6.0.100-preview.6.21280.2
Dependency coherency updates
Microsoft.NET.ILLink.Tasks
From Version 6.0.100-preview.5.21271.1 -> To Version 6.0.100-preview.6.21277.2 (parent: Microsoft.Dotnet.Sdk.Internal
* Bump to MSBuild.StructuredLogger v2.1.500 to get support for log format v14.
* [tests] Skip code that needs System.ComponentModel.Composition or System.Json due to #11710.
Ref: https://github.com/xamarin/xamarin-macios/issues/11710
* [tests] Adjust logic to find MSBuild items after the last MSBuild.StructuredLogger update.
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Both
* EnsureEventAndDelegateAreNotMismatched
* EnsureDelegateAssignIsNotOverwritingInternalDelegate
are helpers that will warn, on console, if ObjC delegates are mis-used
inside the application. Those message are not useful at runtime and we
can use ILLink's substitutions to remove the content of the checks for
release builds.
The debug code is removed only on release builds.
Unlike the _legacy_ linker the method itself is still present (not
removed) from the assembly - but it will be empty (no code).
Unit test was adapted to work under all conditions.
Fixes https://github.com/xamarin/xamarin-macios/issues/9613
* Update to new linker custom steps API
* PR feedback
- Fix indentation
- Add Initialize(LinkContext) to ExceptionalMarkHandler
- Remove unnecessary ifdef
- Use IsSetter/IsGetter
- Use [0] instead of Single()
- Avoid allocating empty collections
* Note override issue
* Clean up comments
* Move `DynamicRegistrationSupported` change earlier, along with the
detection code.
This solve the issue that `ILLink` does a similar job _before_ we have
the chance to disable the dynamic registrar.
* ILLink does not support considering other attributes as `[Preserve]`
when it is itself preserved at the assembly-level.
This ignored test is checking that feature so it cannot be enabled
for `NET`
Added to known breaking changes https://github.com/xamarin/xamarin-macios/issues/8900
* Fix removal of the dynamic registrar on legacy
* Fix IntPtr size inlining
Co-authored-by: Sebastien Pouliot <sebastien.pouliot@microsoft.com>
This exposed a few tests that are failing on dotnet (adjusted or fixed)
Also fix a typo in an exception message in `src/ObjCRuntime/PlatformAvailability.cs`
and a build warning in `tests/common/TestRuntime.cs`
Fix part of https://github.com/xamarin/xamarin-macios/issues/11243
And allows enabling the tvOS/dotnet link all tests
* [build] Use arcade dependency management tooling
* Apply feedback
* Apply second round of feedback
* Always make dotnet.config before trying to read it
* Debugging
* Update dependencies, trim tabs and spaces
* [dotnet] Remove the existing workload shipped with .NET and install our locally built ones.
The new version of .NET ships with our workloads, but those aren't
the workloads we want to use, so replace them with our own.
* Update .gitignores.
* Bump to 6.0.100-preview.3.21181.5
That required renaming simulator runtime packs...
* More rename for simulator packages
* moar (hopefully all)
* Bump to 6.0.100-preview.3.21201.11
This fix the issue with `Wait` that failed several tests in monotouch-tests
However it does not include the fix for AppConext.GetData on device (AOT)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Sebastien Pouliot <sebastien@xamarin.com>
With P3 addition on ICU we must now link the native executable as C++.
Remove an old workaround, in many tests, referencing old (5.0/previews)
packages that caused native link time failures.
ref: https://github.com/mono/linker/issues/1139
Those are called respectively inside `xamarin_vm_initialize` and
`xamarin_bridge_initialize` functions.
This fix the **AppContext.GetData always return null for iOS** issue
https://github.com/dotnet/runtime/issues/50290
Thanks for @filipnavara for diagnosing this quicker than anyone else!
Added unit tests to ensure `AppContext.GetData` can read back the values
we're providing at startup.
* Bump to .NET 6.0.100-preview.3.21152.10
* Bump to 6.0.100-preview.3.21152.10.
* Bump to 6.0.100-preview.3.21161.7.
* Bump to .NET 6.0.100-preview.3.21161.23.
* [dotnet-linker] Bump ILink and use the supported method of getting an assembly's location.
* Bump to MSBuild.StructuredLogger 2.1.364 to get support for newer binlog versions.
* Fix build failure
Fixes:
TestHelpers/BuildEngine.cs(161,24): error CS0433: The type 'ProjectEvaluationFinishedEventArgs' exists in both 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'StructuredLogger, Version=2.1.0.0, Culture=neutral, PublicKeyToken=d4c7181801cb6448' [/Users/builder/azdo/_work/1/s/xamarin-macios/tests/msbuild/Xamarin.MacDev.Tests/Xamarin.MacDev.Tests.csproj]
* Update parsing binlog properties.
* Be more defensive.
* [tests] Make sure the InternalsVisibleToAttribute constructor isn't linked away.
* [tests] Implement better printing of binlogs.
The latest MSBuild.StructuredLogger made some internal changes to the Message
property which confuses some of our test logic. So implement manual printing
of the log entries that we care about to make sure they conform to the
expected format by the tests (the output is mimicing what 'msbuild /v:diag
foo.binlog' would show).
This required working around internal ctor that uses internal (non
re-generated) types. E.g.
```
build/dotnet/maccatalyst/ref/Xamarin.iOS.cs(9201,64): error CS0234: The type or namespace name 'ABFunc<>' does not exist in the namespace 'AddressBookUI' (are you missing an assembly reference?)
```
We cannot just skip such constructor since the C# compiler will add a
**public** default one when none is present (and that's the case for
the error above),
This also required fixing the ctor chaining code (which can't be shared
with the, previously fixed, override code) so base classes could be
called for some `*EventArg` types.
Follow up to https://github.com/xamarin/xamarin-macios/pull/10658 , https://github.com/xamarin/xamarin-macios/pull/10678 and https://github.com/xamarin/xamarin-macios/pull/10706
This is the last framework that needs removal - but there's still a few
`unknown-*` entries in Catalyst-supported frameworks (more PR coming).
* [link sdk/link all] Adjust to compile on Mac Catalyst.
* [tests] Adjust the LinkAllRegressionTest.NoFatCorlib to work on Mac Catalyst.
* [tests] Add version checks to make link sdk green on Mac Catalyst.
* [tests] Make the LinkSdkRegressionTest.SpecialFolder test pass on Mac Catalyst.
* [xharness] link sdk and link all are green on Mac Catalyst now.
* Fix test build.
* [dotnet] Add support for LinkDescription items.
Also use the LinkDescription item group instead of a custom one
(_BundlerXmlDefinitions), since there's no need for the custom one.
* The world (aka mmp) isn't quite ready for this yet.
* Don't parse into LinkDescription, use a temporary variable instead.
And then only use the temporary variable for .NET.
The problem is that parsing mtouch extra args and adding any --xml arguments
to LinkDescription is that the xml file will be passed again to mtouch, and in
this case any ${ProjectDir} properties won't be evaluated.
* Bump to .NET 6.0.100-alpha.1.21060.3.
* Fix dotnet command line arguments.
* dotnet build: the project file must be the first argument.
* dotnet build/publish: use the documented verbosity format.
* Update version number in tests.
* [tests/introspection] Adjust introspection to cope with different library names in the new .NET version.
* [tests/link sdk] Adjust the LinkSdkRegressionTest.SpecialFolder test according to the new version of .NET 6.
* [tests/link sdk] Preserve a required method in System.Private.CoreLib to work around a bug in .NET 6.
Ref: https://github.com/dotnet/runtime/issues/46908.
* Revert "[CI][VSTS] Add the donet 6 pkg as a dependency. (#10348)"
This reverts commit 6de4e717e7.
There's no need to provision .NET 6, it's done automatically.
Fixes https://github.com/xamarin/xamarin-macios/issues/9562.
It also fixes this monotouch-test when enabling all optimizations:
[FAIL] BlockReturnTest : ObjCRuntime.RuntimeException : Invalid DelegateProxyAttribute for the return value for the method MonoTouchFixtures.ObjCRuntime.RegistrarTest+BlockReturnTestClass.MethodReturningBlock: DelegateType (ObjCRuntime.Trampolines+SDRegistrarTestBlock) specifies a type without a 'Handler' field.
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()
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.
.NET doesn't have any globalization support yet.
Ref: https://github.com/xamarin/xamarin-macios/issues/8906
This fixes these tests:
LinkAll.Calendars.CalendarTest
[FAIL] Hijri : Calendar
Expected string length 34 but was 38. Strings differ at index 21.
Expected: "System.Globalization.HijriCalendar"
But was: "System.Globalization.GregorianCalendar"
--------------------------------^
at LinkAll.Calendars.CalendarTest.Hijri() in [...]/xamarin-macios/tests/linker/ios/link all/CalendarTest.cs:line 28
[FAIL] ThaiBuddhist : Calendar
Expected string length 41 but was 38. Strings differ at index 21.
Expected: "System.Globalization.ThaiBuddhistCalendar"
But was: "System.Globalization.GregorianCalendar"
--------------------------------^
at LinkAll.Calendars.CalendarTest.ThaiBuddhist() in [...]/xamarin-macios/tests/linker/ios/link all/CalendarTest.cs:line 35
[FAIL] UmAlQura : Calendar
Expected string length 37 but was 38. Strings differ at index 21.
Expected: "System.Globalization.UmAlQuraCalendar"
But was: "System.Globalization.GregorianCalendar"
--------------------------------^
at LinkAll.Calendars.CalendarTest.UmAlQura() in [...]/xamarin-macios/tests/linker/ios/link all/CalendarTest.cs:line 21
Fixes this linkall test failure:
LinkAll.Attributes.AttributeTest
[FAIL] DebuggerTypeProxy_24203 : proxy
Expected: not null
But was: null
at LinkAll.Attributes.AttributeTest.DebuggerTypeProxy_24203() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link all/AttributeTest.cs:line 191
It tests internal implementation details, and those details have now changed
(https://github.com/dotnet/runtime/pull/39973). So just skip the entire test
for now.
Fixes this test failure:
DontLink.CommonDontLinkTest
[FAIL] TypeDescriptorCanary : System.InvalidCastException : Specified cast is not valid. : at DontLink.CommonDontLinkTest.TypeDescriptorCanary() in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/linker/CommonDontLinkTest.cs:line 22
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
* [tests] Port link all to .NET
* [tests] Exclude link all tests in .NET that reference OpenTK-1.0.dll
OpenTK-1.0.dll isn't supported yet.
* [tests] Exclude link all tests using API that isn't available anymore in .NET.
This fix works just as well for the current Mono BCL as well, so there's no .NET condition.
This fixes this link sdk test:
LinkSdk.PclTest
[FAIL] ServiceModel : System.ArgumentNullException : Value cannot be null. (Parameter 'name')
at System.ServiceModel.Channels.AddressHeaderCollection.FindAll(String name, String ns)
at LinkSdk.PclTest.ServiceModel() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link sdk/PclTest.cs:line 73
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
Ref: https://github.com/dotnet/runtime/issues/41383
Fixes this link sdk test failure:
[FAIL] SpecialFolder : /Users/rolf/Library/Developer/CoreSimulator/Devices/0E45B8DF-05EF-47E7-A31F-3B829DEA2628/data/Containers/Data/Application/6454039E-D5F1-4C41-BF16-6C81CBAB1724/Applications
Expected: True
But was: False
at LinkSdk.LinkSdkRegressionTest.TestFolder(SpecialFolder folder, Boolean supported, Boolean exists, Boolean readOnly) in [...]/xamarin-macios/tests/linker/ios/link sdk/LinkSdkRegressionTest.cs:line 815
at LinkSdk.LinkSdkRegressionTest.SpecialFolder() in [...]/xamarin-macios/tests/linker/ios/link sdk/LinkSdkRegressionTest.cs:line 900
Ref: https://github.com/mono/linker/issues/1454
Fixes this link sdk test failure:
LinkSdk.Serialization.XmlSerializationTest
[FAIL] Bug1820_GenericList : System.ArgumentNullException : Value cannot be null. (Parameter 'obj')
at System.Reflection.Emit.ModuleBuilder.GetToken(MemberInfo member, Boolean create_open_instance)
at System.Reflection.Emit.ModuleBuilderTokenGenerator.GetToken(MemberInfo member, Boolean create_open_instance)
at System.Reflection.Emit.ILGenerator.Emit(OpCode opcode, ConstructorInfo con)
at System.Xml.Serialization.CodeGenerator.Call(ConstructorInfo ctor)
at System.Xml.Serialization.XmlSerializationILGen.GenerateSerializerContract(String className, XmlMapping[] xmlMappings, Type[] types, String readerType, String[] readMethods, String writerType, String[] writerMethods, Dictionary`2 serializers)
at System.Xml.Serialization.TempAssembly.GenerateRefEmitAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace)
at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location)
at System.Xml.Serialization.XmlSerializer.GenerateTempAssembly(XmlMapping xmlMapping, Type type, String defaultNamespace, String location)
at System.Xml.Serialization.XmlSerializer.GenerateTempAssembly(XmlMapping xmlMapping, Type type, String defaultNamespace)
at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
at System.Xml.Serialization.XmlSerializer..ctor(Type type)
at LinkSdk.Serialization.XmlSerializationTest.Response.get_Serializer() in [...]/xamarin-macios/tests/linker/ios/link sdk/Bug1820Test.cs:line 38
at LinkSdk.Serialization.XmlSerializationTest.Response.Deserialize(String xml) in [...]/xamarin-macios/tests/linker/ios/link sdk/Bug1820Test.cs:line 48
at LinkSdk.Serialization.XmlSerializationTest.Bug1820_GenericList() in [...]/xamarin-macios/tests/linker/ios/link sdk/Bug1820Test.cs:line 166
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
Fixes this link sdk test failure:
LinkSdk.LinkSdkRegressionTest
[FAIL] MonoRuntime34671 : Mono.Runtime
Expected: not null
But was: null
at LinkSdk.LinkSdkRegressionTest.MonoRuntime34671() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link sdk/LinkSdkRegressionTest.cs:line 1007
This fixes this link sdk test failure:
LinkSdk.LinkSdkRegressionTest
[FAIL] PrivateMemorySize64 : PrivateMemorySize64
Expected: not equal to 0
But was: 0
at LinkSdk.LinkSdkRegressionTest.PrivateMemorySize64() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link sdk/LinkSdkRegressionTest.cs:line 805
Ref: https://github.com/dotnet/runtime/issues/41392
Fixes this link sdk test failure:
LinkSdk.LinkSdkRegressionTest
[FAIL] AsQueryable_Enumerable : System.NullReferenceException : Object reference not set to an instance of an object
at System.Linq.EnumerableRewriter.FindEnumerableMethod(String name, ReadOnlyCollection`1 args, Type[] typeArgs)
at System.Linq.EnumerableRewriter.VisitMethodCall(MethodCallExpression m)
at System.Linq.Expressions.MethodCallExpression.Accept(ExpressionVisitor visitor)
at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
at System.Linq.Expressions.ExpressionVisitor.Visit(ReadOnlyCollection`1 nodes)
at System.Linq.EnumerableRewriter.VisitMethodCall(MethodCallExpression m)
at System.Linq.Expressions.MethodCallExpression.Accept(ExpressionVisitor visitor)
at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
at System.Linq.EnumerableExecutor`1[[System.Linq.IGrouping`2[[System.String, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.String, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Linq, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].Execute()
at System.Linq.EnumerableQuery`1[[System.Linq.IGrouping`2[[System.String, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.String, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Linq, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].System.Linq.IQueryProvider.Execute[IGrouping`2](Expression expression)
at System.Linq.Queryable.FirstOrDefault[IGrouping`2](IQueryable`1 source)
at LinkSdk.LinkSdkRegressionTest.AsQueryable_Enumerable() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link sdk/LinkSdkRegressionTest.cs:line 1100
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
Fixes this link sdk test failure:
LinkSdk.LinkSdkRegressionTest
[FAIL] Pointer_5200 :
Expected: not null
But was: null
at LinkSdk.LinkSdkRegressionTest.Pointer_5200() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link sdk/LinkSdkRegressionTest.cs:line 696
Fixes these link sdk test failures:
LinkSdk.LinkExtraDefsTest
[FAIL] Corlib : System.Security.PermissionSet
Expected: not null
But was: null
at LinkSdk.LinkExtraDefsTest.Corlib() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link sdk/LinkExtraDefsTest.cs:line 33
[FAIL] System : System.Net.Mime.ContentType
Expected: not null
But was: null
at LinkSdk.LinkExtraDefsTest.System() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link sdk/LinkExtraDefsTest.cs:line 40
Ref: https://github.com/mono/linker/issues/1451
Fixes this link sdk test failure:
LinkSdk.CommonLinkSdkTest
[FAIL] TypeDescriptor_A7793 : System.MissingMethodException : Default constructor not found for type System.ComponentModel.DateTimeOffsetConverter
at System.RuntimeType.CreateInstanceMono(Boolean nonPublic, Boolean wrapExceptions)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean skipCheckThis, Boolean fillCache)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, Boolean wrapExceptions)
at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at System.ComponentModel.ReflectTypeDescriptionProvider.CreateInstance(Type objectType, Type callingType)
at System.ComponentModel.ReflectTypeDescriptionProvider.SearchIntrinsicTable(Hashtable table, Type callingType)
at System.ComponentModel.ReflectTypeDescriptionProvider.ReflectedTypeData.GetConverter(Object instance)
at System.ComponentModel.ReflectTypeDescriptionProvider.GetConverter(Type type, Object instance)
at System.ComponentModel.TypeDescriptor.TypeDescriptionNode.DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetConverter()
at System.ComponentModel.TypeDescriptor.GetConverter(Type type)
at LinkSdk.CommonLinkSdkTest.TypeDescriptor_A7793() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/CommonLinkSdkTest.cs:line 21
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
System.Net.NetworkInformation.Ping.Send doesn't work.
Ref: https://github.com/dotnet/runtime/issues/41355
Fixes this link sdk test failure:
LinkSdk.DllImportTest
[FAIL] LackOfCapget :
Expected: <System.InvalidOperationException>
But was: <System.Net.NetworkInformation.PingException: An exception occurred during a Ping request.
---> System.ComponentModel.Win32Exception (2): No such file or directory
at System.Diagnostics.Process.EnsureInitialized()
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Net.NetworkInformation.Ping.SendWithPingUtility(IPAddress address, Byte[] buffer, Int32 timeout, PingOptions options)
at System.Net.NetworkInformation.Ping.SendPingCore(IPAddress address, Byte[] buffer, Int32 timeout, PingOptions options)
at System.Net.NetworkInformation.Ping.GetAddressAndSend(String hostNameOrAddress, Int32 timeout, Byte[] buffer, PingOptions options)
--- End of inner exception stack trace ---
at System.Net.NetworkInformation.Ping.GetAddressAndSend(String hostNameOrAddress, Int32 timeout, Byte[] buffer, PingOptions options)
at System.Net.NetworkInformation.Ping.Send(String hostNameOrAddress, Int32 timeout, Byte[] buffer, PingOptions options)
at System.Net.NetworkInformation.Ping.Send(String hostNameOrAddress, Int32 timeout, Byte[] buffer)
at System.Net.NetworkInformation.Ping.Send(String hostNameOrAddress)
at LinkSdk.DllImportTest.<>c__DisplayClass3_0.<LackOfCapget>b__0() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link sdk/DllImportTest.cs:line 88
at NUnit.Framework.Assert.Throws(IResolveConstraint expression, TestDelegate code, String message, Object[] args)>
at LinkSdk.DllImportTest.LackOfCapget() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link sdk/DllImportTest.cs:line 88
Fixes unhandled exception that makes the app crash:
Unhandled Exception:
System.EntryPointNotFoundException: AppleCryptoNative_SecKeychainItemCopyKeychain assembly:<unknown assembly> type:<unknown type> member:(null)
at Interop.AppleCrypto.SecKeychainItemCopyKeychain(IntPtr item)
at System.Security.Cryptography.Apple.SafeTemporaryKeychainHandle.UntrackItem(IntPtr keychainItem)
at System.Security.Cryptography.Apple.SafeKeychainItemHandle.ReleaseHandle()
at System.Runtime.InteropServices.SafeHandle.InternalRelease(Boolean disposeOrFinalizeOperation)
at System.Runtime.InteropServices.SafeHandle.Dispose(Boolean disposing)
at System.Runtime.InteropServices.SafeHandle.Finalize()
.NET doesn't have any globalization support yet.
Ref: https://github.com/xamarin/xamarin-macios/issues/8906
This fixes these tests:
DontLink.Calendars.CalendarTest
[FAIL] Hijri : Calendar
Expected string length 34 but was 38. Strings differ at index 21.
Expected: "System.Globalization.HijriCalendar"
But was: "System.Globalization.GregorianCalendar"
--------------------------------^
at DontLink.Calendars.CalendarTest.Hijri() in [...]/xamarin-macios/tests/linker/ios/dont link/CalendarTest.cs:line 28
[FAIL] ThaiBuddhist : Calendar
Expected string length 41 but was 38. Strings differ at index 21.
Expected: "System.Globalization.ThaiBuddhistCalendar"
But was: "System.Globalization.GregorianCalendar"
--------------------------------^
at DontLink.Calendars.CalendarTest.ThaiBuddhist() in [...]/xamarin-macios/tests/linker/ios/dont link/CalendarTest.cs:line 35
[FAIL] UmAlQura : Calendar
Expected string length 37 but was 38. Strings differ at index 21.
Expected: "System.Globalization.UmAlQuraCalendar"
But was: "System.Globalization.GregorianCalendar"
--------------------------------^
at DontLink.Calendars.CalendarTest.UmAlQura() in [...]/xamarin-macios/tests/linker/ios/dont link/CalendarTest.cs:line 21
Types have moved around in .NET, and in particular
System.ComponentModel.ReflectTypeDescriptionProvider is not in System where it
once was. So change the logic to look in the same assembly
System.ComponentModel.BooleanConverter is, as opposed to hardcoding 'System'.
This fixes this test:
DontLink.CommonDontLinkTest
[FAIL] TypeDescriptorCanary : type
Expected: not null
But was: null
at DontLink.CommonDontLinkTest.TypeDescriptorCanary() in [...]/xamarin-macios/tests/linker/CommonDontLinkTest.cs:line 19
MulticastDelegate.BeginInvoke isn't supported in .NET.
Ref: https://github.com/dotnet/runtime/issues/16312
Fixes this test failure:
DontLink.DontLinkRegressionTests
[FAIL] Bug5354 : System.PlatformNotSupportedException : Operation is not supported on this platform.
at DontLink.DontLinkRegressionTests.Bug5354() in [...]/xamarin-macios/tests/linker/ios/dont link/DontLinkRegressionTests.cs:line 64
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
This works around a build problem that occurs because NUnit ships with a
P/Invoke to a function that doesn't exist on Apple platforms:
MTOUCH : error MT5210: Native linking failed, undefined symbol: _GetVersionEx. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. [/Users/xamarinqa/myagent/_work/8/s/xamarin-macios/tests/xharness/tmp-test-dir/monotouch-test58/monotouch-test-tvos.csproj]
MTOUCH : error MT5201: Native linking failed. Please review the build log and the user flags provided to gcc: -fembed-bitcode-marker [/Users/xamarinqa/myagent/_work/8/s/xamarin-macios/tests/xharness/tmp-test-dir/monotouch-test58/monotouch-test-tvos.csproj]
clang : error : linker command failed with exit code 1 (use -v to see invocation) [/Users/xamarinqa/myagent/_work/8/s/xamarin-macios/tests/xharness/tmp-test-dir/monotouch-test58/monotouch-test-tvos.csproj]
Also fix an issue in mtouch where we would overwrite any previous --dlsym
values; they're now accumulative (`--dlsym:foo.dll --dlsym:bar.dll` works
as expected)
Ref: https://github.com/nunit/nunit/issues/3618