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

4576 Коммитов

Автор SHA1 Сообщение Дата
Sven Boemer dc320a3606
Update to new linker custom steps API (#11374)
* 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>
2021-05-12 12:26:54 -04:00
Manuel de la Pena 289b095313
[Tests] Allow to assert on device and not vm on macOS. (#11508) 2021-05-12 11:09:35 -04:00
Rolf Bjarne Kvinge 913cbb67d7
[xharness] Add ARM64 variations for macOS/.NET using both MonoVM and CoreCLR. (#11516) 2021-05-12 15:04:14 +02:00
Rolf Bjarne Kvinge 82f8ca80a1
[tests] Make ImageCaptioningTest.SetCaption restore the original value at the end. (#11499)
This makes it so that ImageCaptioningTest.GetCaption doesn't fail because it
gets values it doesn't expect.
2021-05-12 07:56:11 +02:00
Rolf Bjarne Kvinge 6c3bf9a4c8 [tests] Add a comment about Rosetta. 2021-05-12 07:34:11 +02:00
Rolf Bjarne Kvinge 12ba642b19 [monotouch-test] Adjust TestTypeEncodings for ARM64 on macOS. 2021-05-11 15:54:39 +02:00
Rolf Bjarne Kvinge c398519565 [tests] Add an ARM64 configuration of xammac tests. 2021-05-11 15:54:39 +02:00
Rolf Bjarne Kvinge 4354b96889 [xharness] Add an ARM64 variation of the xammac tests. 2021-05-11 15:54:39 +02:00
Rolf Bjarne Kvinge 6457c5a5a4 [tests] Update tests to cope with macOS and simulator running on ARM64. 2021-05-11 15:54:39 +02:00
Rolf Bjarne Kvinge ccbdb33b93 [monotouch-test] Adjust BundleTest.TestIsArchitectureLoadable for ARM64.
We can still load an X64 executable when running on an ARM64 CPU.
2021-05-11 15:54:39 +02:00
Rolf Bjarne Kvinge 68e67835f1
[xammac tests] Add Bluetooth description in the Info.plist. (#11496)
Otherwise the test app crashes when running within lldb.
2021-05-11 15:54:24 +02:00
tj_devel709 6d23054789 removing ignores from 2 msbuild localization tests as well as inserting forgotten test casess 2021-05-07 10:43:03 -05:00
TJ Lambert a154f30e03
[Localization] Localization changes for OneLocBuild (#11395)
Enabling MSBuild, Mtouch, and all their localization dependencies to use the new resx files provided from OneLocBuild.
2021-05-06 19:42:53 -05:00
Sebastien Pouliot 4ba7bf3b9d
[tests][dotnet] A few helping touch to do size comparison (#11446)
- Make git ignore the generated `report.md`
- Fix `.aotdata` reported total size in reports (was always 0)
- Add option to strip the dotnet app bundle (until [1]) so it's easier to compare with _oldnet_ sizes.

[1] https://github.com/xamarin/xamarin-macios/issues/11445
2021-05-05 19:15:18 -04:00
Rolf Bjarne Kvinge 938f63da22
[tests] Make the mtouch test project reference the actual mtouch project. (#11400)
This makes it easier to test localized strings used in mtouch, since we don't have
to replicate the build for all the resources.

This required a few changes to avoid including code in the mtouch tests that already
exists in the mtouch executable.

Also rename the mtouch test project to mtouchtests.csproj.

This way the test project can reference the actual mtouch.csproj without
causing conflicts due to having two projects with the same name.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-05-04 14:10:03 +02:00
Rolf Bjarne Kvinge 14e76c0139
[runtime] Return the exception from wrapper methods for exception marshalling. (#11382)
There's no general way to set a pending managed exception in CoreCLR (the
current plan is to support setting a pending managed exception for the
objc_msgSend family of functions). This means that the way we've implemented
custom wrappers that can handle Objective-C exceptions won't work, because
those wrappers currently tries to set a pending managed exception (which Mono
throws upon returning from the corresponding native wrapper function).

So rewrite this a bit: these custom wrappers now return a GCHandle with the
managed exception as an out parameter, and the calling managed code throws
that exception instead.

This also required adjusting a few API definitions to match how their wrapper
functions are defined.
2021-05-04 08:25:38 +02:00
Sebastien Pouliot 72a6d60d2b
[tests][dotnet] Bump MSBuild.StructuredLogger to 2.1.472 to fix ArgumentNullException in our tests (#11422) 2021-05-03 19:51:52 -04:00
Manuel de la Pena 47f273b4f6
[Tests] Update xamarin domain to make tests not fail. (#11408)
A wrong implementation of a redirect was added and returns a 403 and not
a 302 resulting in an error. Update to the final destination of the
redirect and be happy.

fixes https://github.com/xamarin/maccore/issues/2432
2021-05-02 20:11:16 -04:00
Rolf Bjarne Kvinge 6f743fd292
[build] Skip building stuff that isn't enabled. (#11385) 2021-04-30 07:51:58 +02:00
Sebastien Pouliot e2d65529dc
[tests][xtro] Fix recent failures (#11386)
New file was not committed (should have been with a rename)
2021-04-29 15:46:20 -04:00
Sebastien Pouliot 426d6d6bea
[tests][xtro] Fix catalyst changes with xcode12.5 RC (#11340)
xtro should soon be re-enabled and spot those on the (backport) PR
2021-04-29 10:14:05 -04:00
Sebastien Pouliot 8679482cc0
[dotnet] Fix release builds on devices (#11367)
Fixed by removal of
```
<InvariantGlobalization Condition="'$(InvariantGlobalization)' == ''">false</InvariantGlobalization>
```
which is (should be) the default.

All our local usage compare with it with `true` so this likely comes from
somewhere else (sdk / runtime).

It does not really have a huge impact on build size (and the small diff
is probably the source of the crash)

* fails (17,479,981): https://gist.github.com/spouliot/6f8defb8f940e68314ba167ea76dc9bf
* works (17,502,741): https://gist.github.com/spouliot/d06f0b1b95e114fe469ce49081c70e33

Also fix target to run a release (no debug) build, which is more helpful
"out of the box" :)

Tracking issue with: https://github.com/xamarin/xamarin-macios/issues/11366
2021-04-29 09:44:14 -04:00
Rolf Bjarne Kvinge d9ec37ca2d
[tests] Build a macOS/arm64 version of libtest. (#11364)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-04-29 13:41:52 +02:00
Rolf Bjarne Kvinge ec7dc80b59
[tests] Add a bluetooth usage description to monotouch-test/macOS. (#11355)
This seems to be required when running monotouch-test with lldb (!) - no idea
why it doesn't fail otherwise.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-04-29 08:37:36 +02:00
Manuel de la Pena a1a5c01935
[Xharness] Fix the test selector. (#11315)
Fix the tests selector by setting the PR number in an env variable that
is not longer linked with Jenkins.

Fixes #11299
2021-04-27 09:23:21 -04:00
Sebastien Pouliot cd4e5b543e
[videotoolbox] Update for dotnet attributes (#11342)
and ajust xtro for unavbailable Catalyst API
2021-04-27 08:43:59 -04:00
Marius Ungureanu b930f9cce9
Make NSWindow appearanceSource null allowed (#11334)
Native headers show it's null_resettable.

```objc
/// If set, the receiver will inherit the appearance of that object, as well as use KVO to observe its effectiveAppearance for changes. Typically this is used for child windows that are shown from a parent window or specific view. Defaults to NSApp.
@property (weak, null_resettable) NSObject<NSAppearanceCustomization> *appearanceSource API_AVAILABLE(macos(10.14));
```
2021-04-26 18:02:25 -04:00
Rolf Bjarne Kvinge d15f683500
[tests] Add a performance test using BenchmarkDotNet. (#11298) 2021-04-23 13:29:06 +02:00
Jonathan Peppers b1080ee9bf
[catalyst] remove splash screens (#11300)
Context: https://github.com/dotnet/maui/pull/807

When implementing a new `@(MauiSplashScreen)` feature for .NET MAUI, I
found out that Catalyst doesn't have support for splash screens.

I even tested this in Xcode:

* Create a new Objective-C iOS app
* Make `LaunchScreen.storyboard` red and `Main.storyboard` green.
* Check the new `macOS` checkbox in project settings to enable
  Catalyst and be a multiplatform app.

I see red, then green on iOS but only green on macOS. I think Catalyst
completely ignores `UILaunchStoryboardName`.

This removes splash screens from the `dotnet new maccatalyst` template
as well as the `MyCatalystApp` sample project.
2021-04-23 07:38:05 +02:00
Rolf Bjarne Kvinge 0924ce55ef
Remove dead code. (#11289) 2021-04-22 16:03:05 +02:00
Filip Navara be14188892
Use the SDK UseMonoRuntime property instead of _XamarinRuntime in MSBuild (#11255)
* Use the SDK UseMonoRuntime property instead of _XamarinRuntime in MSBuild

* Fix typo

* Update Xamarin.Shared.Sdk.targets

Mono -> MonoVM
2021-04-22 16:02:56 +02:00
Sebastien Pouliot bbee8a0a57
[tests][link all] Fix nunit silent exception causing some tests not to be enabled (#11287)
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
2021-04-22 09:14:33 -04:00
Rolf Bjarne Kvinge 94ca4e7a03
[ObjCRuntime] Print to stderr if using xamarin_log fails. Fixes #11239. (#11262)
* [ObjCRuntime] Print to stderr if using xamarin_log fails. Fixes #11239.

Fixes https://github.com/xamarin/xamarin-macios/issues/11239.

* Update xtro.
2021-04-22 11:57:41 +02:00
Sebastien Pouliot 5accd102cf
[dotnet][tvos] Enable ICU (instead of using Invariant) and additional tests (#11247) 2021-04-21 20:19:05 -04:00
Rolf Bjarne Kvinge 0854e5a1a0
[xtro] Update MacCatalyst todos. (#11253)
Fixes:

    ?fixed-todo? Entry '!missing-pinvoke! AudioSessionAddPropertyListener is not bound' in 'MacCatalyst-AudioToolbox.todo' is not found in corresponding 'MacCatalyst-AudioToolbox.raw' file
    ?fixed-todo? Entry '!missing-pinvoke! AudioSessionGetProperty is not bound' in 'MacCatalyst-AudioToolbox.todo' is not found in corresponding 'MacCatalyst-AudioToolbox.raw' file
    ?fixed-todo? Entry '!missing-pinvoke! AudioSessionGetPropertySize is not bound' in 'MacCatalyst-AudioToolbox.todo' is not found in corresponding 'MacCatalyst-AudioToolbox.raw' file
    ?fixed-todo? Entry '!missing-pinvoke! AudioSessionInitialize is not bound' in 'MacCatalyst-AudioToolbox.todo' is not found in corresponding 'MacCatalyst-AudioToolbox.raw' file
    ?fixed-todo? Entry '!missing-pinvoke! AudioSessionSetActive is not bound' in 'MacCatalyst-AudioToolbox.todo' is not found in corresponding 'MacCatalyst-AudioToolbox.raw' file
    ?fixed-todo? Entry '!missing-pinvoke! AudioSessionSetActiveWithFlags is not bound' in 'MacCatalyst-AudioToolbox.todo' is not found in corresponding 'MacCatalyst-AudioToolbox.raw' file
    ?fixed-todo? Entry '!missing-pinvoke! AudioSessionSetProperty is not bound' in 'MacCatalyst-AudioToolbox.todo' is not found in corresponding 'MacCatalyst-AudioToolbox.raw' file
    ?fixed-todo? Entry '!missing-enum! NSTextWritingDirection not bound' in 'MacCatalyst-UIKit.todo' is not found in corresponding 'MacCatalyst-UIKit.raw' file
    Sanity check failed (8)
    make: *** [classify] Error 8
2021-04-21 15:11:35 -04:00
VS MobileTools Engineering Service 2 78e62f8564
[main] [xcode12.5] Bump for Xcode 12.5 RC (#11263)
and add the few new bindings added in the SDKs
2021-04-21 15:07:17 -04:00
Rolf Bjarne Kvinge a026aa71b3
Make the quiet version of 'dotnet build' quieter. (#11240)
Ref: https://github.com/dotnet/sdk/issues/7986#issuecomment-604959822
2021-04-20 21:38:37 +02:00
dotnet-maestro[bot] e8f437319a
[main] Update dependencies from dotnet/installer (#11175)
* Update dependencies from https://github.com/dotnet/installer build 20210408.1

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-preview.3.21202.5 -> To Version 6.0.100-preview.4.21208.1

* Update dependencies from https://github.com/dotnet/installer build 20210409.4

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-preview.3.21202.5 -> To Version 6.0.100-preview.4.21209.4

* Update dependencies from https://github.com/dotnet/installer build 20210410.1

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-preview.3.21202.5 -> To Version 6.0.100-preview.4.21210.1

* same P4 specific fix as ccb43cba56
but the ICU support was added based on P3 but merged after ^

* Update dependencies from https://github.com/dotnet/installer build 20210412.5

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-preview.3.21202.5 -> To Version 6.0.100-preview.4.21212.5

* Update dependencies from https://github.com/dotnet/installer build 20210413.70

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-preview.3.21202.5 -> To Version 6.0.100-preview.4.21213.70

* Update dependencies from https://github.com/dotnet/installer build 20210414.14

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-preview.3.21202.5 -> To Version 6.0.100-preview.4.21214.14

* Update to new package names

Thanks @pjcollins for the heads up https://github.com/xamarin/xamarin-macios/pull/11175#issuecomment-819936692

* Update dependencies from https://github.com/dotnet/installer build 20210415.1

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-preview.3.21202.5 -> To Version 6.0.100-preview.4.21215.1

* Fix build (path changed to include '.mono')

* remove more '.mono' special case that are not needed anymore

* Update dependencies from https://github.com/dotnet/installer build 20210415.12

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-preview.3.21202.5 -> To Version 6.0.100-preview.4.21215.12

* Fix building apps (it now finds the native libs)

Credits to @filipnavara

8325f8dadc

* Add back IsTrimmable (or nothing gets linked)

* Update dependencies from https://github.com/dotnet/installer build 20210418.6

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-preview.3.21202.5 -> To Version 6.0.100-preview.4.21218.6

* Keep downloading the CoreCLR runtime packs.

* [runtime] Adjust the build to link with the correct runtime library for CoreCLR.

* [tests][monotouch-test] Ignore NSTimeZoneTest / All_28300 on dotnet as it hangs

Introduced with https://github.com/dotnet/runtime/pull/48931

Issue https://unicode-org.atlassian.net/browse/ICU-21591
PR https://github.com/unicode-org/icu/pull/1699

* [dotnet][msbuild] Add more (missing) '\'

Fix satellite/location assemblies and some unit tests

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: Sebastien Pouliot <sebastien.pouliot@microsoft.com>
Co-authored-by: Sebastien Pouliot <sebastien.pouliot@gmail.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-04-20 09:09:56 -04:00
Sebastien Pouliot 7d2b389ae6
[maccatalyst] Increase iOS compatibility by removing `XAMCORE_3_0` (#11238)
`XAMCORE_3_0` was added in tvOS and watchOS where binary compatibility
was not a consideration. The work to update source code for `XAMCORE_3_0`
was also minimal.

The former is not the always the case for MacCatalyst, while the latter
is still true.

Fix https://github.com/xamarin/xamarin-macios/issues/11237 and https://github.com/xamarin/xamarin-macios/issues/11236
2021-04-20 08:59:37 -04:00
Rolf Bjarne Kvinge 9a0cd6182b
[introspection] Add/fix/remove availability attributes for Mac Catalyst to make introspection's Introduced test pass. (#10587)
Co-authored-by: Sebastien Pouliot <sebastien.pouliot@microsoft.com>
2021-04-13 15:48:20 -04:00
Sebastien Pouliot 05aa0c8aa8
[tests][introspection] Report error if no version is present in [SupportedOSPlatformAttribute] (#11193)
Otherwise a `[SupportedOSPlatformAttribute ("ios12,3")]` (should be a
dot, not a comma) would throw a `NullReferenceException` making it
harder to track down the error
2021-04-12 14:56:06 -04:00
Sebastien Pouliot 4e48aa2ae1
[generator][dotnet] Add support for `[Uns|S]upportedOSPlatformAttribute` (#10580)
This moves our current/legacy attributes to the ones added in dotnet 5 [1].

Short Forms (only in bindings)

| Old                                   | New                                 |
|---------------------------------------|-------------------------------------|
| [iOS (7,0)]                           | [SupportedOSPlatform ("ios7.0")]    |
| [NoIOS]                               | [UnsupportedOSPlatform ("ios")]     |

Long Forms

| Old                                   | New                                 |
|---------------------------------------|-------------------------------------|
| [Introduced (PlatformName.iOS, 7,0)]  | [SupportedOSPlatform ("ios7.0")]    |
| [Obsoleted (PlatformName.iOS, 12,1)]  | [Obsolete (...)]                    |
| [Deprecated (PlatformName.iOS, 14,3)] | [UnsupportedOSPlatform ("ios14.3")] |
| [Unavailable (PlatformName.iOS)]      | [UnsupportedOSPlatform ("ios")]     |

Other changes

* `[SupportedOSPlatform]` and `[UnsupportedOSPlatform]` are not allowed on `interface` [2] which means they cannot be used for protocols. This is currently handled by inlining the existing attributes on all members.
* `[ObsoletedInOSPlatform]` was removed in net5 RC. This PR is now mapping the existing attributes to `[Obsolote]`, however multiple ones cannot be added so they need to be platform specific.

Remaining work (manual bindings update) tracked in https://github.com/xamarin/xamarin-macios/issues/11055

References

* [1] https://github.com/xamarin/xamarin-macios/issues/10170
* [2] https://github.com/dotnet/runtime/issues/47599
* [3] https://github.com/dotnet/runtime/issues/47601
2021-04-10 11:09:14 -04:00
Sebastien Pouliot a9251bb9ae
Bump MSBuild.StructuredLogger to 2.1.404 (#11182)
Required to bump dotnet runtime to preview 4 as the binary log format
was updated (and this affects our ability to run some tests)

https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/device-tests/20210407.33/4632319/sim/;/tests/vsdrops_index.html
2021-04-09 19:58:28 -04:00
Sebastien Pouliot f85af095da
[dotnet] Add ICU support for iOS builds (#11163)
and re-enable some tests for dotnet

Part of the fix for https://github.com/xamarin/xamarin-macios/issues/8906

Known Issues
* [some Calendar are not the expected ones](https://github.com/dotnet/runtime/issues/50859)
* [No support for tvOS (bitcode)](https://github.com/dotnet/runtime/issues/48508)
2021-04-09 17:06:26 -04:00
Alex Soto 225ad67175 [monotouch-tests] Disable dotnet MacCat tests for now since they hang in BS 2021-04-08 23:11:24 -04:00
Alex Soto 360bb93c5e [monotouch-tests] Disable MacCat tests for now since they hang in BS 2021-04-08 17:55:55 -04:00
Alex Soto 8b926000a6
Merge branch 'main' into alex-xcode12.5-main 2021-04-08 17:42:32 -04:00
Sebastien Pouliot 99892d79f9
[tests] Revert manual preservation of InternalsVisibleToAttribute.ctor(string) (#11160)
The issue https://github.com/mono/linker/issues/1913 was fixed a while ago.
2021-04-08 13:01:35 -04:00
Sebastien Pouliot 4e5f5fe030
[tests[ Add app bundle size comparison between legacy and dotnet (#11149)
Based on Rolf's earlier work [1] and a copy of my `app-compare` code [2]

[1] https://github.com/rolfbjarne/xamarin-macios/tree/dotnet-size-comparison-helloworld
[2] https://github.com/spouliot/dotnet-tools/tree/master/app-compare
2021-04-07 16:10:40 -04:00
Alex Soto 2b499743c6 [monotouch-tests] Ignore CheckAddressBookPermission for MacCat 2021-04-07 12:55:04 -04:00