-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NativeAOT: Enable building app extensions with NativeAOT (#20872)
### Description This PR enables building app extensions with NativeAOT. App extensions are class libraries and to build them with NativeAOT we must not specify `CustomNativeMain=true`. If we do, ILC would expect that the input assembly has a managed Main as the module entry point. Additionally, when building class libraries (with the absence of a managed Main entry point), our static reference from: https://github.com/xamarin/xamarin-macios/blob/2e5ef1eb1c14e185b29bbef091d227ed0c8cc875/runtime/nativeaot-bridge.m#L39 requires build-time symbol resolution. To avoid linking errors, we generate an empty `__managed__Main` in the native bootstrapping code of the app extension (e.g., in `main.arm64.mm`). ### Testing The unit tests have been introduced to test building app extensions with both Mono and NativeAOT. Executing an iOS app TodayExtension built with NativeAOT has been verified manually on an actual device. --- Fixes: #20653
- Loading branch information
1 parent
e1290d2
commit 374e902
Showing
10 changed files
with
59 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
374e902
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥 [CI Build] Build failed 🔥
Build failed for the job 'Build macOS tests'
Pipeline on Agent
Hash: 374e9020756bdae22835b65d28a1f32e755b905d [CI build]
374e902
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ API diff for current PR / commit
Legacy Xamarin (No breaking changes)
iOS(no change detected)tvOS(no change detected)watchOS(no change detected)macOS(no change detected)NET (empty diffs)
iOS: (empty diff detected)tvOS: (empty diff detected)MacCatalyst: (empty diff detected)macOS: (empty diff detected)✅ API diff vs stable
Legacy Xamarin (No breaking changes)
.NET (No breaking changes)
Legacy Xamarin (stable) vs .NET
ℹ️ Generator diff
Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)
Pipeline on Agent
Hash: 374e9020756bdae22835b65d28a1f32e755b905d [CI build]
374e902
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📚 [CI Build] Artifacts 📚
Packages generated
View packages
Pipeline on Agent
Hash: [CI build]