Skip:
* Any Thumb variation (Thumb code isn't supported anymore in .NET).
* Any AssemblyBuildTarget variation (compiling assemblies to dylibs [fastdev]
or frameworks - neither is supported/implemented for .NET).
This trims down the test list a bit.
This is to set the -dlsym:-nunit.framework.dll option, because nunit.framework.dll
contains a P/Invoke to a function that doesn't exist.
For some reason this is more of a problem in tvOS projects than iOS projects
(although it happens for iOS projects as well).
* Update dependencies from https://github.com/dotnet/installer build 20210907.23
Microsoft.Dotnet.Sdk.Internal
From Version 6.0.100-rc.2.21456.8 -> To Version 6.0.100-rc.2.21457.23
* Update dependencies from https://github.com/dotnet/installer build 20210908.9
Microsoft.Dotnet.Sdk.Internal
From Version 6.0.100-rc.2.21456.8 -> To Version 6.0.100-rc.2.21458.9
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Apple does this in their headers:
#define DISPATCH_ALIAS_V2(sym) __asm__("_" #sym "$V2")
dispatch_queue_t
dispatch_queue_create_with_target(const char *_Nullable label,
dispatch_queue_attr_t _Nullable attr, dispatch_queue_t _Nullable target)
DISPATCH_ALIAS_V2(dispatch_queue_create_with_target);
Which means that the native compiler will call
'dispatch_queue_create_with_target$V2' when the source code says to call
'dispatch_queue_create_with_target'.
The only place I've run into this problem, is when building for tvOS (device),
and targetting exactly tvOS 10.0 (neither earlier or later), in which case the
linker fails:
Undefined symbols for architecture arm64:
"_dispatch_queue_create_with_target", referenced from:
wrapper_managed_to_native_CoreFoundation_DispatchQueue_dispatch_queue_create_with_target_string_intptr_intptr in Xamarin.TVOS.dll.o
I filed this as a feedback with Apple some time ago [1], and Apple resolved it
as by design, saying "These symbols are renamed, please use the SDK."
Now I ran into it again with .NET, and it's become a bit more important, since
tvOS 10.0 is the earliest tvOS version we support, which means it'll be more
likely that customers use _exactly_ 10.0 as their target tvOS version. So I
looked into it again, and as far as I can tell, we can just call the '$V2'
variant instead of the original name everywhere.
Apple does the same thing for two other functions, but we haven't bound any of
those, so this only affects 'dispatch_queue_create_with_target' for us.
[1]: Bug ID 48076044: Can't reference 'dispatch_queue_create_with_target' when min tvOS version is exactly 10.0
.NET/MSBuild don't handle symlinks properly [1], which means that we can't ask
.NET to copy frameworks to the app bundle, since frameworks may contain
symlinks.
In our case, the symptom was that instead of copying symlinks, the file the
symlink pointed to was copied instead, and then codesign complained about
invalid bundle format when we tried to sign the framework.
We fix this by having our own target (_CopyFrameworksToBundle) to copy
frameworks to the app bundle (instead of adding all the files in the
frameworks to the ResolvedFileToPublish item group), and then using 'ditto' to
copy the frameworks.
In order to create a test case for this, I also made the macOS and Mac
Catalyst versions of the XTest framework use symlinks:
* Create a proper XTest framework bundle hierarchy for macOS and Mac Catalyst
by using the typical symlink structure (actual files in the Versions/A
subdirectory, and then symlinks pointing into that directory).
* Create a separate Info.plist for each platform for XTest.framework, since
using an otherwise correct framework makes tooling (such as codesign)
complain if the Info.plist isn't correct too.
This made our existing tests show the bug.
Finally I had to fix signing frameworks where the executable is a symlink.
We were first resolving symlinks for the input - say we had an
Example.framework/Example symlink to Example.framework/Versions/A/Example -
and then checking the parent directory if it's a framework. The parent
directory of 'Example.framework/Versions/A/Example' is 'A', which did not meet
our framewrok condition (if it ends with '.framework').
The fix is to adjust the logic to resolve symlinks after checking if the input
is a framework or not.
[1]: https://github.com/dotnet/msbuild/issues/6821
Fixes https://github.com/xamarin/xamarin-macios/issues/12369.
Instead of something like this:
ILLINK : error MT2362: The linker step 'Registrar' failed during processing: One or more errors occurred. (The registrar cannot build a signature for type `Bindings.Test.Sf' in method `Sf()`.
) (The registrar cannot build a signature for type `Bindings.Test.Sf' in method `Sf_invoke()`. (TaskId:208)
) (The registrar cannot build a signature for type `Bindings.Test.Sdldl' in method `get_PSdldl()`. (TaskId:208)
) (The registrar cannot build a signature for type `Bindings.Test.Sdldl' in method `Bindings.Test.ObjCRegistrarTest.set_PSdldl`. (TaskId:208)
) (The registrar cannot build a signature for type `Bindings.Test.Sf' in method `get_PSf()`. (TaskId:208)
) (The registrar cannot build a signature for type `Bindings.Test.Sf' in method `Bindings.Test.ObjCRegistrarTest.set_PSf`. (TaskId:208)
) (The registrar cannot build a signature for type `Bindings.Test.Sff' in method `get_PSff()`. (TaskId:208)
) (The registrar cannot build a signature for type `Bindings.Test.Sff' in method `Bindings.Test.ObjCRegistrarTest.set_PSff`. (TaskId:208)
) (The registrar cannot build a signature for type `Bindings.Test.Sfff' in method `get_PSfff()`. (TaskId:208)
) (The registrar cannot build a signature for type `Bindings.Test.Sfff' in method `Bindings.Test.ObjCRegistrarTest.set_PSfff`. (TaskId:208)
) (The registrar cannot build a signature for type `Bindings.Test.Sffff' in method `get_PSffff()`. (TaskId:208)
) (The registrar cannot build a signature for type `Bindings.Test.Sffff' in method `Bindings.Test.ObjCRegistrarTest.set_PSffff`. (TaskId:208)
) (The registrar cannot build a signature for type `Bindings.Test.Sfffff' in method `get_PSfffff()`. (TaskId:208)
) (The registrar cannot build a signature for type `Bindings.Test.Sfffff' in method `Bindings.Test.ObjCRegistrarTest.set_PSfffff`. (TaskId:208)
) (The registrar cannot build a signature for type `Bindings.Test.Sfi' in method `get_PSfi()`. (TaskId:208)
) (The registrar cannot build a signature for type `Bindings.Test.Sfi' in method `Bindings.Test.ObjCRegistrarTest.set_PSfi`. (TaskId:208)
) (The registrar cannot build a signature for type `Bindings.Test.Sfifi' in method `get_PSfifi()`. (TaskId:208)
) (The registrar cannot build a signature for type `Bindings.Test.Sfifi' in method `Bindings.Test.ObjCRegistrarTest.set_PSfifi`. (TaskId:208)
we now get this:
/Users/rolf/work/maccore/dotnet-devicetests/xamarin-macios/tests/bindings-test/dotnet/iOS/obj/Debug/net6.0-ios/iOS/Bindings.Test/ObjCRegistrarTest.g.cs(3072): error MT4111: The registrar cannot build a signature for type `Bindings.Test.Sf' in method `Sf()`.
/Users/rolf/work/maccore/dotnet-devicetests/xamarin-macios/tests/bindings-test/dotnet/iOS/obj/Debug/net6.0-ios/iOS/Bindings.Test/ObjCRegistrarTest.g.cs(3100): error MT4111: The registrar cannot build a signature for type `Bindings.Test.Sf' in method `Sf_invoke()`.
/Users/rolf/work/maccore/dotnet-devicetests/xamarin-macios/tests/bindings-test/dotnet/iOS/obj/Debug/net6.0-ios/iOS/Bindings.Test/ObjCRegistrarTest.g.cs(6112): error MT4111: The registrar cannot build a signature for type `Bindings.Test.Sdldl' in method `get_PSdldl()`.
/Users/rolf/work/maccore/dotnet-devicetests/xamarin-macios/tests/bindings-test/dotnet/iOS/obj/Debug/net6.0-ios/iOS/Bindings.Test/ObjCRegistrarTest.g.cs(6138): error MT4111: The registrar cannot build a signature for type `Bindings.Test.Sdldl' in method `Bindings.Test.ObjCRegistrarTest.set_PSdldl`.
/Users/rolf/work/maccore/dotnet-devicetests/xamarin-macios/tests/bindings-test/dotnet/iOS/obj/Debug/net6.0-ios/iOS/Bindings.Test/ObjCRegistrarTest.g.cs(6149): error MT4111: The registrar cannot build a signature for type `Bindings.Test.Sf' in method `get_PSf()`.
ILLINK : error MT2362: The linker step 'Registrar' failed during processing: One or more errors occurred.
and in addition we'll get stack traces for each inner exception as well
whenever we have verbose mtouch logging enabled.
We either have defaults or MSBuild properties for the most important values that
were previously required to be in the Info.plist, so now it doesn't make sense anymore
to require an Info.plist, when for simple cases it will just be an empty file.
This allows us to simplify some of our test projects and remove a few empty Info.plist files.
Context: https://github.com/dotnet/maui/issues/1662
Context: https://github.com/xamarin/xamarin-android/pull/6139
Previously:
* `$(ApplicationVersion)` mapped to `CFBundleVersion`
* `$(AppleShortVersion)` mapped to `CFBundleShortVersionString`
To be able to leverage identical property names on iOS/Android,
we're changing this to:
* `$(ApplicationVersion)` maps to `CFBundleVersion`
* `$(ApplicationDisplayVersion)` maps to `CFBundleShortVersionString`
Lastly, let's allow `$(ApplicationDisplayVersion)` to set `$(Version)`,
so the various C# assembly-level attributes are all set to the same value.
Add test case to verify that we pass the right bundle identifier to
DetectSigningIdentity when we're using a partial app manifest to set the
bundle identifier.
This proves that #12051 is already fixed.
Microsoft.Dotnet.Sdk.Internal
From Version 6.0.100-rc.2.21456.2 -> To Version 6.0.100-rc.2.21456.8
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
* Add support for the SupportedOSPlatformVersion MSBuild property, and write
it to the Info.plist for the corresponding minimum OS version.
* If there are any minimum OS version in the Info.plist, we'll now show an
error if it doesn't match SupportedOSPlatformVersion.
This unfortunately means that if there's any minimum OS version in any
Info.plist, then that will most likely have to be moved to the
SupportedOSPlatformVersion property (or removed entirely if that's the right
choice), since it's unlikely to match the default value for
SupportedOSPlatformVersion. However, this was deemed to be the best option for
the future (it's a one-time pain during migration).
Also add new tests, update existing tests, and update the templates.
Fixes https://github.com/xamarin/xamarin-macios/issues/12336.
Fixes this error when running on M1 (and Rosetta):
MonoTouchFixtures.CoreFoundation.BundleTest.TestGetBundleIdNull : 0.9134 ms
[FAIL] TestIsArchitectureLoadable : arm64 Expected => false
Expected: False
But was: True
at MonoTouchFixtures.CoreFoundation.BundleTest.TestIsArchitectureLoadable() in xamarin-macios/tests/monotouch-test/CoreFoundation/BundleTest.cs:line 375