Skip to content

[release/11.0.1xx] [msbuild] Restore library bundle resources on incremental builds. Fixes #27233 - #27393

Open
rolfbjarne wants to merge 1 commit into
release/11.0.1xxfrom
dev/rolf/backport-pr-27244-release/11.0.1xx-2026-11-19
Open

rolfbjarne wants to merge 1 commit into
release/11.0.1xxfrom
dev/rolf/backport-pr-27244-release/11.0.1xx-2026-11-19

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

Write per-assembly bundle resource item caches again, preserving the metadata needed to restore resources when unpacking is skipped. Feed restored items back into resource collection so they are available when the application bundle is recreated.

Keep resource stamps and item caches in FileWrites on incremental builds, and include the caches in the unpack target outputs so missing caches trigger regeneration instead of silently dropping resources.

Add task coverage for original and legacy resource metadata and empty caches, plus app-level regressions that repeatedly recreate the bundle while retaining intermediates.

Fixes #27233

🤖 Pull request created by Copilot


Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com

Backport of #27244.

#27233 (#27244)

Write per-assembly bundle resource item caches again, preserving the metadata needed to restore resources when unpacking is skipped. Feed restored items back into resource collection so they are available when the application bundle is recreated.

Keep resource stamps and item caches in FileWrites on incremental builds, and include the caches in the unpack target outputs so missing caches trigger regeneration instead of silently dropping resources.

Add task coverage for original and legacy resource metadata and empty caches, plus app-level regressions that repeatedly recreate the bundle while retaining intermediates.

Fixes #27233

🤖 Pull request created by Copilot

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@rolfbjarne rolfbjarne added backported ready-to-review This PR is ready to review/merge. labels Nov 19, 2026
Copilot AI balanced review requested due to automatic review settings November 19, 2026 09:14

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 reported for the referenced-library resource restoration backport.

No open issues 🎉

What changed in this PR

Backports #27244 to release/11.0.1xx, addressing #27233 by restoring referenced-library bundle resources when incremental builds skip unpacking and the application bundle is recreated.

Changes:

  • Restore per-assembly resource caches with metadata for original and legacy resources.
  • Reload cached resources and track caches and stamps for incremental builds and cleanup.
  • Add regression coverage for missing and empty caches, metadata preservation, and repeated bundle recreation across Apple platforms.
File Description
tests/​msbuild/​Xamarin.MacDev.Tasks.Tests/​TaskTests/​UnpackLibraryResourcesTests.cs Tests cache metadata, empty caches, and resource preservation when one library’s cache is missing.
tests/​dotnet/​UnitTests/​ProjectTest.cs Tests repeated bundle recreation while retaining build intermediates.
msbuild/​Xamarin.Shared/​Xamarin.Shared.targets Restores cached resource items and tracks cache and stamp outputs.
msbuild/​Xamarin.MacDev.Tasks/​Tasks/​UnpackLibraryResources.cs Writes per-assembly bundle resource caches and reports their paths.

Review effort: Balanced

This branch has not been deployed

No deployments
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.

3 participants