Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

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.

<!-- 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.

Original prompt

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)

@MichalStrehovsky > 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.</comment_new>
<comment_new>@steveisok
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. </comment_new>
<comment_new>@steveisok
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. </comment_new>
<comment_new>@steveisok
@kotlarmilos if you want, I can fix it. It's no problem, so let me know.</comment_new>


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…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
Copilot AI requested a review from steveisok January 16, 2026 19:00
@steveisok steveisok marked this pull request as ready for review January 16, 2026 23:34
Copilot AI review requested due to automatic review settings January 16, 2026 23:34
@steveisok steveisok merged commit 14a9c69 into main Jan 16, 2026
153 of 158 checks passed
@steveisok steveisok deleted the copilot/fix-missing-static-libraries branch January 16, 2026 23:34
Copy link
Contributor

Copilot AI left a 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 ExcludeNativeLibrariesRuntimeFiles in eng/liveBuilds.targets to exempt NativeAOT runtime packs from excluding native static libraries
  • Updated the accompanying comment to clarify that the exclusion does not apply to NativeAOT packs

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.

Latest .NET 11 NativeAOT packs missing some static libraries

3 participants