-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Fix missing static libraries in NativeAOT packs for Apple mobile platforms #123274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or 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
…forms Co-authored-by: steveisok <471438+steveisok@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix missing static libraries in .NET 11 NativeAOT packs
Fix missing static libraries in NativeAOT packs for Apple mobile platforms
Jan 16, 2026
jkoritzinsky
approved these changes
Jan 16, 2026
This was referenced Jan 16, 2026
Contributor
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.
Pull request overview
This PR fixes missing static libraries in NativeAOT runtime packs for Apple mobile platforms (iOS, tvOS, etc.) that were absent starting in version 11.0.0-alpha.1.26065.101.
Changes:
- Modified the condition on
ExcludeNativeLibrariesRuntimeFilesineng/liveBuilds.targetsto exempt NativeAOT runtime packs from excluding native static libraries - Updated the accompanying comment to clarify that the exclusion does not apply to NativeAOT packs
rosebyte
pushed a commit
that referenced
this pull request
Jan 19, 2026
…forms (#123274) ## Description NativeAOT runtime packs for iOS and other Apple mobile platforms were missing required static libraries (libSystem.Globalization.Native.a, libSystem.IO.Compression.Native.a, libSystem.Native.a, libbrotli*.a) starting in version 11.0.0-alpha.1.26065.101. ## Changes Modified `eng/liveBuilds.targets` in the `ResolveLibrariesRuntimeFilesFromLocalBuild` target: - Added `BuildNativeAOTRuntimePack != 'true'` condition to the `ExcludeNativeLibrariesRuntimeFiles` item for Apple mobile platforms - Updated comment to clarify that the exclusion does not apply to NativeAOT **Rationale**: Regular CoreCLR packs retrieve these libraries from the CoreCLR shared framework directory, so they're excluded from LibrariesRuntimeFiles to avoid duplicates. NativeAOT packs do not reach back into CoreCLR shared framework artifacts and require these libraries from LibrariesRuntimeFiles. ```xml <!-- Before --> <ExcludeNativeLibrariesRuntimeFiles Condition="'$(TargetsAppleMobile)' == 'true' and '$(RuntimeFlavor)' == 'CoreCLR'" <!-- After --> <ExcludeNativeLibrariesRuntimeFiles Condition="'$(TargetsAppleMobile)' == 'true' and '$(RuntimeFlavor)' == 'CoreCLR' and '$(BuildNativeAOTRuntimePack)' != 'true'" ``` ## Testing The fix will be validated when NativeAOT runtime packs for Apple mobile platforms are built in CI/CD, verifying that the static libraries are included in the package output. <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>Latest .NET 11 NativeAOT packs missing some static libraries</issue_title> > <issue_description>The `11.0.0-alpha.1.26065.101` version of the `microsoft.netcore.app.runtime.nativeaot.ios-arm64` pack (and probably other packs for other RIDs as well, I haven't checked) are missing the following files: > > * libSystem.Globalization.Native.a > * libSystem.IO.Compression.Native.a > * libSystem.Native.a > * libbrotlicommon.a > * libbrotlidec.a > * libbrotlienc.a > > They were present in `11.0.0-alpha.1.26062.101` > > Complete file list: https://gist.github.com/rolfbjarne/7f42f3cf3ed3a815e2e9fe2b28c580fb#file-gistfile1-txt-L76-L82 > > This started happening in this maestro PR: dotnet/macios#24508 > > specifically this commit: dotnet/macios@ee15359 > > I tried looking through the relevant dotnet/runtime commits, but I didn't see anything obvious causing this.</issue_description> > > <agent_instructions>In the ResolveLibrariesRefAssembliesFromLocalBuild target in eng/livebuilds.targets, add BuildNativeAOTRuntimePack != 'true' to the condition in the ExcludeNativeLibrariesRuntimeFiles. It should only apply to the item where TargetsAppleMobile == 'true'. > > Additionally, update the comment above the item to indicate that it does not apply to nativeaot because we do not reach back into coreclr sharedFramework artifacts.</agent_instructions> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > <comment_new><author>@MichalStrehovsky</author><body> > > and probably other packs for other RIDs as well, I haven't checked > > I checked Microsoft.NETCore.App.Runtime.NativeAOT.linux-arm64.11.0.0-preview.1.26065.113 and that one has these. Microsoft.NETCore.App.Runtime.NativeAOT.ios-arm64.11.0.0-preview.1.26065.113 doesn't have these. > > So looks to be iDevice specific. I can't build these things locally as I don't have a mac.</body></comment_new> > <comment_new><author>@steveisok</author><body> > In the local build, it looks like coreclr and nativeaot are supposed to look back to `artifacts/bin/coreclr/ios.<arch>.<config>/sharedFramework` for the native lib artifacts. NativeAOT does not appear to be doing that, hence the reason the static libs aren't included. </body></comment_new> > <comment_new><author>@steveisok</author><body> > `ResolveLibrariesRuntimeFilesFromLocalBuild` typically copies all the libraries and native lib bits. There's a step to exclude some native bits if the runtime is coreclr or nativeaot because they are supposed to be accounted for in `ResolveRuntimeFilesFromLocalBuild`. That's not happening for nativeaot due to `BuildNativeAOTRuntimePack=true`. </body></comment_new> > <comment_new><author>@steveisok</author><body> > @kotlarmilos if you want, I can fix it. It's no problem, so let me know.</body></comment_new> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes #123253 <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey). --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: steveisok <471438+steveisok@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
NativeAOT runtime packs for iOS and other Apple mobile platforms were missing required static libraries (libSystem.Globalization.Native.a, libSystem.IO.Compression.Native.a, libSystem.Native.a, libbrotli*.a) starting in version 11.0.0-alpha.1.26065.101.
Changes
Modified
eng/liveBuilds.targetsin theResolveLibrariesRuntimeFilesFromLocalBuildtarget:BuildNativeAOTRuntimePack != 'true'condition to theExcludeNativeLibrariesRuntimeFilesitem for Apple mobile platformsRationale: Regular CoreCLR packs retrieve these libraries from the CoreCLR shared framework directory, so they're excluded from LibrariesRuntimeFiles to avoid duplicates. NativeAOT packs do not reach back into CoreCLR shared framework artifacts and require these libraries from LibrariesRuntimeFiles.
Testing
The fix will be validated when NativeAOT runtime packs for Apple mobile platforms are built in CI/CD, verifying that the static libraries are included in the package output.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.