Exclude satellite assemblies from _PostTrimmingPipeline#11086
Open
Exclude satellite assemblies from _PostTrimmingPipeline#11086
Conversation
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
Contributor
There was a problem hiding this comment.
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
_PostTrimmingAssemblyinputs to_PostTrimmingPipelineto only include@(ResolvedFileToPublish)items withPostprocessAssembly=true. - Added an integration test that logs
_PostTrimmingAssemblyinputs 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. |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/PackagingTest.cs
Show resolved
Hide resolved
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/PackagingTest.cs
Show resolved
Hide resolved
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>
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/PackagingTest.cs
Outdated
Show resolved
Hide resolved
…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>
simonrozsival
approved these changes
Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_PostTrimmingAssemblyin_PostTrimmingPipelineto only include items with%(PostprocessAssembly) == 'true', excluding satellite assemblies (.resources.dll) that retain paths in the shared NuGet cacheIOExceptionwhen parallel multi-RID builds contend forReadWritelocks on the same cached satellite assembly filesFixes #11085