Skip to content

[release/10.0.1xx] [linker] Restrict globalization symbol alias to MonoVM. Fixes #26876 - #27103

Merged
rolfbjarne merged 8 commits into
release/10.0.1xxfrom
dev/rolf/backport-pr-26903-release/10.0.1xx-2026-10-28
Nov 13, 2026
Merged

rolfbjarne merged 8 commits into
release/10.0.1xxfrom
dev/rolf/backport-pr-26903-release/10.0.1xx-2026-10-28

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

ListExportedSymbols treats System.Globalization.Native as an alias for symbols provided by libmonosgen-2.0. Applying that exception to NativeAOT forces references to globalization functions even when invariant globalization omits their native library, causing undefined-symbol errors during native linking.

Limit the alias to MonoVM so NativeAOT relies on the direct references emitted by its compiler. Add invariant-globalization regression cases for all four Apple platforms with assembly preparation enabled and disabled, and document the runtime-specific symbol handling.

Fixes #26876

🤖 Pull request created by Copilot


Co-authored-by: Copilot App [email protected]

Backport of #26903.

…26903)

ListExportedSymbols treats System.Globalization.Native as an alias for symbols provided by libmonosgen-2.0. Applying that exception to NativeAOT forces references to globalization functions even when invariant globalization omits their native library, causing undefined-symbol errors during native linking.

Limit the alias to MonoVM so NativeAOT relies on the direct references emitted by its compiler. Add invariant-globalization regression cases for all four Apple platforms with assembly preparation enabled and disabled, and document the runtime-specific symbol handling.

Fixes #26876

🤖 Pull request created by Copilot

---------

Co-authored-by: Copilot App <[email protected]>
@rolfbjarne rolfbjarne added backported ready-to-review This PR is ready to review/merge. labels Oct 28, 2026
Copilot AI balanced review requested due to automatic review settings October 28, 2026 09:56
@rolfbjarne
rolfbjarne requested a review from dalexsoto as a code owner October 28, 2026 09:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new tests fail before building because the TrimmerMetadata fixture is missing, and they lack NativeAOT invariant-globalization coverage for the undefined-symbol failure the guard addresses.

2 open issues
What changed in this PR

This backport addresses #26876 by restricting the globalization symbol alias to MonoVM, avoiding unwanted native symbol references in NativeAOT builds with invariant globalization.

Changes:

  • Limit globalization symbol preservation to MonoVM.
  • Use /dev/null for empty native export lists and add export-list selection tests.
  • Document runtime-specific symbol handling and remote-build behavior.
File Description
tools/​linker/​MonoTouch.Tuner/​ListExportedSymbols.cs Restricts the globalization alias to MonoVM.
tests/​dotnet/​UnitTests/​ProjectTest.cs Adds empty and nonempty export-list test cases.
dotnet/​targets/​Xamarin.Shared.Sdk.targets Selects /dev/null when no native symbols need exporting.
docs/​code/​native-symbols.md Explains runtime aliases and empty export-list handling.

Review effort: Balanced

Comment thread tests/dotnet/UnitTests/ProjectTest.cs Resolved
@vs-mobiletools-engineering-service2

This comment has been minimized.

dalexsoto
dalexsoto previously approved these changes Oct 28, 2026
@vs-mobiletools-engineering-service2

This comment has been minimized.

…balization test

Add the tests/dotnet/TrimmerMetadata test fixture (including the TestReferenceNativeSymbol ReferenceNativeSymbol item) required by DotNetProjectTest.ExportedSymbolsFile, and include RuntimeConfigurationTest.NativeAotInvariantGlobalization from PR #26903.

Co-authored-by: Copilot App <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 28, 2026 16:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Both new test cases fail on CI because BinLog.TryFindPropertyValue cannot read the target-assigned _ExportedSymbolsFile value without property tracking, even when the build succeeds.

2 open issues
1 previously missed issue

In code that hasn't changed since last review

Medium severity Use DotNet.GetProperty to verify _ExportedSymbolsFile

tests/​dotnet/​UnitTests/​ProjectTest.cs:3001

❌ Testing — _ExportedSymbolsFile is assigned inside a target, but BinLog.TryFindPropertyValue does not handle its Set Property: messages. Without property tracking, as on CI, both new cases fail this assertion even when the build succeeds. Use DotNet.GetProperty with target: "Build" to build the project and query the final property value directly.

Review effort: Balanced

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

dalexsoto
dalexsoto previously approved these changes Oct 28, 2026
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

On release/10.0.1xx (.NET 10), CoreCLR (UseMonoRuntime=false) is not available for ios-arm64 (failing with NETSDK1082). Build TrimmerMetadata for iossimulator-arm64 with Registrar=dynamic and PrepareAssemblies=true so the unused platform assembly is trimmed away and the export list is empty unless TestReferenceNativeSymbol is set, and link Foundation explicitly for the generated main's NSAutoreleasePool usage.

Co-authored-by: Copilot App <[email protected]>
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

Copilot AI balanced review requested due to automatic review settings October 29, 2026 07:26
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

Copilot AI balanced review requested due to automatic review settings October 30, 2026 15:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the globalization-symbol and empty export-list fixes.

No open issues 🎉

Review effort: Balanced

