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

16864 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 9c87bfd008
[ObjCRuntime] Throw a more descriptive InvalidCastException when failing to create an instance of the appropriate type in Runtime.CreateNSObject. (#19629)
This will hopefully give more information for this random failure:

```
'System.InvalidCastException', reason: 'Arg_InvalidCastException (System.InvalidCastException)
   at ObjCRuntime.Runtime.ConstructNSObject[NSDictionary](IntPtr , Type , MissingCtorResolution , IntPtr , RuntimeMethodHandle )
   at ObjCRuntime.Runtime.GetNSObject[NSDictionary](IntPtr , IntPtr , RuntimeMethodHandle , Boolean )
   at ObjCRuntime.Runtime.GetNSObject[NSDictionary](IntPtr , IntPtr , RuntimeMethodHandle )
   at ObjCRuntime.Runtime.GetNSObject[NSDictionary](IntPtr )
   at CoreFoundation.CFNotificationCenter.NotificationCallback(IntPtr centerPtr, IntPtr observer, IntPtr name, IntPtr obj, IntPtr userInfo)
```

Ref: https://github.com/xamarin/maccore/issues/2633
2023-12-18 14:24:24 +01:00
Rolf Bjarne Kvinge eddde6007b
[tests] Fix certificate tests after Apple started blocking the Thawte certificate. (#19650)
The “Thawte SGC CA” certificate we're using for testing is now blocked by
Apple, evaluating trust results in this error:

> “Thawte SGC CA” certificate is blocked

So update the mail_google_com certificates to what mail.google.com serves now, and also update the corresponding parent certificates (which have changed).

Then adjust the tests accordingly.

Finally delete all unused certificates from the code.

Fixes these test failures:

    MonoTouchFixtures.Security.TrustTest
        [FAIL] Trust_FullChain :   GetTrustResult-2
            Expected: RecoverableTrustFailure
            But was:  FatalTrustFailure
               at MonoTouchFixtures.Security.TrustTest.Trust_FullChain(SecTrust trust, SecPolicy policy, X509CertificateCollection certs) in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/Security/TrustTest.cs:line 389
               at MonoTouchFixtures.Security.TrustTest.Trust_FullChain() in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/Security/TrustTest.cs:line 321
        [FAIL] Trust2_FullChain :   GetTrustResult-2
            Expected: RecoverableTrustFailure
            But was:  FatalTrustFailure
               at MonoTouchFixtures.Security.TrustTest.Trust_FullChain(SecTrust trust, SecPolicy policy, X509CertificateCollection certs) in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/Security/TrustTest.cs:line 389
               at MonoTouchFixtures.Security.TrustTest.Trust2_FullChain() in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/Security/TrustTest.cs:line 449
2023-12-18 14:13:53 +01:00
Rolf Bjarne Kvinge fc1772bdc5
[msbuild] Merge the DSymUtil[TaskBase] classes. (#19643) 2023-12-15 19:01:32 +01:00
Rolf Bjarne Kvinge 838428b02d
[msbuild] Merge the CreatePkgInfo[TaskBase] classes. (#19642) 2023-12-15 19:01:24 +01:00
Rolf Bjarne Kvinge 8c6f07e6ef
[msbuild] Merge the CreateInstallerPackage[TaskBase] classes. (#19641) 2023-12-15 19:01:14 +01:00
Rolf Bjarne Kvinge b60ee772c2
[Foundation] NSArray<T>.FromNSObjects will never return null objects. Fixes #19622. (#19627)
NSArray<T>.FromNSObjects will never return a null object, because
NSArray.FromObjects won't (according to Apple's headers).

Fixes https://github.com/xamarin/xamarin-macios/issues/19622.
2023-12-15 09:37:51 +01:00
Rolf Bjarne Kvinge 0a4e51c7ac
Bump Touch.Unit and MonoTouch.Dialog. (#19590)
New commits in migueldeicaza/MonoTouch.Dialog:

* migueldeicaza/MonoTouch.Dialog@5898074 [MonoTouch.Dialog] Use 'BundledNETCoreAppTargetFrameworkVersion' in TargetFramework to avoid having to bump every year.

Removed commits from migueldeicaza/MonoTouch.Dialog:

* migueldeicaza/MonoTouch.Dialog@f500f9a Bump to .NET 8.

Diff: f500f9a48d..5898074d6e

New commits in spouliot/Touch.Unit:

* spouliot/Touch.Unit@92a0726 [Touch.Client] Use 'BundledNETCoreAppTargetFrameworkVersion' in TargetFramework to avoid having to bump every year.
* spouliot/Touch.Unit@afbf9d4 [Touch.Client] Silence numerous warnings about using native API too early, where it's not supported, or when obsoleted.
* spouliot/Touch.Unit@455abcd Bump to .NET 8.
* spouliot/Touch.Unit@2316d4a [NUnitLite] Fix a few warnings in .NET for TouchRunner.

Removed commits from spouliot/Touch.Unit:

* spouliot/Touch.Unit@5739ade Bump to .NET 8.

Diff: 5739adefc2..92a072683b
2023-12-15 09:17:38 +01:00
dotnet-maestro[bot] 609fe83c82
[main] Update dependencies from dotnet/installer (#19636)
This pull request updates the following dependencies

## From https://github.com/dotnet/installer

- **Subscription**: 80cb9ffd-f92f-4fc8-9f8b-08dbca46abfb
- **Build**: 20231213.4
- **Date Produced**: December 13, 2023 7:17:37 PM UTC
- **Commit**: daa880ab595bd66269944e69da54fc992908164e
- **Branch**: refs/heads/release/8.0.1xx

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.101-servicing.23578.14 to 8.0.101-servicing.23613.4][1]

[1]: 822071c28a...daa880ab59
2023-12-15 08:56:47 +01:00
Rolf Bjarne Kvinge 233b01accc
[msbuild] Merge the CreateEmbeddedResources[TaskBase] classes. (#19631) 2023-12-14 17:20:46 +01:00
Rolf Bjarne Kvinge afd8d23da5
[msbuild] Merge the CreateDebugSettings[TaskBase] classes. (#19630) 2023-12-14 17:20:35 +01:00
Rolf Bjarne Kvinge 1dff5d1154
[msbuild] Merge the CreateDebugConfiguration[TaskBase] classes. (#19615) 2023-12-14 17:20:20 +01:00
Rolf Bjarne Kvinge eb80f66b6a
[tests] Improve detection of network problems to better ignore tests in case of network problems. (#19594)
* Add basic logic to detect network problems for NSErrors.
* Include better logging of NSError failures in the UrlConnectionTest.SendSynchronousRequest test.
* Misc code cleanup.
2023-12-14 15:53:13 +01:00
Rolf Bjarne Kvinge cf398ed770
[dotnet] Compute the path to the Xamarin SDK root as a relative path to .NET's root directory. (#19404)
This is useful to compute the path to the Mac's Xamarin SDK from Windows: we
can compute the relative path on Windows, and then just prepend the Mac's path
to .NET.
2023-12-14 15:16:36 +01:00
Rolf Bjarne Kvinge c59ee63e3f
[bgen] Fix assembly comparison. Fixes #19612. (#19619)
This fixes a regression in .NET 8, where we changed the temporary assembly name when
building using a project file / MSBuild - we started compiling the temporary binding
code in MSBuild instead of in the generator, and in the process we changed the name
of the temporary assembly. This broke logic in bgen that compared the assembly name
to check if a given type is from the temporary assembly or not.

Fix this by checking the actual temporary assembly instead of the name of the assembly
instead.

Fixes https://github.com/xamarin/xamarin-macios/issues/19612.
2023-12-14 15:15:01 +01:00
Rolf Bjarne Kvinge 5d4bff54b0
[AppKit] Make NSGraphics.NSBestDepth P/Invoke blittable. (#19614)
Also introduce a few other improvements:

* Add an varation that takes an 'out bool' instead of a 'ref bool'. According
  to the documentation the value is out-only.
* Name this variation according to our guidelines (with a verb).
* Deprecate the old version.

Contributes towards https://github.com/xamarin/xamarin-macios/issues/15684.
2023-12-13 12:55:25 +01:00
Rolf Bjarne Kvinge 8eb8788c5f
[msbuild] Use a single generated versions file for all platforms. (#19593)
This is a step (among many) towards merging the iOS and Mac task assemblies
into a single assembly, which would simplify and speed up our build quite a bit.
2023-12-13 12:52:47 +01:00
Rolf Bjarne Kvinge ad4c5c5a72
[tests] Fix detecting the runtime identifier for macOS tests executed on the command line. (#19592) 2023-12-13 12:52:29 +01:00
Rolf Bjarne Kvinge b367db52f2
[msbuild] Merge the CoreMLCompiler[TaskBase] classes. (#19588) 2023-12-13 12:52:15 +01:00
dotnet-maestro[bot] d5b31ea7c0
[main] Update dependencies from dotnet/xharness (#19617)
This pull request updates the following dependencies

## From https://github.com/dotnet/xharness

- **Subscription**: 601bc5e1-1cae-44b5-cf5f-08db9342aa2f
- **Build**: 20231206.1
- **Date Produced**: December 6, 2023 2:37:38 PM UTC
- **Commit**: b058fd28cbd724817c21efee85bb34effb5d2c14
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.DotNet.XHarness.iOS.Shared**: [from 9.0.0-prerelease.23577.1 to 9.0.0-prerelease.23606.1][1]

[1]: c1238c2118...b058fd28cb
2023-12-13 12:38:26 +01:00
Manuel de la Pena 7ad1837e7d
[Metal] Add support for Xcode15. (#19379)
This PR brings all the changes from the new Metal APIs. During the
review pay special attention to the changes done in the Protocols in
order to add tvOS support.

The main problem we have had doing this PR is that tvOS was not done on
time before the NET branching, that left us with a lot of memebers that
were NOT added in tvOS that are abstract on dotnet, which has left use
in a pickle.

Lets use the following code as an example.

Code found before this commit:

```csharp
	[Mac (11, 0), iOS (14, 0), NoTV]
	[MacCatalyst (14, 0)]
#if NET
	[Abstract]
#endif
	[Export ("accelerationStructureCommandEncoder")]
	IMTLAccelerationStructureCommandEncoder CreateAccelerationStructureCommandEncoder ();
```

A naive approach would be to add just the tvOS suppor as follows:

```csharp
	[Mac (11, 0), iOS (14, 0), TV (16,0)]
	[MacCatalyst (14, 0)]
#if NET
	[Abstract]
#endif
	[Export ("accelerationStructureCommandEncoder")]
	IMTLAccelerationStructureCommandEncoder CreateAccelerationStructureCommandEncoder ();
```

The above change represents and API braking change on the donet tvOS dll
because it adds a new Abstrtact members, so this is no an acceptable
solution.

There is a second naive approach we can take which is as follows:

```csharp
	[Mac (11, 0), iOS (14, 0), TV (16,0)]
	[MacCatalyst (14, 0)]
#if NET &!TVOS
	[Abstract]
#endif
	[Export ("accelerationStructureCommandEncoder")]
	IMTLAccelerationStructureCommandEncoder CreateAccelerationStructureCommandEncoder ();
```

Yet again, the naive approach has an issue with it. In this case, all
the extension methods that are generated for tvOS (something the
generator writes when methods are not abstract) will be decorated with
availability attributes for all the other platforms, which is incorrect
and will make developers life worse.

That leaves us with the following approach:

```csharp
#if NET
#if !TVOS
	[Mac (11, 0), iOS (14, 0), NoTV, MacCatalyst (14, 0)]
	[Abstract]
#else
	[NoMac, NoiOS, TV (16,0), NoMacCatalyst]
#endif
#else
	[Mac (11, 0), iOS (14, 0), TV (16,0), MacCatalyst (14, 0)]
#endif
	[Export ("accelerationStructureCommandEncoder")]
	IMTLAccelerationStructureCommandEncoder CreateAccelerationStructureCommandEncoder ();
```

With the above change, we do not add an abstract method in tvOS and we
only add the tvOS abailabity attribute to the extension methods, and use
NoiOS etc for all the other platforms.

The change had to be done to ALL methods that added tvOS support. The
good news are that our cecil tests and our introspection tests catch the
two naive approaces :)

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Haritha Mohan <harithamohan@microsoft.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
2023-12-12 17:39:56 -05:00
Manuel de la Pena 5cac237b84
[CI] Ensure that the new dependencies are correcly managed. (#19621) 2023-12-11 22:16:43 -05:00
Manuel de la Pena 1173c016b7
[Generator] Allow to have a way to attach to the generator. (#19565)
As soon as we moved to have a build of the generator that used dotnet we
opened the door to a number of developer life improvements. The very
first one of those is the poissibility to attach the dotnet debugger to
the bgen process and that way be able to debug.

In order to do that, this PR has changed two small things:

1. Added code in the main method of the generator that will block the
tool until a debugger is attached.
2. Changed the csproj to add the previously mentioned code only when the
enviroment variable XAMMACIOS_DEBUGGER is set. This way the code does
not reach our customers.

A README has been added explaining how to debug the processes via Visual
Studio. Any other IDE that support the dotnet debugger can be used this
way.

<img width="1075" alt="Screenshot 2023-12-03 at 19 10 18"
src="https://github.com/xamarin/xamarin-macios/assets/2190086/dbafc570-7c43-419f-977e-ace66f5561ac">

---------

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2023-12-11 11:58:15 -05:00
Rolf Bjarne Kvinge d4c6cfca7a
[msbuild] Merge the CreateAssetPackManifest[TaskBase] classes. (#19589) 2023-12-11 09:57:14 +01:00
Rolf Bjarne Kvinge eb973ea0d6
Bump mlaunch. (#19585)
Related new commits in xamarin/maccore:

* xamarin/maccore@39a7e52166 [mlaunch] Show all output from a failing devicectl command.
* xamarin/maccore@f29148cb58 [mlaunch] Add support for killing apps on device using devicectl. Fixes #xamarin/xamarin-macios@19577.
* xamarin/maccore@632997797a [mlaunch] Fix launching apps on device using a bundle id when using devicectl.

Diff: 699ed5eaf2..39a7e52166
2023-12-11 08:49:50 +01:00
Rolf Bjarne Kvinge c2c5140a6c
Update DOWNLOADS.md with new releases. (#19595) 2023-12-11 08:47:13 +01:00
Manuel de la Pena 5cca8aa1cf
[CoreMidi] Add CoreMidi enums to Watch so that we can have them for avfoundation. (#19580)
Similar to https://github.com/xamarin/xamarin-macios/pull/19529 we need
this for all the avfoundation to be landed.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2023-12-07 12:32:32 -05:00
Rolf Bjarne Kvinge 9851502e74
[CoreBluetooth] Fix a typo in CBPeripheralDelegate.DiscoveredService for XAMCORE_5_0. (#19582) 2023-12-07 10:43:03 +01:00
Rolf Bjarne Kvinge d4e49a53d2
[xharness] Fix a few minor code issues + wrong copyright. (#19583) 2023-12-07 08:05:39 +01:00
Rolf Bjarne Kvinge cce2510e3e
[msbuild] Merge the CompileSceneKitAssets[TaskBase] classes. (#19573) 2023-12-06 20:57:44 +01:00
Rolf Bjarne Kvinge 57c919e0af
[msbuild] Merge the ComputeCodesignItems[TaskBase] classes. (#19575) 2023-12-06 20:57:37 +01:00
Rolf Bjarne Kvinge 274e892967
[msbuild] Merge the ComputeRemoteGeneratorProperties[TaskBase] classes. (#19576) 2023-12-06 20:57:29 +01:00
Michael Cummings (MSFT) 787779ee35
Centralize AgentPoolSelector (#19546)
Following #19491 , this change moves the AgentPoolSelector to the Config
stage since it is deterministic per build.
2023-12-06 14:22:48 -05:00
Rolf Bjarne Kvinge eb3c561e7b
[msbuild] Parse --nowarn and --warnaserror from MtouchExtraArgs for .NET. (#19540) 2023-12-06 17:27:17 +01:00
Rolf Bjarne Kvinge 107d644b55
[xharness] Convert to .NET. (#19541)
* Convert xharness.csproj and Xharness.Tests.csproj to .NET/sdk-style projects.
* Fix numerous nullability issues that came up.
* Adjust Make logic to do the correct thing now that the executable is named differently.
* Port usage of WebClient to HttpClient, since WebClient is deprecated.
* Find an alternative solution to System.Web.MimeMapping.GetMimeMapping, which
  doesn’t exist in .NET.
* Fix misc other warnings and errors.
2023-12-06 15:57:12 +01:00
Michael Cummings (MSFT) dc11aa98b2 Move AgentPoolSelector to configure_build stage 2023-12-06 12:51:15 +00:00
Michael Cummings (MSFT) f30043647f
Add config stage for CI (#19491) 2023-12-06 07:47:17 -05:00
Rolf Bjarne Kvinge 9bef443d92
[builds] Create Versions.plist/buildinfo for .NET independently of the legacy Xamarin versions. (#19534)
This is one small step towards removing legacy Xamarin one day, since it
removes .NET logic that depends on legacy Xamarin logic.
2023-12-05 15:54:56 +01:00
Rolf Bjarne Kvinge ec64aa504c
[src] Update dependencies of bgen.csproj to not use the dependencies of generator.csproj. (#19572)
They're not quite the same, and in any case this decouples a .NET
project from a legacy Xamarin project, which is good long-term.
2023-12-05 15:53:54 +01:00
dotnet-maestro[bot] f5fe7bf9af
[main] Update dependencies from dotnet/xharness (#19570)
This pull request updates the following dependencies

## From https://github.com/dotnet/xharness

- **Subscription**: 601bc5e1-1cae-44b5-cf5f-08db9342aa2f
- **Build**: 20231127.1
- **Date Produced**: November 27, 2023 6:13:19 PM UTC
- **Commit**: c1238c21187506a3539e09ac9eba582a1fd7a74d
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.DotNet.XHarness.iOS.Shared**: [from 9.0.0-prerelease.23570.2 to 9.0.0-prerelease.23577.1][1]

[1]: 38841f0f33...c1238c2118
2023-12-05 14:02:04 +01:00
Michael Cummings (MSFT) 10691ca38d Remove commented code 2023-12-05 12:57:22 +00:00
Michael Cummings (MSFT) b5756a160c
Merge branch 'main' into config-as-stage 2023-12-05 06:18:18 -05:00
Michael Cummings (MSFT) ec3766a9bf
Add --ignore-unknown-params (#19456)
* fail if there are unknown parameters and --ignore-unknown-params is
not provided
2023-12-04 22:19:24 -05:00
dustin-wojciechowski 89c0016742
[Generator] New LibraryManager for BindingTouch (#19479)
This PR introduces the LibraryManager and LibraryInfo and integrates them into BindingTouch.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2023-12-04 12:26:36 -08:00
Rolf Bjarne Kvinge 1ddc0b4b74
Get Mono.Cecil from NuGet everywhere. (#19535)
Also:

* Store the version in Directory.Build.props, which makes it much easier to update.
* Bump all versions to latest (0.11.5).
2023-12-04 20:15:03 +01:00
Rolf Bjarne Kvinge a9c9598820
[msbuild] Detect any dylibs in NativeReferences. Fixes #19520. (#19560)
We add the dylib location as an rpath if the app has any location, so make
sure to correctly detect dylibs in native references.

Fixes https://github.com/xamarin/xamarin-macios/issues/19520.
2023-12-04 20:11:20 +01:00
Manuel de la Pena a70718e612 Corrent ouput variable. 2023-12-04 12:56:09 -05:00
Rolf Bjarne Kvinge c6ebdd3bf2
[msbuild] Merge the ComputeBundleResourceOutputPaths[TaskBase] classes. (#19552) 2023-12-04 18:31:17 +01:00
Rolf Bjarne Kvinge 70874e2275
[msbuild] Merge the ComputeBundleLocation[TaskBase] classes. (#19551) 2023-12-04 18:31:06 +01:00
Rolf Bjarne Kvinge 45f6ceb8ed
[msbuild] Merge the CompileProductDefinition[TaskBase] classes. (#19548) 2023-12-04 18:30:39 +01:00
Rolf Bjarne Kvinge b09ac67cfc
[tests] Ignore network-related failures in UrlConnectionTest.SendSynchronousRequest. (#19567) 2023-12-04 17:03:43 +01:00