Skip to content

[main] Update dependencies from dotnet/dotnet#10873

Open
dotnet-maestro[bot] wants to merge 7 commits intomainfrom
darc-main-2b39dd91-77e1-464a-b705-d70468416845
Open

[main] Update dependencies from dotnet/dotnet#10873
dotnet-maestro[bot] wants to merge 7 commits intomainfrom
darc-main-2b39dd91-77e1-464a-b705-d70468416845

Conversation

@dotnet-maestro
Copy link
Contributor

@dotnet-maestro dotnet-maestro bot commented Mar 2, 2026

This pull request updates the following dependencies

From https://github.com/dotnet/dotnet

…301.4

On relative base path root
Microsoft.NET.Workload.Mono.ToolChain.Current.Manifest-11.0.100-preview.3 From Version 11.0.100-preview.3.26124.102 -> To Version 11.0.0-preview.3.26151.104
Microsoft.DotNet.Build.Tasks.Feed From Version 11.0.0-beta.26124.102 -> To Version 11.0.0-beta.26151.104
Microsoft.DotNet.Cecil From Version 0.11.5-preview.26124.102 -> To Version 0.11.5-preview.26151.104
Microsoft.NET.ILLink , Microsoft.NETCore.App.Ref From Version 11.0.0-preview.3.26124.102 -> To Version 11.0.0-preview.3.26151.104
Microsoft.NET.Sdk , Microsoft.NET.Workload.Emscripten.Current.Manifest-11.0.100-preview.3 , Microsoft.TemplateEngine.Authoring.Tasks From Version 11.0.100-preview.3.26124.102 -> To Version 11.0.100-preview.3.26151.104
In .NET 11, the SDK's ILLink target now populates ResolvedFileToPublish
with linked assemblies (via _LinkedResolvedFileToPublish) WITHOUT
RuntimeIdentifier metadata. Our _AndroidComputeIlcCompileInputs target
adds the same items WITH RuntimeIdentifier, but the ->Distinct() call in
_PrepareNativeAotAndroidAppInputs keeps the first occurrence — the one
from ILLink without the metadata.

The _ComputeFilesToPublishForRuntimeIdentifiers fixup (which stamps
RuntimeIdentifier on items that lack it) cannot help here because it runs
in its target body, after all DependsOnTargets complete — but the error
occurs inside the NativeCompile dependency chain, before the fixup runs.

Fix: add an Update operation on _PrivateAndroidNaotResolvedAssemblyFiles
that stamps RuntimeIdentifier on any items missing it, matching the
pattern already used in _ComputeFilesToPublishForRuntimeIdentifiers.

Fixes: XAGNALLAS7009
@jonathanpeppers jonathanpeppers added the copilot `copilot-cli` or other AIs were used to author this label Mar 2, 2026
jonathanpeppers and others added 3 commits March 2, 2026 16:13
In .NET 11, the SDK's ILLink target now populates ResolvedFileToPublish
with linked assemblies via _LinkedResolvedFileToPublish. Our
_AndroidComputeIlcCompileInputs target then adds the same assemblies
again, creating duplicates.

These duplicates flow to the outer build's ProcessAssemblies task (which
doesn't deduplicate), then to GetPerArchAssemblies which throws a
duplicate key exception for the same assembly name within an architecture.

Fix by removing any ILLink-added items from ResolvedFileToPublish before
re-adding them with explicit RuntimeIdentifier metadata. This is
backwards compatible - on older SDKs the Remove is a no-op.
In .NET 11+, dotnet/runtime PR #111514 changed NativeAOT's
ComputeLinkedFilesToPublish to run AfterTargets (instead of
BeforeTargets) on ComputeResolvedFilesToPublishList and added
_ComputeAssembliesToPostprocessOnPublish which does a Remove+Add
cycle on ResolvedFileToPublish to stamp PostprocessAssembly metadata.

Combined with ILLink's and Android's own Remove+Add cycles, this
leaves duplicate .dll items in ResolvedFileToPublish within the inner
build. When the outer build collects items from both RIDs, duplicates
within the same RID cause GetPerArchAssemblies to throw:
  error XAAMP7004: An item with the same key has already been added.
  Key: Java.Interop

Fix by adding a RemoveDuplicates step in
_ComputeFilesToPublishForRuntimeIdentifiers (the inner build's return
point to the outer build), gated to NativeAOT only. This catches
duplicates regardless of which upstream target created them.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jonathanpeppers jonathanpeppers requested a review from Copilot March 5, 2026 17:11
The RemoveDuplicates step in _ComputeFilesToPublishForRuntimeIdentifiers
already catches all duplicates in ResolvedFileToPublish, and lines 44-48
of that same target already stamp RuntimeIdentifier on items that lack
it. The Remove before Include here is no longer needed.

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants