[xcode27.0-net11.0] Merge main into xcode27.0-net11.0 - #26568
Conversation
…ixes #26430 (#26468) The `$(DynamicCodeSupport)` default dates back to when Mono was the only runtime for iOS/tvOS/Mac Catalyst: it was set to `false` unless the Mono interpreter was enabled. Neither `$(MtouchInterpreter)` nor `$(UseInterpreter)` mean anything for CoreCLR, so on .NET 11 - where CoreCLR is the default runtime - we ended up claiming that dynamic code isn't supported even though it is. That makes ILLink substitute `RuntimeFeature.IsDynamicCodeSupported` with `false` in the trimmed `System.Private.CoreLib`, which in turn breaks libraries that use this feature switch to detect NativeAOT. Entity Framework Core for instance throws "Model building is not supported when publishing with NativeAOT. Use a compiled model." in plain Debug builds. So only default to `false` when dynamic code really isn't available: * NativeAOT. * Mono without the interpreter on iOS/tvOS/Mac Catalyst. In every other case we leave the property alone and let dotnet/sdk pick its default (which is `true`). Note that this comes at a size cost, since `System.Reflection.Emit` is now kept alive: a stock Mac Catalyst app in Release goes from ~21 MB to ~39 MB. Anybody who doesn't need dynamic code can opt out with `<DynamicCodeSupport>false</DynamicCodeSupport>`. Fixes #26430 🤖 Pull request created by Copilot --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ixes #26456. (#26475) Setting `PublishReadyToRunComposite=false` made the build fail with one `MSB3030: Could not copy the file ".../R2R/<Assembly>.dylib" because it was not found.` error per assembly, which gives no clue about what's actually wrong. Non-composite ReadyToRun compilation just isn't supported with the Mach-O container format we use for iOS, tvOS and Mac Catalyst: * crossgen2 emits one Mach-O object file per assembly, but no component assemblies for the runtime to load, and the SDK replaces the IL assemblies in the publish output with the (never created) per-assembly dylibs. * The runtime only knows how to locate platform-native ReadyToRun code by looking up the owner composite image, see https://github.com/dotnet/runtime/blob/main/docs/design/coreclr/botr/readytorun-platform-native-envelope.md So report a single, actionable error instead. Fixes #26456 🤖 Pull request created by Copilot
Fixes the xtro-sharpie nullability check for members of protocols whose native name is supplied through `ProtocolAttribute.Name`. `Helpers.GetName(TypeDefinition)` previously only inspected constructor arguments and fell back to the managed type name. For many types, that prevented matching native declarations and caused a number of diagnostics to go unreported. 🤖 Pull request created by Copilot --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Rolf Bjarne Kvinge <rokvin@microsoft.com>
. (#26530) Sharpie already generates protocol interfaces for Objective-C generic arguments, so add regression coverage for the reported typedef scenario on iOS and macOS. Report MT4192 when an exported signature uses a model class as a generic argument, and direct users to the corresponding protocol interface. Add assembly-preparer coverage for both the invalid model class and valid protocol interface forms. Fixes #21256 🤖 Pull request created by Copilot --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a macOS arm64 variation to EnableCrashReportTest now that the desktop runtime supports JSON crash reports through createdump. The existing test verifies both an explicitly configured crash report directory and the default per-application caches directory. Fixes #23864 🤖 Pull request created by Copilot
Document ten AppKit enum types and their members, replacing placeholder documentation with useful summaries. Remove the corresponding entries from the Cecil documentation known-failures list. 🤖 Pull request created by Copilot
…26413 (#26560) Removes the workaround for dotnet/runtime#131892 (the trimmer crashed with a `NullReferenceException`, surfaced as `error IL1012`, when computing the documentation signature of a method whose parameter type is a nested type from another assembly) now that the trimmer bug is fixed and we've moved to an SDK containing the fix. `[DynamicDependency]` attributes now use precise method signatures (including the parameter list) again, instead of matching by name and generic arity alone, so fewer overloads are unnecessarily preserved. Note: `DocumentationComments.GetNameSignature` and `AddPreserveAllMembersDynamicDependencyAttributes` are intentionally left untouched, since `[Preserve (AllMembers = true)]` preserves every overload anyway, so matching by name there is correct and cheaper. Fixes #26413 🤖 Pull request created by Copilot --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Removes the temporary Assert.Ignore that disabled CoreCLR DotNetWatch Hot Reload tests on iOS and Mac Catalyst after the upstream runtime fix for Bad IL range. Fixes #26470. 🤖 Pull request created by Copilot --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The linker’s DynamicDependency signature generation change risks reintroducing a documented trimmer crash scenario and should be adjusted before merging.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR merges main into xcode27.0-net11.0, pulling forward a set of runtime/registrar, linker, MSBuild, test, and documentation updates aligned with the net11.0/Xcode 27.0 branch.
Changes:
- Add a new registrar error (MT4192) to reject using
[Model]classes as generic type arguments (must use the protocol interface type instead). - Adjust DynamicCodeSupport/MSBuild behavior (and add unit tests) to ensure CoreCLR builds report dynamic code support correctly, while NativeAOT/Mono-without-interpreter are marked unsupported.
- Add validation that Mach-O ReadyToRun builds require composite R2R, plus update xtro ignore baselines, docs, and expected app-size files.
File summaries
| File | Description |
|---|---|
| tools/mtouch/Errors.resx | Adds MT4192 error string for registrar generic-argument validation. |
| tools/mtouch/Errors.designer.cs | Adds generated resource accessor for MT4192. |
| tools/dotnet-linker/AppBundleRewriter.cs | Changes DynamicDependency signature generation to always use full signatures. |
| tools/common/StaticRegistrar.cs | Adds generic-argument enumeration + safer attribute lookup when Resolve() returns null. |
| tests/xtro-sharpie/xtro-sharpie/Helpers.cs | Improves [Protocol] native-name discovery via attribute property lookup. |
| tests/xtro-sharpie/u2todo/u2todo.cs | Adds --ignore mode to generate .ignore outputs from .unclassified. |
| tests/xtro-sharpie/Makefile | Adds unclassified2ignore target. |
| tests/xtro-sharpie/api-annotations-dotnet/tvOS-UIKit.ignore | Updates xtro ignore baselines (interface-qualified names, new findings). |
| tests/xtro-sharpie/api-annotations-dotnet/tvOS-ModelIO.ignore | Updates xtro ignore baselines (new nullability/simd findings). |
| tests/xtro-sharpie/api-annotations-dotnet/tvOS-MetalPerformanceShaders.ignore | Updates xtro ignore baselines (new nullability finding). |
| tests/xtro-sharpie/api-annotations-dotnet/tvOS-MetalFX.ignore | Adds new xtro ignore baseline file. |
| tests/xtro-sharpie/api-annotations-dotnet/tvOS-Metal.ignore | Updates xtro ignore baselines (new deprecation/nullability findings). |
| tests/xtro-sharpie/api-annotations-dotnet/tvOS-GameplayKit.ignore | Adds new xtro ignore baseline file. |
| tests/xtro-sharpie/api-annotations-dotnet/tvOS-GameController.ignore | Adds new xtro ignore baseline file. |
| tests/xtro-sharpie/api-annotations-dotnet/tvOS-Foundation.ignore | Updates xtro ignore baselines (new nullability findings). |
| tests/xtro-sharpie/api-annotations-dotnet/tvOS-CoreImage.ignore | Updates xtro ignore baselines (new nullability findings). |
| tests/xtro-sharpie/api-annotations-dotnet/tvOS-BrowserEngineKit.ignore | Adds new xtro ignore baseline file. |
| tests/xtro-sharpie/api-annotations-dotnet/tvOS-BackgroundAssets.ignore | Adds new xtro ignore baseline file. |
| tests/xtro-sharpie/api-annotations-dotnet/tvOS-AVKit.ignore | Updates xtro ignore baselines (new nullability findings). |
| tests/xtro-sharpie/api-annotations-dotnet/macOS-SafariServices.ignore | Updates xtro ignore baselines (new nullability finding). |
| tests/xtro-sharpie/api-annotations-dotnet/macOS-QuickLookUI.ignore | Adds new xtro ignore baseline file. |
| tests/xtro-sharpie/api-annotations-dotnet/macOS-PhotosUI.ignore | Updates xtro ignore baselines (new nullability findings). |
| tests/xtro-sharpie/api-annotations-dotnet/macOS-ModelIO.ignore | Updates xtro ignore baselines (new nullability/simd findings). |
| tests/xtro-sharpie/api-annotations-dotnet/macOS-MetalPerformanceShaders.ignore | Updates xtro ignore baselines (new nullability finding). |
| tests/xtro-sharpie/api-annotations-dotnet/macOS-MetalFX.ignore | Adds new xtro ignore baseline file. |
| tests/xtro-sharpie/api-annotations-dotnet/macOS-Metal.ignore | Updates xtro ignore baselines (new deprecation/nullability findings). |
| tests/xtro-sharpie/api-annotations-dotnet/macOS-MailKit.ignore | Updates xtro ignore baselines (new nullability findings). |
| tests/xtro-sharpie/api-annotations-dotnet/macOS-GameplayKit.ignore | Adds new xtro ignore baseline file. |
| tests/xtro-sharpie/api-annotations-dotnet/macOS-GameController.ignore | Updates xtro ignore baselines (new deprecation finding). |
| tests/xtro-sharpie/api-annotations-dotnet/macOS-FSKit.ignore | Updates xtro ignore baselines (new nullability findings). |
| tests/xtro-sharpie/api-annotations-dotnet/macOS-Foundation.ignore | Updates xtro ignore baselines (interface-qualified name updates + new findings). |
| tests/xtro-sharpie/api-annotations-dotnet/macOS-FileProvider.ignore | Updates xtro ignore baselines (new findings). |
| tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreImage.ignore | Updates xtro ignore baselines (new nullability findings). |
| tests/xtro-sharpie/api-annotations-dotnet/macOS-ClassKit.ignore | Updates xtro ignore baselines (new nullability finding). |
| tests/xtro-sharpie/api-annotations-dotnet/macOS-BackgroundAssets.ignore | Adds new xtro ignore baseline file. |
| tests/xtro-sharpie/api-annotations-dotnet/macOS-AuthenticationServices.ignore | Updates xtro ignore baselines (new nullability findings). |
| tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-UIKit.ignore | Updates xtro ignore baselines (interface-qualified names, new findings). |
| tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-QuickLook.ignore | Adds new xtro ignore baseline file. |
| tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-PhotosUI.ignore | Updates xtro ignore baselines (new nullability finding). |
| tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-ModelIO.ignore | Updates xtro ignore baselines (new nullability/simd findings). |
| tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-MetalPerformanceShaders.ignore | Updates xtro ignore baselines (new nullability finding). |
| tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-MetalFX.ignore | Adds new xtro ignore baseline file. |
| tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-Metal.ignore | Updates xtro ignore baselines (new deprecation/nullability findings). |
| tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-Messages.ignore | Updates xtro ignore baselines (new nullability finding). |
| tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-GameplayKit.ignore | Adds new xtro ignore baseline file. |
| tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-GameController.ignore | Updates xtro ignore baselines (new deprecation finding). |
| tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-Foundation.ignore | Updates xtro ignore baselines (interface-qualified name updates + new findings). |
| tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-CoreNFC.ignore | Updates xtro ignore baselines (new nullability findings). |
| tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-CoreImage.ignore | Adds new xtro ignore baseline file. |
| tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-ClassKit.ignore | Updates xtro ignore baselines (new nullability finding). |
| tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-BackgroundAssets.ignore | Adds new xtro ignore baseline file. |
| tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-AuthenticationServices.ignore | Updates xtro ignore baselines (new nullability findings). |
| tests/xtro-sharpie/api-annotations-dotnet/iOS-UIKit.ignore | Updates xtro ignore baselines (interface-qualified names, new findings). |
| tests/xtro-sharpie/api-annotations-dotnet/iOS-QuickLook.ignore | Adds new xtro ignore baseline file. |
| tests/xtro-sharpie/api-annotations-dotnet/iOS-PhotosUI.ignore | Adds new xtro ignore baseline file. |
| tests/xtro-sharpie/api-annotations-dotnet/iOS-ModelIO.ignore | Updates xtro ignore baselines (new nullability/simd findings). |
| tests/xtro-sharpie/api-annotations-dotnet/iOS-MetalPerformanceShaders.ignore | Updates xtro ignore baselines (new nullability finding). |
| tests/xtro-sharpie/api-annotations-dotnet/iOS-MetalFX.ignore | Adds new xtro ignore baseline file. |
| tests/xtro-sharpie/api-annotations-dotnet/iOS-Metal.ignore | Updates xtro ignore baselines (new deprecation/nullability findings). |
| tests/xtro-sharpie/api-annotations-dotnet/iOS-Messages.ignore | Updates xtro ignore baselines (new nullability finding). |
| tests/xtro-sharpie/api-annotations-dotnet/iOS-GameplayKit.ignore | Adds new xtro ignore baseline file. |
| tests/xtro-sharpie/api-annotations-dotnet/iOS-GameController.ignore | Updates xtro ignore baselines (new deprecation finding). |
| tests/xtro-sharpie/api-annotations-dotnet/iOS-Foundation.ignore | Updates xtro ignore baselines (interface-qualified name updates + new findings). |
| tests/xtro-sharpie/api-annotations-dotnet/iOS-FileProvider.ignore | Updates xtro ignore baselines (new findings). |
| tests/xtro-sharpie/api-annotations-dotnet/iOS-CoreNFC.ignore | Updates xtro ignore baselines (new nullability findings + deprecation findings). |
| tests/xtro-sharpie/api-annotations-dotnet/iOS-CoreImage.ignore | Updates xtro ignore baselines (new nullability findings). |
| tests/xtro-sharpie/api-annotations-dotnet/iOS-ClassKit.ignore | Updates xtro ignore baselines (new nullability finding). |
| tests/xtro-sharpie/api-annotations-dotnet/iOS-CarPlay.ignore | Updates xtro ignore baselines (new nullability finding). |
| tests/xtro-sharpie/api-annotations-dotnet/iOS-BrowserEngineKit.ignore | Adds new xtro ignore baseline file. |
| tests/xtro-sharpie/api-annotations-dotnet/iOS-BackgroundAssets.ignore | Adds new xtro ignore baseline file. |
| tests/xtro-sharpie/api-annotations-dotnet/iOS-AuthenticationServices.ignore | Updates xtro ignore baselines (new nullability findings). |
| tests/xtro-sharpie/api-annotations-dotnet/common-UIKit.ignore | Updates xtro ignore baselines (interface-qualified names). |
| tests/xtro-sharpie/api-annotations-dotnet/common-Foundation.ignore | Updates xtro ignore baselines (interface-qualified names). |
| tests/xtro-sharpie/api-annotations-dotnet/common-BackgroundAssets.ignore | Updates xtro ignore baselines (interface-qualified names). |
| tests/sharpie/Tests/ObjCGenerics.macosx.cs | Adds a new generics binding test case for NSDictionary + protocol-constrained value types. |
| tests/sharpie/Tests/ObjCGenerics.iphoneos.cs | Same generics binding test case for iPhoneOS profile. |
| tests/sharpie/Tests/ObjCGenerics.h | Adds GCKSessionOptions typedef + property to drive generics binding test. |
| tests/dotnet/UnitTests/ProjectTest.cs | Adds test asserting PublishReadyToRunComposite=false is rejected for Apple app bundles. |
| tests/dotnet/UnitTests/expected/TVOS-CoreCLR-R2R-size.txt | Updates expected tvOS CoreCLR R2R app size baseline. |
| tests/dotnet/UnitTests/expected/TVOS-CoreCLR-Interpreter-size.txt | Updates expected tvOS CoreCLR interpreter app size baseline. |
| tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-R2R-size.txt | Updates expected Mac Catalyst CoreCLR R2R app size baseline. |
| tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-Interpreter-size.txt | Updates expected Mac Catalyst CoreCLR interpreter app size baseline. |
| tests/dotnet/UnitTests/expected/iOS-CoreCLR-R2R-size.txt | Updates expected iOS CoreCLR R2R app size baseline. |
| tests/dotnet/UnitTests/expected/iOS-CoreCLR-Interpreter-size.txt | Updates expected iOS CoreCLR interpreter app size baseline. |
| tests/dotnet/UnitTests/EnableCrashReportTest.cs | Extends crash-report test coverage to macOS. |
| tests/dotnet/UnitTests/DynamicCodeSupportTest.cs | Adds new tests covering DynamicCodeSupport behavior for CoreCLR/NativeAOT/user override. |
| tests/dotnet/UnitTests/DotNetWatchTest.cs | Removes the CoreCLR Hot Reload ignore gate for non-macOS platforms. |
| tests/cecil-tests/Documentation.KnownFailures.txt | Removes several AppKit enum entries from documentation known-failures list (docs added). |
| tests/assembly-preparer/ReproTest.cs | Captures logged ProductExceptions in the test logger for assertions. |
| tests/assembly-preparer/RegistrarTests.cs | Adds regression tests for the new registrar generic-argument error behavior. |
| tests/assembly-preparer/PreserveSmartEnumConversionsTest.cs | Updates DynamicDependency signature expectations to include parameter lists. |
| tests/assembly-preparer/PreserveBlockCodeHandlerTests.cs | Updates DynamicDependency signature expectations to include parameter lists. |
| src/ObjCRuntime/Registrar.cs | Adds generic-argument validation to reject [Model] types used as generic arguments (error 4192). |
| src/ObjCRuntime/DynamicRegistrar.cs | Implements GetGenericArguments for the dynamic registrar backend. |
| src/AppKit/Enums.cs | Adds/updates XML docs for several AppKit enums (removing “To be added.” placeholders). |
| dotnet/targets/Xamarin.Shared.Sdk.targets | Fixes DynamicCodeSupport defaulting for CoreCLR vs NativeAOT/Mono-without-interpreter. |
| dotnet/targets/Microsoft.Sdk.R2R.targets | Adds validation to enforce composite R2R for Mach-O app bundles. |
| docs/building-apps/build-properties.md | Updates crash-reporting guidance and documents PublishReadyToRunComposite behavior/constraints. |
Review details
Files not reviewed (1)
- tools/mtouch/Errors.designer.cs: Generated file
- Files reviewed: 98/105 changed files
- Comments generated: 2
- Review effort level: Lite
This comment has been minimized.
This comment has been minimized.
✅ [CI Build #2bac4a5] Prepare .NET Release succeeded ✅📦 Published NuGet packages (32 packages)iOS
MacCatalyst
macOS
tvOS
Other
Pipeline on Agent |
Track newly exposed Xcode 27 deprecations as TODOs and retain documented FSKit and MetalFX exceptions after the protocol-name lookup fix. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: cd1fd6e9-5bf0-492b-90ba-cef0e91b6466
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Avoid the native RegisterMediaDeviceExtension SIGSEGV on the affected macOS 27 beta 4 and beta 6 build trains while preserving coverage on later builds. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: cd1fd6e9-5bf0-492b-90ba-cef0e91b6466
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build #b06e22c] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 271 tests passed 🎉 Tests counts✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
No description provided.