@rolfbjarne
rolfbjarne enabled auto-merge (squash) October 30, 2026 15:24
@rolfbjarne rolfbjarne added the ready-to-review This PR is ready to review/merge. label Oct 30, 2026
@vs-mobiletools-engineering-service2

This comment has been minimized.

Copilot AI balanced review requested due to automatic review settings October 30, 2026 15:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the NativeAOT invariant-globalization linker backport.

No open issues 🎉

Review effort: Balanced

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

Copilot AI balanced review requested due to automatic review settings November 12, 2026 09:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the backported NativeAOT invariant-globalization linker fix.

No open issues 🎉

Review effort: Balanced

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

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

Pipeline on Agent
Hash: 6da5fa9a4fceaa8b235c21ed63d83b790bfbd650 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

❌ [CI Build #6da5fa9] Prepare .NET Release failed ❌

The following jobs reported a non-successful result:

Job Result
Sign NuGets ✅ Succeeded
Convert NuGet to MSI ❌ Failed
Push NuGets ⏭️ Skipped
📦 Signed NuGet packages (32 packages)

iOS

  • Microsoft.iOS.Ref.net10.0_27.2.27.2.10004.nupkg
  • Microsoft.iOS.Runtime.ios-arm64.net10.0_27.2.27.2.10004.nupkg
  • Microsoft.iOS.Runtime.ios.net10.0_27.2.27.2.10004.nupkg
  • Microsoft.iOS.Runtime.iossimulator-arm64.net10.0_27.2.27.2.10004.nupkg
  • Microsoft.iOS.Runtime.iossimulator-x64.net10.0_27.2.27.2.10004.nupkg
  • Microsoft.iOS.Sdk.net10.0_27.2.27.2.10004.nupkg
  • Microsoft.iOS.Templates.27.2.10004.nupkg
  • Microsoft.iOS.Windows.Sdk.net10.0_27.2.27.2.10004.nupkg
  • Microsoft.NET.Sdk.iOS.Manifest-10.0.100.27.2.10004.nupkg

MacCatalyst

  • Microsoft.MacCatalyst.Ref.net10.0_27.2.27.2.10004.nupkg
  • Microsoft.MacCatalyst.Runtime.maccatalyst-arm64.net10.0_27.2.27.2.10004.nupkg
  • Microsoft.MacCatalyst.Runtime.maccatalyst-x64.net10.0_27.2.27.2.10004.nupkg
  • Microsoft.MacCatalyst.Runtime.maccatalyst.net10.0_27.2.27.2.10004.nupkg
  • Microsoft.MacCatalyst.Sdk.net10.0_27.2.27.2.10004.nupkg
  • Microsoft.MacCatalyst.Templates.27.2.10004.nupkg
  • Microsoft.NET.Sdk.MacCatalyst.Manifest-10.0.100.27.2.10004.nupkg

macOS

  • Microsoft.macOS.Ref.net10.0_27.2.27.2.10004.nupkg
  • Microsoft.macOS.Runtime.osx-arm64.net10.0_27.2.27.2.10004.nupkg
  • Microsoft.macOS.Runtime.osx-x64.net10.0_27.2.27.2.10004.nupkg
  • Microsoft.macOS.Runtime.osx.net10.0_27.2.27.2.10004.nupkg
  • Microsoft.macOS.Sdk.net10.0_27.2.27.2.10004.nupkg
  • Microsoft.macOS.Templates.27.2.10004.nupkg
  • Microsoft.NET.Sdk.macOS.Manifest-10.0.100.27.2.10004.nupkg

tvOS

  • Microsoft.NET.Sdk.tvOS.Manifest-10.0.100.27.2.10004.nupkg
  • Microsoft.tvOS.Ref.net10.0_27.2.27.2.10004.nupkg
  • Microsoft.tvOS.Runtime.tvos-arm64.net10.0_27.2.27.2.10004.nupkg
  • Microsoft.tvOS.Runtime.tvos.net10.0_27.2.27.2.10004.nupkg
  • Microsoft.tvOS.Runtime.tvossimulator-arm64.net10.0_27.2.27.2.10004.nupkg
  • Microsoft.tvOS.Runtime.tvossimulator-x64.net10.0_27.2.27.2.10004.nupkg
  • Microsoft.tvOS.Sdk.net10.0_27.2.27.2.10004.nupkg
  • Microsoft.tvOS.Templates.27.2.10004.nupkg

Other

  • Sharpie.Bind.Tool.27.2.0.4.nupkg

Pipeline on Agent
Hash: 6da5fa9a4fceaa8b235c21ed63d83b790bfbd650 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #98841f0] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 210 tests passed 🎉

Tests counts

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ 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 5 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 (iOS): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 19 tests passed. [attempt 3] Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 19 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Golden Gate (27): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

✅ Linux build succeeded

Pipeline on Agent
Hash: 98841f0b87a7bd046a0c11e75e12bab483cf5848 [PR build]

@rolfbjarne
rolfbjarne merged commit 9b63f43 into release/10.0.1xx Nov 13, 2026
58 checks passed
@rolfbjarne
rolfbjarne deleted the dev/rolf/backport-pr-26903-release/10.0.1xx-2026-10-28 branch November 13, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backported ready-to-review This PR is ready to review/merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants