Skip to content

[net10.0] Merge main into net10.0.#21480

Merged
rolfbjarne merged 34 commits intonet10.0from
dev/rolf/bump-main-in-net10.0-2024-10-21
Oct 21, 2024
Merged

[net10.0] Merge main into net10.0.#21480
rolfbjarne merged 34 commits intonet10.0from
dev/rolf/bump-main-in-net10.0-2024-10-21

Conversation

@rolfbjarne
Copy link
Copy Markdown
Member

No description provided.

rolfbjarne and others added 30 commits October 10, 2024 20:10
…on is lower than the minimum. Fixes #21368. (#21369)

This isn't very user friendly:

    ILLink : unknown error IL7000: An error occurred while executing the custom linker steps. Please review the build log for more information.
    ILLINK : error MT0073: Microsoft.iOS 18.0.8337 does not support a deployment target of 10.0 for iOS (the minimum is 11.0). Please select a newer deployment target in your project's Info.plist or change the SupportedOSPlatformVersion property in your project file.
    ILLINK : error MT2301: The linker step 'Setup' failed during processing: Microsoft.iOS 18.0.8337 does not support a deployment target of 10.0 for iOS (the minimum is 11.0). Please select a newer deployment target in your project's Info.plist or change the SupportedOSPlatformVersion property in your project file.
    [...]/packages/microsoft.net.illink.tasks/8.0.8/build/Microsoft.NET.ILLink.targets(87,5): error NETSDK1144: Optimizing assemblies for size failed. Optimization can be disabled by setting the PublishTrimmed property to false.

So improve this to only show a single error message:

    The SupportedOSPlatformVersion value '10.0' in the project file is lower than the minimum value '11.0'.

Fixes #21368.
It doesn't look like it's used anywhere (and I don't have it on my system either).
…t MonoVM. Fixes #20398. (#21406)

Tests that exercise this code path will be included in a different PR.

Fixes #20398.
… RuntimeIdentifiers value is set. Fixes #19391. (#21412)

We need to set "UseCurrentRuntimeIdentifier=false", we must only set it for
the outer build for universal builds - when `RuntimeIdentifiers` is set - but
that means we can only do it *after* we set any default value for
`RuntimeIdentifiers`.

Fixes #19391 (comment).
…ation. (#21317)

* Unify the code to collect diagnostic information about a bot.
* Unify some of the cleanup code to prepare a bot as well.
* Implement code to terminate processes on a bot that's used more than a day
  of CPU (presumably these processes are stuck for some reason).
According to @pjcollins the msi files we were generated aren't used
anywhere, so this should be safe.
Allow to download the artifacts from the build that triggered the
pipeline.
This pull request updates the following dependencies

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

- **Subscription**: 601bc5e1-1cae-44b5-cf5f-08db9342aa2f
- **Build**: 20241009.1
- **Date Produced**: October 9, 2024 2:00:06 PM UTC
- **Commit**: 973ef6c89b67f2f746f62c413e3aeeb01a9034a3
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.DotNet.XHarness.iOS.Shared**: [from 10.0.0-prerelease.24501.1 to 10.0.0-prerelease.24509.1][2]

[2]: dotnet/xharness@2b6293f...973ef6c
This pull request updates the following dependencies

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

- **Subscription**: 6ddbc71e-6118-4fea-a928-58d1b2579c38
- **Build**: 20241009.3
- **Date Produced**: October 9, 2024 10:05:57 PM UTC
- **Commit**: 05c72bb3c9b38138276a8029017f2ef905dcc7fa
- **Branch**: refs/heads/release/9.0

- **Updates**:
  - **Microsoft.DotNet.Build.Tasks.Feed**: [from 9.0.0-beta.24508.3 to 9.0.0-beta.24509.3][4]

[4]: dotnet/arcade@f8071c4...05c72bb
This pull request updates the following dependencies

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

- **Subscription**: 601bc5e1-1cae-44b5-cf5f-08db9342aa2f
- **Build**: 20241011.1
- **Date Produced**: October 11, 2024 7:48:41 AM UTC
- **Commit**: 8c6d5afd99c713777165f4378462085a5679c223
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.DotNet.XHarness.iOS.Shared**: [from 10.0.0-prerelease.24509.1 to 10.0.0-prerelease.24511.1][1]

[1]: dotnet/xharness@973ef6c...8c6d5af
This logic was intented to zip up the .NET unit tests to run them on Windows,
but in the end we went with a different approach that doesn't require zipping.
…Windows. (#21430)

Just trust the exit code instead.

This way the installation doesn't fail due to random output.
…1432)

In the process of ensuring that we can run tests a single time, we are
removing all extra stages from the CI. We have move the APIScan to the
following pipelines.

- CI Pipeline:
https://devdiv.visualstudio.com/DevDiv/_build?definitionId=24050
- PR Pipeline:
https://devdiv.visualstudio.com/DevDiv/_build?definitionId=24049
We are doing the following:

1. Adding the rgen directory with the following solutions:
* Analyzer: Analyzer that will catch errors in the bindings. At the
moment it provides a single error when the BindingTypeAttribute is used
in a nont partial type.
   * Analyzer Tests: Allows tests for the analyzer.
   * Analyzer Sample: Sample project to test the analyzer.
* Code Generator: A code generator that adds the BindingTypeAttribute to
the compilcation.
   * Code Generator Tests: Allows tests for the generator.
   * Code Sample: Sample project for the code generator.
2. Make rule to build the roslyn code generator.
3. Makefile changes to add the code generator as part as the second
compilation of the bindings.

This changes add the starting gounds to move to roslyn.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Alex Soto <alex@soto.dev>
…ails. (#21393)

Here's an example failure that didn't stop the build:

    Target Name=_RunILLink Project=sampleproj.csproj
        Building target "_RunILLink" completely.
        Output file "obj\Release\net8.0-ios\ios-arm64\linked\Link.semaphore" does not exist.
        [...]
        Xamarin.MacDev.Tasks.ILLink
            [...]
            C:\Program Files\dotnet\packs\Microsoft.iOS.Windows.Sdk.net8.0_17.5\17.5.8030\tools\msbuild\iOS\Xamarin.iOS.Common.After.targets(364,3): [xma][err]: An exception occurred in the task 'ILLink'
            C:\Program Files\dotnet\packs\Microsoft.iOS.Windows.Sdk.net8.0_17.5\17.5.8030\tools\msbuild\iOS\Xamarin.iOS.Common.After.targets(364,3): The post for client build1460814608Ilian on topic xvs/build/1.14.0.6/execute-task/ecacau/de6ed16002fILLink has been cancelled
       at Xamarin.Messaging.Client.MessagingClient.PostAsync[TRequest,TResponse](TRequest message, String topic, MessagePriority priority, CancellationToken cancellationToken, Boolean retain, Int32 timeoutSecs) in D:\a\_work\1\s\src\Xamarin.Messaging.Client\MessagingClient.cs:line 231
       at Xamarin.Messaging.Ssh.MessagingRunnerPro.ExecuteWithRetryAsync[TResult](Func`1 executeDelegate, IMessagingAnalyticsAction analytics, Int32 attempts) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRunnerPro.cs:line 57
       at Xamarin.Messaging.Ssh.MessagingRunnerPro.ThrowIfConnected(ExceptionDispatchInfo exceptionInfo, IMessagingAnalyticsAction analytics) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRunnerPro.cs:line 149
       at Xamarin.Messaging.Ssh.MessagingRunnerPro.HandleExceptionAsync[TResult](ExceptionDispatchInfo exceptionInfo, Func`1 reentrancyDelegate, IMessagingAnalyticsAction analytics, Int32 attempts) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRunnerPro.cs:line 97
       at Xamarin.Messaging.Ssh.MessagingRunnerPro.ExecuteWithRetryAsync[TResult](Func`1 executeDelegate, IMessagingAnalyticsAction analytics, Int32 attempts) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRunnerPro.cs:line 64
       at Xamarin.Messaging.Ssh.MessagingRunnerPro.HandleExceptionAsync[TResult](ExceptionDispatchInfo exceptionInfo, Func`1 reentrancyDelegate, IMessagingAnalyticsAction analytics, Int32 attempts) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRunnerPro.cs:line 103
       at Xamarin.Messaging.Ssh.MessagingRunnerPro.ExecuteWithRetryAsync[TResult](Func`1 executeDelegate, IMessagingAnalyticsAction analytics, Int32 attempts) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRunnerPro.cs:line 64
       at Xamarin.Messaging.Ssh.MessagingRunnerPro.ExecuteWithRetryAsync[TResult](Func`1 executeDelegate, Int32 attempts) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRunnerPro.cs:line 39
       at Xamarin.Messaging.Ssh.MessagingClientPro.PostAsync[TMessage,TResult](TMessage request, CancellationToken cancellationToken, Boolean retain, Int32 timeoutSecs) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingClientPro.cs:line 144
       at Xamarin.Messaging.Build.Client.BuildClient.RunMessagingAsync[TMessage,TResult](TMessage message, Int32 timeoutSecs) in D:\a\_work\1\s\src\MSBuild\Xamarin.Messaging.Build.Client\BuildClient.cs:line 293
       at Xamarin.Messaging.Build.Client.BuildClient.ExecuteTaskAsync(String task, String inputs) in D:\a\_work\1\s\src\MSBuild\Xamarin.Messaging.Build.Client\BuildClient.cs:line 65
       at Xamarin.Messaging.Build.Client.TaskRunner.RunAsync(Task task) in D:\a\_work\1\s\src\MSBuild\Xamarin.Messaging.Build.Client\TaskRunner.cs:line 56
            Errors
                C:\Program Files\dotnet\packs\Microsoft.iOS.Windows.Sdk.net8.0_17.5\17.5.8030\tools\msbuild\iOS\Xamarin.iOS.Common.After.targets(364,3): MessagingException: The post for client build1460814608Ilian on topic xvs/build/1.14.0.6/execute-task/ecacau/de6ed16002fILLink has been cancelled
    OperationCanceledException: The operation was canceled.
     [sampleproj.csproj]
                C:\Program Files\dotnet\packs\Microsoft.iOS.Windows.Sdk.net8.0_17.5\17.5.8030\tools\msbuild\iOS\Xamarin.iOS.Common.After.targets(364,3): error MSB4018: The "Xamarin.MacDev.Tasks.ILLink" task failed unexpectedly.
    System.AggregateException: One or more errors occurred. (One or more errors occurred. (An error occurred while executing the operation and the connection could not be reestablished))
     ---> System.AggregateException: One or more errors occurred. (An error occurred while executing the operation and the connection could not be reestablished)
     ---> Xamarin.Messaging.Exceptions.MessagingException: An error occurred while executing the operation and the connection could not be reestablished
     ---> Xamarin.Messaging.Exceptions.ClientDisconnectedException: The client build1460814608Ilian has been disconnected while waiting a post response to topic xma/agents
       at Xamarin.Messaging.Client.MessagingClient.PostAsync[TRequest,TResponse](TRequest message, String topic, MessagePriority priority, CancellationToken cancellationToken, Boolean retain, Int32 timeoutSecs) in D:\a\_work\1\s\src\Xamarin.Messaging.Client\MessagingClient.cs:line 197
       at Xamarin.Messaging.Ssh.MessagingRunnerPro.ExecuteWithRetryAsync[TResult](Func`1 executeDelegate, IMessagingAnalyticsAction analytics, Int32 attempts) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRunnerPro.cs:line 57
       --- End of inner exception stack trace ---
       at Xamarin.Messaging.Ssh.MessagingRunnerPro.ReconnectAsync(ExceptionDispatchInfo exceptionInfo, IMessagingAnalyticsAction analytics) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRunnerPro.cs:line 182
       at Xamarin.Messaging.Ssh.MessagingRunnerPro.HandleExceptionAsync[TResult](ExceptionDispatchInfo exceptionInfo, Func`1 reentrancyDelegate, IMessagingAnalyticsAction analytics, Int32 attempts) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRunnerPro.cs:line 99
       at Xamarin.Messaging.Ssh.MessagingRunnerPro.ExecuteWithRetryAsync[TResult](Func`1 executeDelegate, IMessagingAnalyticsAction analytics, Int32 attempts) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRunnerPro.cs:line 64
       at Xamarin.Messaging.Ssh.MessagingRunnerPro.ExecuteWithRetryAsync[TResult](Func`1 executeDelegate, Int32 attempts) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRunnerPro.cs:line 39
       at Xamarin.Messaging.Ssh.MessagingClientPro.PostAsync[TMessage,TResult](TMessage request, Boolean retain, Int32 timeoutSecs) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingClientPro.cs:line 135
       at Xamarin.Messaging.Ssh.MessagingService.RefreshAgentsStatusAsync() in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingService.cs:line 298
       at Xamarin.Messaging.Build.Client.BuildConnection.GetBuildAgentStatusAsync() in D:\a\_work\1\s\src\MSBuild\Xamarin.Messaging.Build.Client\BuildConnection.Normal.cs:line 435
       at Xamarin.Messaging.Build.Client.BuildConnection.IsBuildAgentRunningAsync() in D:\a\_work\1\s\src\MSBuild\Xamarin.Messaging.Build.Client\BuildConnection.Normal.cs:line 92
       --- End of inner exception stack trace ---
       at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
       at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
       at Xamarin.Messaging.Build.Client.BuildConnection.get_IsConnected() in D:\a\_work\1\s\src\MSBuild\Xamarin.Messaging.Build.Client\BuildConnection.Normal.cs:line 45
       at Xamarin.Messaging.Build.Client.BuildConnection.GetAsync(IBuildEngine4 engine) in D:\a\_work\1\s\src\MSBuild\Xamarin.Messaging.Build.Client\BuildConnection.Static.cs:line 50
       at Xamarin.Messaging.Build.Client.TaskRunner.DisconnectAsync(Task task) in D:\a\_work\1\s\src\MSBuild\Xamarin.Messaging.Build.Client\TaskRunner.cs:line 541
       at Xamarin.Messaging.Build.Client.TaskRunner.RunAsync(Task task) in D:\a\_work\1\s\src\MSBuild\Xamarin.Messaging.Build.Client\TaskRunner.cs:line 99
       --- End of inner exception stack trace ---
       at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
       at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
       at Xamarin.MacDev.Tasks.ILLink.Execute() in /Users/builder/azdo/_work/1/s/xamarin-macios/msbuild/Xamarin.MacDev.Tasks/Tasks/ILLink.cs:line 30
       at Microsoft.Build.BackEnd.TaskExecutionHost.Execute()
       at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(TaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
            Messages
            [...]
        Task "Touch" skipped, due to false condition; ( '$(_ILLinkExitCode)' == '0' ) was evaluated as ( '' == '0' ).

     (and build kept going, eventually failing later on because ILLink didn't run correctly)

Ref: https://developercommunity.visualstudio.com/t/Maui-Blazor-Hybrid-App-wont-publish-to-/10750311#T-ND10763338
The existing Objective-C class to request an App Store review (SKStoreReviewController) is deprecated in Xcode 16+, and it doesn't even work on the corresponding OS versions.

The replacement API is Swift-only, but luckily it's a very simple API (just a static method), so it's possible to bind it manually.

This required a few other changes/improvements:

* Add support for Swift code in our runtime.

* Just to keep the changes to a minimum, bump the min OS version for legacy code to match the .NET min OS versions. This is because our build logic uses the legacy min versions when compiling native code (a more involved fix would be to update all the build logic to build native code to use the .NET min OS versions, but that's not the point of this PR, so I took the easy route). Fixes #10659.

I've tested the method locally, and it seems to work fine, but I've still marked
it as experimental for now. There are no unit tests because calling the method will
put up a dialog, which won't work correctly in unit tests.

Fixes #21410.
Fixes #10659.
…. (#21439)

This has a few advantages:

* We simplify and unify more of our code.
* We have more control over the error reporting / logging behavior.

Additionally:

* Use 'xcrun' to invoke 'metal' and 'metallib' (partial fix for #3931).
* Allow for overriding the path to the command-line tool in question.
* Add support for cancellation.
* Fix nullability.

Fixes #21437.
Context: dotnet/arcade@b2d3a3a
Context: xamarin/yaml-templates#339

The VS insertion manifest generation has been updated to use new VS
component IDs required for .NET 9+.

Backport of #21423

---------

Co-authored-by: Peter Collins <pecolli@microsoft.com>
Teach our bgen to ignore those types that have been marked as a rgen
BindingType. The code adds a new smart enum in the sources that should
not be processed by bgen and therefore should not have the smart enum
extension method. You can verify that this is try by looking at the API
diff:

<img width="560" alt="Screenshot 2024-10-15 at 14 58 00"
src="https://github.com/user-attachments/assets/83790ae6-d94a-424f-8f70-e33bde7c4f22">
#21455)

A dual-purpose script is always better than a single-purpose script!

This also removes a dependency on 'xamarin-macios' being the repository
name.
#21454)

Also collect any crash reports from the remote machine.
This pull request updates the following dependencies

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

- **Subscription**: 6ddbc71e-6118-4fea-a928-58d1b2579c38
- **Build**: 20241016.2
- **Date Produced**: October 16, 2024 4:50:11 PM UTC
- **Commit**: 3c393bbd85ae16ddddba20d0b75035b0c6f1a52d
- **Branch**: refs/heads/release/9.0

- **Updates**:
  - **Microsoft.DotNet.Build.Tasks.Feed**: [from 9.0.0-beta.24509.3 to 9.0.0-beta.24516.2][1]

[1]: dotnet/arcade@05c72bb...3c393bb
…nal exceptions. (#21464)

This way we report the stack trace of the original exception in build logs.
rolfbjarne and others added 4 commits October 17, 2024 18:57
Context: 9013ae4

We've decided hold off on this change until .NET 10.

---------

Co-authored-by: Peter Collins <pecolli@microsoft.com>
Context: dotnet/arcade@b2d3a3a
Context: xamarin/yaml-templates#339

The VS insertion manifest generation has been updated to use new VS
component IDs required for .NET 10+.

Re-application of #21423 for .NET 10+.

See also #21476.

---------

Co-authored-by: Peter Collins <pecolli@microsoft.com>
@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

💻 [CI Build] Windows Integration Tests passed 💻

All Windows Integration Tests passed.

Pipeline on Agent
Hash: 04f4de35ebd598282b098bb60c37775de0f7cc3c [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

💻 [CI Build] Tests on macOS X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: 04f4de35ebd598282b098bb60c37775de0f7cc3c [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

💻 [CI Build] Tests on macOS M1 - Mac Monterey (12) passed 💻

All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent
Hash: 04f4de35ebd598282b098bb60c37775de0f7cc3c [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

💻 [CI Build] Tests on macOS M1 - Mac Ventura (13) passed 💻

All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent
Hash: 04f4de35ebd598282b098bb60c37775de0f7cc3c [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

.NET (No breaking changes)

✅ API diff vs stable

.NET (No breaking changes)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 04f4de35ebd598282b098bb60c37775de0f7cc3c [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

🚀 [CI Build] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 101 tests passed 🎉

Tests counts

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 3 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker: All 40 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 7 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 8 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 9 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 7 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: 04f4de35ebd598282b098bb60c37775de0f7cc3c [PR build]

@rolfbjarne rolfbjarne merged commit 0578431 into net10.0 Oct 21, 2024
@rolfbjarne rolfbjarne deleted the dev/rolf/bump-main-in-net10.0-2024-10-21 branch October 21, 2024 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants