Skip to content

[TrimmableTypeMap] Package CoreCLR preserve list in SDK pack#11142

Open
simonrozsival wants to merge 1 commit intomainfrom
dev/simonrozsival/trimmable-preserve-list-packaging
Open

[TrimmableTypeMap] Package CoreCLR preserve list in SDK pack#11142
simonrozsival wants to merge 1 commit intomainfrom
dev/simonrozsival/trimmable-preserve-list-packaging

Conversation

@simonrozsival
Copy link
Copy Markdown
Member

@simonrozsival simonrozsival commented Apr 17, 2026

Part 1 of the split of #11091

Problem

The trimmable typemap's CoreCLR preserve list (Trimmable.CoreCLR.xml) was not reliably packaged in the Microsoft.Android.Sdk pack. The file lives in src/Microsoft.Android.Sdk.ILLink/PreserveLists/ but the SDK-pack glob only reached src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/PreserveLists/. Local inner builds also saw a different file set than CI.

Fix

  • build-tools/create-packs/Microsoft.Android.Sdk.proj: include src/Microsoft.Android.Sdk.ILLink/PreserveLists/** in the pack.
  • src/Microsoft.Android.Sdk.ILLink/Microsoft.Android.Sdk.ILLink.csproj: link the SDK-local PreserveLists into the project output so local inner builds see the same files as the CI SDK pack.
  • Add TrimmableTypeMap_PreserveList_IsPackagedInSdk regression test that asserts Trimmable.CoreCLR.xml is present in the preview SDK pack.

Scope

Pure packaging fix — 3 files, 14 insertions.

The trimmable typemap's CoreCLR preserve list (Trimmable.CoreCLR.xml) was
not reliably packaged in the Microsoft.Android.Sdk pack. It lived in
src/Microsoft.Android.Sdk.ILLink/PreserveLists/ but was only visible to
the ILLink project — the Sdk pack picked files from
src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/PreserveLists/.

Changes:
  * build-tools/create-packs/Microsoft.Android.Sdk.proj: include
    src/Microsoft.Android.Sdk.ILLink/PreserveLists/**.
  * src/Microsoft.Android.Sdk.ILLink/Microsoft.Android.Sdk.ILLink.csproj:
    link the SDK-local PreserveLists into the project's output so local
    inner-builds see the same files as the CI SDK pack.
  * Add TrimmableTypeMap_PreserveList_IsPackagedInSdk regression test
    asserting Trimmable.CoreCLR.xml is present in the preview SDK pack.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
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

Fixes SDK pack contents so the trimmable typemap’s CoreCLR trimmer descriptor is consistently available both in CI-produced packs and local inner builds of the SDK pack.

Changes:

  • Package src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/PreserveLists/** into the Microsoft.Android.Sdk.* pack under PreserveLists/.
  • Copy/link SDK-local PreserveLists/*.xml into Microsoft.Android.Sdk.ILLink output so local inner builds match pack contents.
  • Add a regression test asserting PreserveLists/Trimmable.CoreCLR.xml exists in the preview SDK pack.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/TrimmableTypeMapBuildTests.cs Adds regression test validating Trimmable.CoreCLR.xml is present in the SDK pack.
src/Microsoft.Android.Sdk.ILLink/Microsoft.Android.Sdk.ILLink.csproj Copies SDK PreserveLists XMLs into the local pack output layout for inner builds.
build-tools/create-packs/Microsoft.Android.Sdk.proj Ensures SDK PreserveLists are included in the generated SDK pack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copilot `copilot-cli` or other AIs were used to author this trimmable-type-map

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants