Граф коммитов

9343 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 87395b4ef1
[tests] Port link sdk to .NET. (#9509)
And fix all the test failures, so that the Debug configuration is green.
2020-08-26 18:38:13 +02:00
Sebastien Pouliot 19701c6292
[uikit] Enable Intents API for tvOS (#9503) 2020-08-26 08:54:46 -04:00
Rolf Bjarne Kvinge 09e3631cb1 [xharness] link sdk is now green on .NET!
At least the Debug configuration is, there's still a test failure in the Release
configuration, so skip that for now.
2020-08-26 10:05:21 +02:00
Rolf Bjarne Kvinge 1adcd5e89c [tests] Adjust the PclTest.ServiceModel test to not throw ArgumentNullException 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)
2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge eb79bccd74 [tests] Skip testing Environment.SpecialFolder.ProgramFiles in .NET due to a .NET issue.
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
2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge 9cbf14500b [tests] Ignore the XmlSerializationTest.Bug1820_GenericList test in .NET due to a linker bug.
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)
2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge 39660b687c [tests] Assert that the Mono.Runtime type does *not* exist in .NET.
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
2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge 14aefe5576 [tests] Adjust LinkSdkRegressionTest.PrivateMemorySize64 in .NET to expected values.
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
2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge ae0649f4e5 [tests] Ignore LinkSdkRegressionTest.AsQueryable_Enumerable due to an issue in .NET
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)
2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge 75fbd970e0 [tests] Adjust LinkSdkRegressionTest.Pointer_5200 to work on .NET
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
2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge c8b622917d [tests] Adjust LinkExtraDefsTest to work with .NET.
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
2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge dea6580c78 [tests] Ignore CommonLinkSdkTest.TypeDescriptor_A7793 in .NET due to a linker bug.
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)
2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge 77f9a4d733 [tests] Ignore DllImportTest.LackOfCapget in .NET due to an issue in .NET.
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
2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge e8c389164d [tests] Disable link sdk tests that require Crypto for .NET.
Fixes these link sdk test failures:

    LinkSdk.CryptoTest
        [FAIL] AesCreate :   System.Core
            Expected: True
            But was:  False
                at LinkSdk.CryptoTest.AesCreate() in [...]/xamarin-macios/tests/linker/ios/link sdk/CryptoTest.cs:line 33

        [FAIL] Chain : System.EntryPointNotFoundException : AppleCryptoNative_SecKeychainCreate assembly:<unknown assembly> type:<unknown type> member:(null)
            at Interop.AppleCrypto.CreateOrOpenKeychain(String keychainPath, Boolean createAllowed)
            at Internal.Cryptography.Pal.StorePal.AppleKeychainStore.CreateOrOpenKeychain(String keychainPath, OpenFlags openFlags)
            at Internal.Cryptography.Pal.StorePal.FromCustomKeychainStore(String storeName, OpenFlags openFlags)
            at Internal.Cryptography.Pal.StorePal.FromSystemStore(String storeName, StoreLocation storeLocation, OpenFlags openFlags)
            at System.Security.Cryptography.X509Certificates.X509Store.Open(OpenFlags flags)
            at LinkSdk.CryptoTest.Chain() in [...]/xamarin-macios/tests/linker/ios/link sdk/CryptoTest.cs:line 149
            at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

        [FAIL] Sha256 : System.EntryPointNotFoundException : AppleCryptoNative_SecCopyErrorMessageString assembly:<unknown assembly> type:<unknown type> member:(null)
            at Interop.AppleCrypto.GetSecErrorString(Int32 osStatus)
            at Interop.AppleCrypto.CreateExceptionForOSStatus(Int32 osStatus)
            at Internal.Cryptography.Pal.X509Pal.AppleX509Pal.GetCertContentType(ReadOnlySpan`1 rawData)
            at System.Security.Cryptography.X509Certificates.X509Certificate2.GetCertContentType(ReadOnlySpan`1 rawData)
            at Internal.Cryptography.Pal.AppleCertificatePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
            at Internal.Cryptography.Pal.CertificatePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
            at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(ReadOnlySpan`1 data)
            at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(Byte[] data)
            at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(Byte[] rawData)
            at LinkSdk.CryptoTest.Sha256() in [...]/xamarin-macios/tests/linker/ios/link sdk/CryptoTest.cs:line 228
            at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge 6a2f1dbc29 [tests] Disable link sdk tests that require Crypto for .NET and which cause the test app to crash
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()
2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge a44fdae53d [tests] Ignore a link sdk test that calls MulticastDelegate.BeginInvoke.
MulticastDelegate.BeginInvoke isn't supported in .NET.

Ref: https://github.com/dotnet/runtime/issues/16312
2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge 3eeb46261a [tests] The HttpWebRequest constructors are not publicly available in .NET 5+, so use WebRequest.CreateHttp instead. 2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge 7cf7f2d2d3 [tests] Exclude link sdk tests using API that isn't available anymore in .NET. 2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge 7d7208c86d [tests] Exclude link sdk tests in .NET that reference OpenTK-1.0.dll
OpenTK-1.0.dll isn't supported yet.
2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge 809a12647f [tests] Port link sdk to .NET 2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge 6a1e8acbb0
[tests] Adjust resources test to cope with the fact that only the invariant culture is currently shipping in .NET 5. (#9498)
Ref: https://github.com/xamarin/xamarin-macios/issues/8906

This is the third of three steps to fix this test failure:

    EmbeddedResources.ResourcesTest
        [FAIL] Embedded :   en-AU
            Expected string length 5 but was 7. Strings differ at index 0.
            Expected: "G'day"
            But was:  "Welcome"
            -----------^
                at EmbeddedResources.ResourcesTest.Embedded() in [...]/xamarin-macios/tests/EmbeddedResources/ResourcesTest.cs:line 45
2020-08-26 09:39:52 +02:00
Rolf Bjarne Kvinge 0a39dbc682
[dotnet] Make sure the 'BuildOnlySettings' target has been called before any other .NET target we depend on. (#9496)
The 'BuildOnlySettings' target flips a switch that indicates we're doing a
real build, which makes the .NET build logic resolve and publish satellite
assemblies (the switch probably controls a lot of other stuff as well, but
this is where I ran into it).

This is the first of three steps to fix this test failure:

EmbeddedResources.ResourcesTest
    [FAIL] Embedded :   en-AU
        Expected string length 5 but was 7. Strings differ at index 0.
        Expected: "G'day"
        But was:  "Welcome"
        -----------^
            at EmbeddedResources.ResourcesTest.Embedded() in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/EmbeddedResources/ResourcesTest.cs:line 45
2020-08-26 08:00:52 +02:00
Rolf Bjarne Kvinge b097f7bbab
[tools] Honor the ENABLE_DOTNET variable. Fixes #9475. (#9502)
Fixes https://github.com/xamarin/xamarin-macios/issues/9475.
2020-08-26 07:59:46 +02:00
Rolf Bjarne Kvinge c0e16ef36d
[tests] Fix the don't link test on .NET. (#9501) 2020-08-26 07:58:53 +02:00
Rolf Bjarne Kvinge fb40d7e02f
[dotnet] Preserve relative directory when deciding where in the app bundle files should be copied. (#9497)
There may be multiple satellite assemblies with the same name, so make sure to
put them all in the corresponding subdirectory.

This is the second of three steps to fix this test failure:

    EmbeddedResources.ResourcesTest
        [FAIL] Embedded :   en-AU
            Expected string length 5 but was 7. Strings differ at index 0.
            Expected: "G'day"
            But was:  "Welcome"
            -----------^
                at EmbeddedResources.ResourcesTest.Embedded() in [...]/xamarin-macios/tests/EmbeddedResources/ResourcesTest.cs:line 45
2020-08-26 07:54:46 +02:00
Alex Soto 561214eb07
[xcode12] Bump PR for Xcode 12 Beta 6 (#9507) 2020-08-26 00:46:10 -04:00
Manuel de la Pena 26c4a88e68
[Accelerate] Ignore the new bindings for Xcode12 beta 5. (#9500)
Checked and the other functions that are similar to the new ones are not
bound. We only do this framework partially, so I'm adding them to the
ignore until we have a customer that requires them.
2020-08-25 19:25:58 -04:00
Manuel de la Pena 9c134344a8
[CallKit] Ignore framework on Mac OS X. (#9499) 2020-08-25 19:25:31 -04:00
Manuel de la Pena 420279b4e4
[ClockKit] Ignore framework on iOS. (#9495) 2020-08-25 16:27:27 -04:00
monojenkins 3fe21bed66
[msbuild] Fix AdditionalAppExtensions entitlement logic (#9494)
- Fixes https://github.com/xamarin/xamarin-macios/issues/9458
- Defining the variable over multiple lines changes output to include incorrect newline
- Auto tests did not catch, as they don't sign on bots due to infrastructure issues.
- Was refactored _after_ manual tests and not retested

Co-authored-by: Chris Hamons <chris.hamons@xamarin.com>
2020-08-25 14:40:00 -05:00
Rolf Bjarne Kvinge 827591eccc
[tools] Extract the code to parse, validate and process exception marshalling arguments into the Application class. (#9492)
So that it's easier to re-use it from our .NET linker code.
2020-08-25 19:55:50 +02:00
Rolf Bjarne Kvinge d49f9d4236
[dotnet/msbuild] Add support for compiling and embedding entitlements to .NET apps. (#9489)
First move the logic to compute the linker arguments for embedding
entitlements into the executable to shared code, so that it can be used from
platform-agnostic .NET code as well.

There is one difference: the code no longer checks if we're building for the
simulator, because the 'CompiledEntitlements' variable won't be set unless
we're in the simulator, so it's no longer needed (it's also not applicable for
Xamarin.Mac).

Also call the _CompileEntitlements target from the .NET build logic, and embed
the result into the executable.

This fixes the following 10 monotouch-tests:

    MonoTouchFixtures.Security.CertificateTest
        [FAIL] GenerateKeyPairTest :   GenerateKeyPair
            Expected: Success
            But was:  MissingEntitlement
                at MonoTouchFixtures.Security.CertificateTest.GenerateKeyPairTest() in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/Security/CertificateTest.cs:line 597

    MonoTouchFixtures.Security.KeyChainTest
        [FAIL] AddQueryRemove_Identity :   code
            Expected: DuplicateItem or Success
            But was:  MissingEntitlement
                at MonoTouchFixtures.Security.KeyChainTest.AddQueryRemove_Identity() in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/Security/KeyChainTest.cs:line 49

        [FAIL] Add_Certificate :   Add_Certificate
            Expected: Success or DuplicateItem
            But was:  MissingEntitlement
                at MonoTouchFixtures.Security.KeyChainTest.Add_Certificate() in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/Security/KeyChainTest.cs:line 38

        [FAIL] CheckId :   same guid
            Expected: 00000000-0000-0000-0000-000000000000
            But was:  9c3f0fd6-5c94-46a3-8193-a9fb45209a48
                at MonoTouchFixtures.Security.KeyChainTest.CheckId() in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/Security/KeyChainTest.cs:line 171

        [FAIL] SecItemAdd_Identity :   Expected: DuplicateItem or Success
            But was:  MissingEntitlement
                at MonoTouchFixtures.Security.KeyChainTest.SecItemAdd_Identity() in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/Security/KeyChainTest.cs:line 91

    MonoTouchFixtures.Security.RecordTest
        [FAIL] Accessible_17579 :   Add
            Expected: Success
            But was:  MissingEntitlement
                at MonoTouchFixtures.Security.RecordTest.Accessible(SecAccessible access) in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/Security/RecordTest.cs:line 56
                at MonoTouchFixtures.Security.RecordTest.Accessible_17579() in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/Security/RecordTest.cs:line 93

        [FAIL] AuthenticationType_17579 :   Add
            Expected: Success
            But was:  MissingEntitlement
                at MonoTouchFixtures.Security.RecordTest.AuthenticationType(SecAuthenticationType type) in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/Security/RecordTest.cs:line 174
                at MonoTouchFixtures.Security.RecordTest.AuthenticationType_17579() in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/Security/RecordTest.cs:line 186

        [FAIL] DeskCase_83099_InmutableDictionary :   Password could not be saved to keychain
            Expected: True
            But was:  False
                at MonoTouchFixtures.Security.RecordTest.DeskCase_83099_InmutableDictionary() in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/Security/RecordTest.cs:line 205

        [FAIL] IdentityRecordTest :   Identity added
            Expected: True
            But was:  False
                at MonoTouchFixtures.Security.RecordTest.IdentityRecordTest() in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/Security/RecordTest.cs:line 294

        [FAIL] Protocol_17579 :   Add
            Expected: Success
            But was:  MissingEntitlement
                at MonoTouchFixtures.Security.RecordTest.Protocol(SecProtocol protocol) in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/Security/RecordTest.cs:line 115
                at MonoTouchFixtures.Security.RecordTest.Protocol_17579() in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/Security/RecordTest.cs:line 127
2020-08-25 19:25:32 +02:00
Rolf Bjarne Kvinge 26ad21c1ad
[msbuild] Rework how we compute the input when compressing frameworks for binding projects. (#9486)
* Use ItemGroup inside a target, since using CreateItem is deprecated.
* Use target batching to make sure the _CompressNativeFrameworkResources
  target is called once per framework.
* Also add a comment for my future self describing the whole process, because
  I'll forget this by next week.

The end result is that we will now only re-compress a framework if any file in
that particular framework changed (as opposed to re-compressing all frameworks
in a binding project when any of them changed).
2020-08-25 19:25:13 +02:00
Manuel de la Pena 0c74444094
[CoreHaptics] Ignore framework on MacOS X due to issues in the headers. (#9490)
Although the headers are present, the framework cannot be used since the
header references AVAudioSession and is a class that is not present in
MacOS X
2020-08-25 12:58:10 -04:00
Rolf Bjarne Kvinge de8cc6bbd8
[dotnet-linker] Add Debug to the linker configuration. (#9491) 2020-08-25 18:40:59 +02:00
Rolf Bjarne Kvinge ebbd1e6738 [xharness] don't link is now green on .NET! 2020-08-25 18:18:34 +02:00
Rolf Bjarne Kvinge 90aaee0404 [tests] Ignore don't link tests that require globalization support.
.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
2020-08-25 18:18:34 +02:00
Rolf Bjarne Kvinge 5f1c5c5e92 [tests] Adjust don't link's TypeDescriptorCanary to take into account that .NET has new converters. 2020-08-25 18:18:34 +02:00
Rolf Bjarne Kvinge be66baad9e [tests] Modify don't link's TypeDescriptorCanary to find System.ComponentModel.ReflectTypeDescriptionProvider in the same assembly BooleanConverter is.
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
2020-08-25 18:18:34 +02:00
Rolf Bjarne Kvinge 87efe8625d [tests] Ignore a don't link test that calls MulticastDelegate.BeginInvoke.
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)
2020-08-25 18:18:34 +02:00
TJ Lambert b25f09d87c
[AppKit] fix deprecation message (#9481)
Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2020-08-25 11:03:23 -05:00
Rolf Bjarne Kvinge 9eab011a4b
[tests] Port dont link to .NET (#9488)
There are a few test failures, so it's ignored by default in xharness for now.
2020-08-25 17:04:01 +02:00
TJ Lambert ea4c5efc5b
[OSLog] moving the todo selectors into ignore files (#9482)
Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2020-08-25 09:54:47 -05:00
Chris Hamons 96e3df207d
[msbuild] Fix AdditionalAppExtensions entitlement logic (#9477)
- Fixes https://github.com/xamarin/xamarin-macios/issues/9458
- Defining the variable over multiple lines changes output to include incorrect newline
- Auto tests did not catch, as they don't sign on bots due to infrastructure issues.
- Was refactored _after_ manual tests and not retested
2020-08-25 09:26:07 -05:00
Rolf Bjarne Kvinge f19207d57d
[tests] Update the MT0113_linker test asserting an error message after the message changed. (#9485)
This regressed here: d7ab847697

Fixes this failure:

    Xamarin.MTouch.MT0113_linker:
    The error 'MT0113: Native code sharing has been disabled for the extension 'testServiceExtension' because the managed linker settings are different between the container app (None) and the extension (All).' was not found in the output:
        Message #1 did not match:
            actual: 'Native code sharing has been disabled for the extension 'testServiceExtension' because the managed linker settings are different between the container app (None) and the extension (Full).'
            expected: 'Native code sharing has been disabled for the extension 'testServiceExtension' because the managed linker settings are different between the container app (None) and the extension (All).'
2020-08-25 15:13:04 +02:00
Sebastien Pouliot 6879dcf8bb
[tests][security] Re-enable two disabled tests after validation (#9483) 2020-08-25 08:46:57 -04:00
Rolf Bjarne Kvinge ab47edcb27
[dotnet] Implement resource bundling. (#9472)
* Port the BundledResources test to .NET.
* Fix a minor issue in the BundledResources test to make sure it works on macOS.
* Add a unit test to make sure resources are bundled as expected.
* Modify the .NET build logic to bundle/unbundle resources.
2020-08-25 13:14:01 +02:00
Rolf Bjarne Kvinge 18ca278e88
[msbuild] Share the Pack/UnpackLibraryResources targets between Xamarin.iOS and Xamarin.Mac. (#9471)
There were 2 differences that had to be reconciled:

* The Xamarin.Mac version took 'IntermediateOutputPath' as the intermediate
  output path, while the Xamarin.iOS version used
  'DeviceSpecificIntermediateOutputPath'.
  'DeviceSpecificIntermediateOutputPath' is defined to be
  'IntermediateOutputPath' for Xamarin.Mac, so make the shared version use
  'DeviceSpecificIntermediateOutputPath', since that works in both cases.

* The Xamarin.Mac version was writing the output of PackLibraryResources to
  the FileWrites item group. This was removed on purpose from the Xamarin.iOS
  version in e97d69b25c, so it seemed best to
  leave it out in the shared version as well.

Also re-use the _EmbeddedResourcePrefix variable to determine the resource prefix.
2020-08-25 10:42:33 +02:00
Rolf Bjarne Kvinge 622656acc3
[msbuild] Share the _CompressNativeFrameworkResources/_CompressFrameworks target between Xamarin.iOS and Xamarin.Mac. (#9461) 2020-08-25 10:41:50 +02:00
Rolf Bjarne Kvinge 87d11008bf
[dotnet] Implement support for the partial static registrar. (#9438)
1. Generate the partial static registrar code and ship it. This required a few
   changes to mtouch and mmp to make them work in a .NET world.
2. Add a RegistrarStep step to the .NET linker, which will handle any
   registrar logic, and implement support for the partial static registrar.
2020-08-25 10:40:42 +02:00