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

17320 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 76cef6cc7d
[Blocks] Remove a block callback validation that's apparently too eager. (#20625)
The validation verifies that the function pointer for a block callback is the
same the return value from the method's
MethodInfo.MethodHandle.GetFunctionPointer() method.

In actual code, it's equivalent to validating that the following always prints "Equal: true":

```cs
[UnmanagedCallersOnly]
public static void Invoke () {}

static void Test ()
{
    delegate* unmanaged<void> fptr1 = &Invoke;
    IntPtr fptr2 = GetType ().GetMethod ("Invoke").MethodHandle.GetFunctionPointer ();
    Console.WriteLine ($"fptr1: 0x{((IntPtr) fptr1).ToString ("x")}");
    Console.WriteLine ($"fptr2: 0x{fptr2.ToString ("x")}");
    Console.WriteLine ($"Equal: ((IntPtr) fptr1) == fptr2}"); // prints "Equal: true" for me
}
```

However, this isn't documented, and some feedback indicates it's certainly not
a valid assumption for CoreCLR:

https://discord.com/channels/732297728826277939/732582981163548703/1242473425759633488

And there's also a customer running into this validation, apparently without cause:
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2054534

So just remove it.
2024-05-23 10:22:54 +02:00
Rolf Bjarne Kvinge 0f91fcdfbc
[cecil-tests] Fix assertion message to use the doc id instead of the typename of a tuple. (#20632)
So instead of this:

> Cecil.Tests.Documentation+AssemblyApi: Documented API not found in the platform assembly. This probably indicates that the code to compute the doc name for a given member is incorrect.

we'll get:

> T:Foundation.SomeType: Documented API not found in the platform assembly. This probably indicates that the code to compute the doc name for a given member is incorrect.
2024-05-23 10:22:06 +02:00
Rolf Bjarne Kvinge 26e6bb82e2
[devops] Look in the correct directory for the API diff results. (#20624)
Fixes this failure:

> 🔥 Unable to find the contents for the comment: D:\a\1\a\change-detection\results\gh-comment.md does not exist :fire

This is a partial revert of #20601, which broke the API diff.
2024-05-23 08:10:03 +02:00
Rolf Bjarne Kvinge a9b23141fd
[AudioUnit] Make P/Invokes in AudioUnit.cs have blittable signatures. (#20620)
Contributes towards #15684.
2024-05-23 08:07:43 +02:00
Rolf Bjarne Kvinge 6f61face84
[Security] Make remaining P/Invokes have blittable signatures. (#20618)
Contributes towards #15684.
2024-05-23 08:07:36 +02:00
dotnet-maestro[bot] e549986a06
[main] Update dependencies from dotnet/installer (#20630)
This pull request updates the following dependencies

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

- **Subscription**: 80cb9ffd-f92f-4fc8-9f8b-08dbca46abfb
- **Build**: 20240521.26
- **Date Produced**: May 22, 2024 12:58:20 AM UTC
- **Commit**: 127cf75b9cc63c95ede49d93daea49507b79d972
- **Branch**: refs/heads/release/8.0.1xx

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.107-servicing.24270.16 to 8.0.107-servicing.24271.26][1]

[1]: fdba15e12c...127cf75b9c
2024-05-23 01:49:43 +02:00
dotnet-maestro[bot] e52af40a99
[main] Update dependencies from dotnet/xharness (#20599)
This pull request updates the following dependencies

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

- **Subscription**: 601bc5e1-1cae-44b5-cf5f-08db9342aa2f
- **Build**: 20240506.1
- **Date Produced**: May 6, 2024 1:53:56 PM UTC
- **Commit**: 62a8662088425e03f7ba44a4ec817c198e38d0f9
- **Branch**: refs/heads/main

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

[1]: 53a781a352...62a8662088
2024-05-22 14:46:25 +02:00
Matt Sylvia b05cac883f
Update OneLocBuildToken (#20627)
Update the token in the Localization step to one backed by a managed identity

---------

Co-authored-by: Matt Sylvia <msylvia@microsoft.com>
2024-05-22 14:40:41 +02:00
Rolf Bjarne Kvinge 56e2e47de5
[devops] Clean up temporary files to fix api diff. (#20619)
API diff currently fails with:

	** Error: Working directory isn't clean:
	HEAD detached at origin/pull/20587/head
	Untracked files:
	(use "git add <file>..." to include in what will be committed)
	tmp.txt

So clean up after ourselves in a previous step to avoid this.
2024-05-22 10:35:42 +02:00
dotnet-maestro[bot] 37591c762f
[main] Update dependencies from dotnet/installer (#20551)
This pull request updates the following dependencies

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

- **Subscription**: 80cb9ffd-f92f-4fc8-9f8b-08dbca46abfb
- **Build**: 20240520.16
- **Date Produced**: May 20, 2024 10:56:15 PM UTC
- **Commit**: fdba15e12c3d5592c7362fbb6db83cbd906f9130
- **Branch**: refs/heads/release/8.0.1xx

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.105-servicing.24216.7 to 8.0.107-servicing.24270.16][37]
  - **Microsoft.NET.ILLink.Tasks**: [from 8.0.4 to 8.0.5][38]
  - **Microsoft.AspNetCore.App.Ref**: [from 8.0.4 to 8.0.5][39]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.4 to 8.0.5][38]
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100**: [from 8.0.4 to 8.0.5][40]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.4 to 8.0.5][38]

[37]: 79797800a3...fdba15e12c
[38]: https://dev.azure.com/dnceng/internal/_git/dotnet-runtime/branches?baseVersion=GC2d7eea252964e69be94cb9c847b371b23e4dd470&targetVersion=GC087e15321bb712ef6fe8b0ba6f8bd12facf92629&_a=files
[39]: https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore/branches?baseVersion=GC8486d31e24f30e3fa1809a95699a0adc16f448d7&targetVersion=GCc9e3996173cec136bc2e9f3b4ec45f2a323b1d63&_a=files
[40]: 08a90ca2c8...71359b18c2

## Coherency Updates

The following updates ensure that dependencies with a *CoherentParentDependency*
attribute were produced in a build used as input to the parent dependency's build.
See [Dependency Description Format](https://github.com/dotnet/arcade/blob/master/Documentation/DependencyDescriptionFormat.md#dependency-description-overview)

- **Coherency Updates**:
  - **Microsoft.NET.ILLink.Tasks**: from 8.0.4 to 8.0.5 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.AspNetCore.App.Ref**: from 8.0.4 to 8.0.5 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NETCore.App.Ref**: from 8.0.4 to 8.0.5 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100**: from 8.0.4 to 8.0.5 (parent: Microsoft.NETCore.App.Ref)
  - **Microsoft.NETCore.App.Ref**: from 8.0.4 to 8.0.5 (parent: Microsoft.Dotnet.Sdk.Internal)
2024-05-21 19:56:42 +02:00
Rolf Bjarne Kvinge a76d4946e0
[tests] Correctly run the VerifyRemoteConnection target. (#20616)
There's no target named `SayHello`, the correct name is `_SayHello` (where we
establish a connection to the remote mac).
2024-05-21 11:04:22 +02:00
Rolf Bjarne Kvinge 5a5df07276
[msbuild] Show a better error with invalid app bundles due to Resources subdirectory. Fixes #20135. (#20593)
iOS (and presumably tvOS) app bundles can't contain a subdirectory named "Resources".

Apple says:

> Note: An iOS app bundle cannot include a custom folder named “Resources.”

Ref: https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW1

Unfortunately Apple's toolchain won't show a helpful error message, the
eventual failure is codesign saying something like this:

    bin/Release/net8.0-ios/ios-arm64/SomeApp.app: code object is not signed at all
    In subcomponent: bin/Release/net8.0-ios/ios-arm64/SomeApp.app/System.Security.Cryptography.aotdata.arm64

Which is confusing, to say the least.

After debugging this myself a few times, and seeing customers running into the
same issue periodically, it's time to make the error more actionable.

I've added code to our Codesign task to detect the "Resources" subdirectory,
and show a better error message. There's also a way to disable the validation
(by setting `CodesignDisallowResourcesSubdirectoryInAppBundle=false`), just in
case we end up being overeager with the validation.

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

---------

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2024-05-21 10:40:50 +02:00
Rolf Bjarne Kvinge c3cbab4439
[Security] Make P/Invokes in [Sec]Trust.cs have blittable signatures. (#20595)
Contributes towards #15684.

---------

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2024-05-21 09:53:59 +02:00
Rolf Bjarne Kvinge 8ebceb0486
[GitOps] Tell people using VSCode what to do when the move-to-vs-feedback label is applied. (#20613)
Also stop mentioning VSMac.

Ref: https://github.com/dotnet/maui/pull/22152
2024-05-21 09:33:44 +02:00
Rolf Bjarne Kvinge 6dc1f4c69b
[msbuild/dotnet] Automatically link with Swift's system libraries if a binding project has the IsSwift=true property. (#20546)
Add support for the LinkWithSwiftSystemLibraries metadata to specify whether a native library is a Swift library, in which case we'll automatically set the `LinkWithSwiftSystemLibraries` MSBuild property to `true`.

Also add a test.
2024-05-20 20:17:29 +02:00
Rolf Bjarne Kvinge d6ddfce412
[tests] Ignore trailing slashes in NativeReference items. Fixes #15430. (#20567)
A `*.framework/` native reference and a `*.framework` reference are the same
thing, so treat them the same. We accomplish this by removing any trailing
path separators (both windows style and non-windows-style for consistency)
before doing any processing.

Fixes https://github.com/xamarin/xamarin-macios/issues/15430.
2024-05-20 19:00:41 +02:00
Rolf Bjarne Kvinge 7e8e887d5d
[runtime] Throw exception for condition we don't handle in the dynamic registrar. (#20568)
Throw an exception for a condition we don't handle in the dynamic registrar:
calling a base Objective-C constructor (init method) with arguments. Our
current implementation to call the base Objective-C constructor doesn't handle
any arguments, so if the method actually takes any arguments, those will just
be random memory. In other words: a consistent exception is better than a
random invalid memory access.
2024-05-20 18:57:42 +02:00
Manuel de la Pena 8ea6cd6a66
[CI] Allow the windows tests to work on post build pipelines. (#20606) 2024-05-16 22:25:26 -04:00
Manuel de la Pena 9d73bde15b
[CI] Ensure that a manual trigger will work in the test pipelines. (#20608) 2024-05-16 06:54:47 -04:00
Manuel de la Pena 307bfaa3c4
[CI] Do not fail a build if we could not set the tags. (#20607) 2024-05-16 06:54:23 -04:00
Manuel de la Pena b477bac4b3
[CI] Use the cache from devops to try and reduce the amount of times we download mono (#20600)
We do more builds that we bump mono. Moving to a cache will reduce the
amount of network operations we need to do outside our data center. This
should reduce the time it takes to get the files as well as reduce the
number of network errors we get when accessing the mono download.
2024-05-15 21:50:14 -04:00
Manuel de la Pena cfcdacd779
[CI] Allow the postbuild pipelines to download the needed artifacts for the tests. (#20588)
This change allows the post build pipelines to download the artefacts generated by the build pipeline that triggered them. This way we can split builds from tests.
2024-05-15 15:36:54 -04:00
Manuel de la Pena 9b64421e48
[CI] Fix the API diff failing (#20601)
The API diff command fials due to the fact that it creates the comment
file inside sources, by moving the file to the artifacts staging
directory we fix the problem and ensure that the comment is removed
after each build.

Ps: I also fixed all the indentation issues in the file that were
reported by yamllint.
2024-05-15 06:27:08 -04:00
Rolf Bjarne Kvinge 35bcda3cf4
[devops] Improve GitHub comment when the build fails. (#20584)
Currently we get a message saying all the tests failed catastrophically.

Example:
https://github.com/xamarin/xamarin-macios/pull/20434#issuecomment-2100258803

This is both confusing and scary, so change the comment to say that the
build
failed instead.

---------

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2024-05-13 11:53:13 -04:00
Rolf Bjarne Kvinge ff9acb958b
[msbuild] Fix issue referencing static libraries from compressed xcframeworks. (#20585)
The code incorrectly assumed that the contents of a compressed
xcframework would
always be a framework, but this is incorrect (it can be a dynamic
library (.dylib),
static library (.a) or a framework (.framework).

Fix this by:

* Change variable and parameter names to clearly indicate that the
output from
  an xcframework is a native library.
* Unify code to handle metadata for native libraries from xcframeworks,
so that
the code isn't duplicated (or even worse, different) between compressed
and non-compressed
  xcframeworks.

The latter point fixes a problem where we'd compute the incorrect path
to the static
library inside a compressed xcframework.

PR #20546 contains a test case that triggers this.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2024-05-13 11:52:53 -04:00
Manuel de la Pena bc9575e756
[CI] Use the correct stage dependency for the simulator tests (#20589) 2024-05-09 16:27:42 -04:00
Rolf Bjarne Kvinge 3a4fe453f7
[Security] Make P/Invokes have in SslContext.cs blittable signatures. (#20582)
Contributes towards #15684.
2024-05-09 19:15:56 +02:00
Rolf Bjarne Kvinge c5f93a2061
[bgen] Add support for marking API bindings as preview APIs using the Experimental attribute. (#20591) 2024-05-09 18:54:08 +02:00
Rolf Bjarne Kvinge 4ba38c7224
[tests] Fix misc ARM64 issues when running legacy Xamarin tests. (#20592)
We've recently started using more and more ARM64 bots, so these tests are
failing in those cases.

Fixes:

    MonoTouchFixtures.Security.SecureTransportTest
    	[FAIL] SslSupportedCiphers :   3224092716
      Expected: True
      But was:  False
    		  at MonoTouchFixtures.Security.SecureTransportTest.SslSupportedCiphers () [0x000de] in <f08bd76ea2204d929c96e3bd36ae955a>:0

    Xamarin.Mac.Tests.EveryFrameworkSmokeTests
    	[FAIL] ExpectedLibrariesAreLoaded : QTKitLibrary (/System/Library/Frameworks/QTKit.framework/QTKit) failed to load but this was not expected
        		  at Xamarin.Mac.Tests.EveryFrameworkSmokeTests.ExpectedLibrariesAreLoaded () [0x000e6] in <f08bd76ea2204d929c96e3bd36ae955a>:0
2024-05-09 17:27:52 +02:00
Rolf Bjarne Kvinge f7cd129596
[Foundation] Use 'Foundation' as the namespace for NSUrlSessionHandler for all platforms. (#20581)
Use 'Foundation' as the namespace for NSUrlSessionHandler for all platforms
(so that we have the same API across all platforms).

But only in XAMCORE_5_0, since this is a breaking change.
2024-05-09 14:20:31 +02:00
Rolf Bjarne Kvinge af80672ae6
[tests] Fix detecting exposed members (#20577)
The enum value MethodAttributes.IsFamily is 'internal' in C#, which is not exposed
outside an assembly, so don't count such members as exposed. On the other hand, MethodAttributes.IsAssembly
is 'protected' in C#, which *is* exposed, so these members are included.

Update tests accordingly.
2024-05-09 13:21:14 +02:00
Manuel de la Pena 334bfb737e
[CI] Fix test that fail because the test libs are not found. (#20586) 2024-05-08 16:26:45 -04:00
Rolf Bjarne Kvinge feff95ccbb
[dotnet] Make the VB templates compile use models instead of protocol interfaces. (#20576)
VB doesn't support default interface members, and will show an error for all
unimplemented interface members, even if they have a default implementation.

This is a problem for the VB templates, because they make use of protocol
interfaces, which will soon have interface members with default
implementations.

In order to get around this, change the VB templates to use the model class
instead of the protocol interfaces.
2024-05-08 10:12:30 +02:00
Rolf Bjarne Kvinge 25357697e3
[dotnet] Throw an exception if the developer tries to use server garbage collection. Fixes #16853. (#20569)
Our runtime doesn't support server garbage collection:

https://github.com/xamarin/xamarin-macios/blob/main/runtime/coreclr-bridge.m#L203-L210

Fixes https://github.com/xamarin/xamarin-macios/issues/16853.
2024-05-08 09:38:19 +02:00
Rolf Bjarne Kvinge d1f577f684
[Security] Make P/Invokes in Certificate.cs have blittable signatures. (#20571)
Contributes towards #15684.
2024-05-08 09:37:45 +02:00
Manuel de la Pena 1ce1d31ade
[CI] Do not download all Artifacts. (#20541)
Do not download EVERYTHING and focus on those files we need. This makes
less network operations and makes the download easier to debug.
2024-05-07 18:06:46 -04:00
Rolf Bjarne Kvinge cf4df83ea5
Bump mlaunch. (#20572)
New commits in xamarin/maccore:

* xamarin/maccore@7dbab91212 [mlaunch] Bump to .NET 8.
* xamarin/maccore@79ae2e4e7e [Mlaunch] Create Vulcan ready files of mlaunch.
* xamarin/maccore@f8f70b23a4 [mlaunch] List devices as they're found in --listdev.

Diff: 39a7e52166..7dbab91212
2024-05-07 19:48:37 +02:00
Manuel de la Pena 2df008a106
[CI] Fix mac tests on post build pipeline (#20543)
To be able to download a artifact from a build that triggered the post
build pipeline we cannot use the DownloadPipelineArtifact task with the
same values since the artifact wont be found. This change adds an if
statement to do the right thing based on the trigger so that we can have
both pipelines running correctly until we remove the tests from the
build.

---------

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2024-05-07 11:55:38 -04:00
Rolf Bjarne Kvinge 6d137cbeb2
[AudioUnit] Remove unnecessary MarshalAs attributes from the AudioComponentDescription struct. (#20565)
This makes any P/Invokes that uses this struct have a blittable signature.

Contributes towards #15684.
2024-05-07 11:15:06 +02:00
Rolf Bjarne Kvinge b4c06d7d19
[bgen] Generate xml documentation for the extension class we generate for protocols. (#20564)
This was mostly copied from the existing API documentation.

Partial fix for https://github.com/xamarin/xamarin-macios/issues/20270.
2024-05-07 09:36:57 +02:00
Rolf Bjarne Kvinge 777dc0278b
[msbuild] Fix duplicated property declaration. (#20549)
This looks like an incorrect merge conflict resolution: the property
_UnpackLibraryResourcesDependsOn was declared twice, the second time
overwriting the first.

Pick the first declaration, since it's the newest and more complete one
(70a5d0d09a).
2024-05-07 09:36:45 +02:00
Rolf Bjarne Kvinge acaefac17f
[msbuild] Make the IBTool task nullable. (#20550) 2024-05-07 09:36:32 +02:00
dotnet-maestro[bot] 06a06ec5ba
[main] Update dependencies from dotnet/xharness (#20566)
This pull request updates the following dependencies

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

- **Subscription**: 601bc5e1-1cae-44b5-cf5f-08db9342aa2f
- **Build**: 20240502.1
- **Date Produced**: May 2, 2024 6:10:03 PM UTC
- **Commit**: 53a781a352194650f998d3056a514571937b26e5
- **Branch**: refs/heads/main

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

[1]: ec633d9ddb...53a781a352
2024-05-07 09:33:08 +02:00
Rolf Bjarne Kvinge 1916a1348f
[devops] Attempt to fix simulator runtimes disappearing. (#20559)
Attempt to fix simulator runtimes disappearing by:

* Detaching all the currently loaded runtimes.
* Killing the simdiskimaged and CoreSimulatorService services.

Hopefully this will make the simdiskimaged service restart, and reload the
simulator runtimes.
2024-05-06 14:25:42 +02:00
Youssef Victor cbb9537265
Make MidiPacket.ByteArray and MidiPacket.BytePointer public (#20540)
PR https://github.com/xamarin/xamarin-macios/pull/19705 obsoleted
`MidiPacket.Bytes` with obsoletion message that suggests to use internal
properties. This PR changes those properties to be public so that it's
actually usable.

---------

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2024-05-06 10:54:47 +02:00
Rolf Bjarne Kvinge f33afb191a
[devops] Print out the simulator runtime match list for debugging purposes. (#20558) 2024-05-06 09:49:05 +02:00
Rolf Bjarne Kvinge d15adeb752
[ObjCRuntime] Make P/Invokes have blittable signatures. (#20547)
Contributes towards #15684.
2024-05-06 09:06:32 +02:00
Rolf Bjarne Kvinge 350f597250
[runtime] Fix memory leak with BlockLiteral descriptors. Fixes #20503. (#20556)
We're using two different functions to atomically decrement a reference count,
the native `atomic_fetch_sub` and the managed `Interlocked.Decrement`.

Unfortunately the return value is not the same: `atomic_fetch_sub` returns the
original value before the subtraction, while `Interlocked.Decrement` returns
the subtracted value, while our code assumed the functions behaved the same.
This resulted in a memory leak, because we'd incorrectly expect `0` to be
returned from `atomic_fetch_sub` when the reference count reaches zero, and
thus not detect when the descriptor a block should be freed.

The fix is to update the expected return value from `atomic_fetch_sub` to be
`1` instead of `0`.

Fixes https://github.com/xamarin/xamarin-macios/issues/20503.
2024-05-06 09:05:58 +02:00
Srdjan Jovčić d8f8def871
Update service connection (#20554)
Update the service connection used to upload to one backed by managed
identity.
2024-05-03 00:27:32 -07:00
Matt Sylvia 91a4c2f4e9 Update service connection
Update the service connection used to upload to one backed by managed
identity
2024-05-02 16:55:32 -04:00