Skip to content

Exclude satellite assemblies from _PostTrimmingPipeline#11086

Open
sbomer wants to merge 3 commits intomainfrom
dev/sbomer/satellite-fix
Open

Exclude satellite assemblies from _PostTrimmingPipeline#11086
sbomer wants to merge 3 commits intomainfrom
dev/sbomer/satellite-fix

Conversation

@sbomer
Copy link
Copy Markdown
Member

@sbomer sbomer commented Apr 8, 2026

Summary

  • Filter _PostTrimmingAssembly in _PostTrimmingPipeline to only include items with %(PostprocessAssembly) == 'true', excluding satellite assemblies (.resources.dll) that retain paths in the shared NuGet cache
  • Prevents IOException when parallel multi-RID builds contend for ReadWrite locks on the same cached satellite assembly files

Fixes #11085

The _PostTrimmingPipeline target was including all .dll files from
ResolvedFileToPublish, including satellite assemblies (.resources.dll)
from the shared NuGet package cache. PostTrimmingPipeline opens these
with ReadWrite access, causing IOException when parallel multi-RID
builds contend for locks on the same cached files.

Filter _PostTrimmingAssembly to only include items where
PostprocessAssembly metadata is 'true', which excludes satellite
assemblies that ILLink does not process.

Fixes: #11085
Copilot AI review requested due to automatic review settings April 8, 2026 17:46
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

This PR prevents satellite .resources.dll assemblies from being passed into the _PostTrimmingPipeline, avoiding file-lock contention when parallel multi-RID builds access satellite assemblies from the shared NuGet cache.

Changes:

  • Filtered _PostTrimmingAssembly inputs to _PostTrimmingPipeline to only include @(ResolvedFileToPublish) items with PostprocessAssembly=true.
  • Added an integration test that logs _PostTrimmingAssembly inputs and asserts satellite assemblies are excluded.

Reviewed changes

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

File Description
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/PackagingTest.cs Adds a test validating satellite assemblies aren’t included in _PostTrimmingAssembly after trimming.
src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.LlvmIr.targets Filters _PostTrimmingPipeline input assemblies using PostprocessAssembly=true metadata to exclude satellites.

Address review feedback: verify satellite assemblies (.resources.dll) are
actually present in ResolvedFileToPublish before asserting they are excluded
from _PostTrimmingAssembly. This ensures the test is actually exercising the
scenario and won't pass trivially if satellite assemblies are never packaged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
sbomer

This comment was marked as duplicate.

…line

The previous assertion checked ContainsText for each string independently,
which could match them on different lines. Now iterates lines and checks
both strings appear on the same line, matching the pattern used for the
negative DIAG_PTA check.

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

Avoid passing satellite assemblies to post-trimming pipeline

3 participants