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

11642 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 7f1d62ca13
[xharness] Skip some device variations for .NET. (#12699)
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.
2021-09-13 16:13:36 +02:00
Rolf Bjarne Kvinge bfb27da6b6
[msbuild/dotnet] Make 'LinkSdk' the default linker mode for Mac Catalyst when building for Release, and 'None' the default when building for Debug. Fixes #12264. (#12701)
Fixes https://github.com/xamarin/xamarin-macios/issues/12264.
2021-09-13 16:12:58 +02:00
Rolf Bjarne Kvinge 42471c1d22
[msbuild] Implement ITaskCallback in [Read|Write]AppManifest to tell the remote task execution that any files on Windows shouldn't be copied back to the mac. (#12646)
Fixes https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1394206.
2021-09-13 16:06:06 +02:00
TJ Lambert fc8b7c9b29
[Metal] Add Support for DotNet Attributes (#12604) 2021-09-10 17:21:47 -05:00
Rolf Bjarne Kvinge aadd53249f
[msbuild] Improve E7082 error message. (#12689) 2021-09-10 22:02:30 +02:00
Rolf Bjarne Kvinge f559399f19
[tests] Improve makefiles for .NET's dont link test. (#12690)
This makes it identical to the 'link sdk' and 'link all' makefiles.
2021-09-10 21:19:11 +02:00
Rolf Bjarne Kvinge 033ebd7f84
[tests] Import nunit.framework.targets in more .NET test projects. (#12691)
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).
2021-09-10 21:07:09 +02:00
Manuel de la Pena 42dd6cea65
[XKit] Update for xcode13 beta 5. (#12610)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-09-10 12:16:55 -04:00
Manuel de la Pena 2ff6f9f675
[CI] In order to support APIScan we need to add the governance checks AFTER the build. (#12678) 2021-09-10 12:15:10 -04:00
Rolf Bjarne Kvinge 855de9623a
Bump maccore. (#12675)
New commits in xamarin/maccore:

* xamarin/maccore@efad4f0bae [Xamarin.Hosting] Fix a few compiler warnings.
* xamarin/maccore@55087e093a [Xamarin.Hosting] Fix detecting app exit on device.
* xamarin/maccore@ffefee386c [Xamarin.Hosting] Add support for launching with debugserver on iOS/tvOS 14+.
* xamarin/maccore@e203814d08 [tests] Fix .ipa path for iOSCoolApp now that it's a fat app.
* xamarin/maccore@c2531ff702 Update the provisionator script.
* xamarin/maccore@2bfa5fa12b [submission] Add a fat Mac Catalyst test app.

Diff: 3e591cbcb1..efad4f0bae
2021-09-10 14:31:04 +02:00
Rolf Bjarne Kvinge ce7b876dcf
[tests] Fix building fsharplibrary using the makefile. (#12676)
F# projects aren't named *.csproj.
2021-09-10 13:59:45 +02:00
Peter Collins 5977af4c06
[vs-insertion] Push packs to "shipping" feed (#12682)
Context: https://github.com/xamarin/yaml-templates/pull/134

The .NET 6 packs will now also be pushed to a public xamarin
`net6-maui-shipping` feed during the `VS Insertion` stage.
2021-09-10 08:22:25 +02:00
dotnet-maestro[bot] 819c92251b
[main] Update dependencies from dotnet/installer (#12662)
* 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>
2021-09-10 08:15:31 +02:00
TJ Lambert 0e0bb1f931
[CloudKit] Add Support for DotNet Attributes (#12672) 2021-09-09 23:00:49 -05:00
TJ Lambert 3d67a66925
[WebKit] Add Support for DotNet Attributes (#12653) 2021-09-09 22:59:32 -05:00
TJ Lambert 3aa7dd810f
[CoreFoundation] Add Support for DotNet Attributes (#12652) 2021-09-09 22:58:11 -05:00
TJ Lambert 4e0151657f
[CoreVideo] Add Support for DotNet Attributes (#12627) 2021-09-09 22:51:12 -05:00
Manuel de la Pena 55e8c60e0d
[CI] Fix 32b stage. (#12680) 2021-09-09 15:24:03 -04:00
Manuel de la Pena 897170f72a
[CI] Only execute iOS 32b on weekends. (#12615) 2021-09-09 12:44:29 -04:00
TJ Lambert a3042e57de
[ARKit] Add Support for DotNet Attributes
Co-authored-by: tj_devel709 <antlambe@microsoft.com>
2021-09-09 12:21:56 -04:00
TJ Lambert 4386fc1ed9
[Photos] Add Support for DotNet Attributes
Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2021-09-09 12:19:41 -04:00
TJ Lambert 29b0bbc0d2
[CoreBluetooth] Add Support for DotNet Attributes
Co-authored-by: tj_devel709 <antlambe@microsoft.com>
2021-09-09 12:17:41 -04:00
Sebastien Pouliot 209486aa5a
[generator] Small source simplification (#12670) 2021-09-09 09:41:44 -04:00
Rolf Bjarne Kvinge 07f83a8815
[CoreFoundation] The native 'dispatch_queue_create_with_target' function is actually called 'dispatch_queue_create_with_target$V2'. (#12666)
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
2021-09-09 15:05:29 +02:00
Filip Navara 219fb1a753
Remove IsXcode8 (#12671)
* Remove IsXcode8

* Remove other _ForgeMetal references
2021-09-09 09:23:32 +02:00
Rolf Bjarne Kvinge cb998a3589
[msbuild/dotnet] Don't use the built-in publishing logic in .NET to copy frameworks to the app bundle. Fixes #12369. (#12656)
.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.
2021-09-09 09:11:25 +02:00
Rolf Bjarne Kvinge d0b2b98615
[dotnet-linker] Improve output when we report an error we raised ourselves. (#12664)
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.
2021-09-09 09:09:58 +02:00
Rolf Bjarne Kvinge 444e7dfcd9
[msbuild] Don't require an Info.plist for .NET builds. (#12661)
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.
2021-09-09 09:08:04 +02:00
Rolf Bjarne Kvinge b3c2b548de
[link sdk] Ignore XmlSerializationTest.Bug1820_GenericList on device due to a linker bug. (#12667) 2021-09-09 09:04:51 +02:00
Rolf Bjarne Kvinge 770b9c5d27
[tests] Adjust a few introspection checks to work on iOS 11.4.1 (#12668)
I ran into these failures when running on an iOS 11.4.1 device (iPhone 7 / A1778).
2021-09-09 09:00:20 +02:00
Chris Hamons 97e2e00b59
[xtro] Improve detection of Catalyst missing API by fixing xtro (#12626)
- macCatalyst was being missed as it is not all lower case
- Extend tv and watch 'act like iOS if not listed' to catalyst
2021-09-08 16:31:44 -05:00
Rolf Bjarne Kvinge c2fda6ebf9
[dotnet] Enable LLVM by default for release builds. Fixes #12147. (#12660)
Fixes https://github.com/xamarin/xamarin-macios/issues/12147.
2021-09-08 18:04:39 +02:00
Filip Navara 3010172bb5
Update CryptoTest for .NET 6 (#12658)
* Update CryptoTest for .NET 6

* Update tests/linker/ios/link sdk/CryptoTest.cs

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-09-08 18:03:52 +02:00
Filip Navara f28db5491e
Relax the tvOS special folder checks to make them pass both on dotnet and legacy. Fixes #12640. (#12659)
Fixes https://github.com/xamarin/xamarin-macios/issues/12640.
2021-09-08 17:59:40 +02:00
TJ Lambert 88eb6d02d7
[CarPlay] Add Support for DotNet Attributes
Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2021-09-08 10:42:16 -04:00
TJ Lambert 7e52b6656e
[CoreSpotlight] Add Support for DotNet Attributes
Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2021-09-08 10:30:40 -04:00
Sebastien Pouliot db68536054
[foundation] Enable nullability on NSString manual bindings (#12651)
Also fix `compare:` undefined behavior if used with `nil`.

ref: https://github.com/xamarin/xamarin-macios/wiki/Nullability
2021-09-08 10:27:02 -04:00
Jonathan Peppers 1de22290d7
[dotnet] rename $(AppleShortVersion) to $(ApplicationDisplayVersion) (#12647)
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.
2021-09-08 10:13:29 -04:00
Rolf Bjarne Kvinge a968598af0
[tests] Add test case for making sure we have the right bundle identifier when executing DetectSigningIdentity. Fixes #12051. (#12655)
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.
2021-09-08 15:46:59 +02:00
dotnet-maestro[bot] 8dc41314ed
Update dependencies from https://github.com/dotnet/installer build 20210906.8 (#12643)
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>
2021-09-08 09:49:12 +02:00
Rolf Bjarne Kvinge 24ea02759f
[dotnet] Support SupportedOSPlatformVersion. Fixes #12336. (#12638)
* 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.
2021-09-08 09:20:05 +02:00
Rolf Bjarne Kvinge a0fe8c08ba
[msbuild] Add a public target/property to make customers able to add to the PartialAppManifest item group in their own targets. Fixes #12336. (#12645)
Also add a test.

Fixes https://github.com/xamarin/xamarin-macios/issues/12336 (for the second time).
2021-09-08 09:16:57 +02:00
TJ Lambert 1542039f22
[EventKitUI] Add Support for DotNet Attributes (#12625) 2021-09-07 14:32:37 -05:00
TJ Lambert 6d89a00247
[CoreLocation] Add Support for DotNet Attributes (#12623) 2021-09-07 14:27:38 -05:00
TJ Lambert d060204309
[GameplayKit] Add Support for DotNet Attributes (#12621) 2021-09-07 14:26:45 -05:00
TJ Lambert e8ebdb7ca1
[CoreServices] Add Support for DotNet Attributes 2021-09-07 14:23:36 -05:00
TJ Lambert 9b8fdad656
[AssetsLibrary] Add Support for DotNet Attributes 2021-09-07 14:11:48 -05:00
TJ Lambert 000834e972
[CoreGraphics] Add Support for DotNet Attributes (#12611) 2021-09-07 14:10:11 -05:00
Rolf Bjarne Kvinge e707c7cda8
[tests] Remove assert that fails on M1 on Rosetta. (#12641)
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
2021-09-07 18:52:53 +02:00
Rolf Bjarne Kvinge 88cf80da2d
[xharness] Remove legacy Mac Catalyst support. (#12642)
We're going .NET all the way.

This simplifies xharness a little bit, and speeds up our test run somewhat.
2021-09-07 18:35:33 +02:00