From 0d794b4a75ea6e2e2080ffbfc09733fbb956a59f Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Tue, 24 Mar 2026 08:32:35 +0000
Subject: [PATCH 1/2] Fix cross-compiled bundles missing DCP for win-arm64,
linux-arm64, linux-musl-x64
Bundle.proj's _RestoreDcpPackage target now maps TargetRid to BuildOs/BuildArch
and passes them to the AppHost restore, ensuring the correct DCP NuGet package
is downloaded for the target platform instead of the build machine's platform.
CreateLayout now throws when DCP is not found instead of silently producing
a broken bundle that would fail layout validation at runtime.
Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/a71f0181-f863-4d63-b275-47c8eb198dee
---
eng/Bundle.proj | 17 +++++++++++++++--
tools/CreateLayout/Program.cs | 6 ++++--
2 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/eng/Bundle.proj b/eng/Bundle.proj
index 626184870d4..41e1f825c1c 100644
--- a/eng/Bundle.proj
+++ b/eng/Bundle.proj
@@ -106,9 +106,22 @@
<_DcpBinlog Condition="'$(ContinuousIntegrationBuild)' == 'true'">-bl:$(ArtifactsLogDir)RestoreDcp.binlog
+
+
+ <_BundleBuildOs Condition="$(TargetRid.StartsWith('win-'))">windows
+ <_BundleBuildOs Condition="$(TargetRid.StartsWith('osx-'))">darwin
+ <_BundleBuildOs Condition="$(TargetRid.StartsWith('linux-musl-'))">linux-musl
+ <_BundleBuildOs Condition="'$(_BundleBuildOs)' == '' and $(TargetRid.StartsWith('linux-'))">linux
+
+ <_BundleBuildArch Condition="$(TargetRid.EndsWith('-x64'))">amd64
+ <_BundleBuildArch Condition="$(TargetRid.EndsWith('-arm64'))">arm64
+ <_BundleBuildArch Condition="$(TargetRid.EndsWith('-x86'))">386
-
-
+
+
diff --git a/tools/CreateLayout/Program.cs b/tools/CreateLayout/Program.cs
index b04ec44e7a1..93f5af57b24 100644
--- a/tools/CreateLayout/Program.cs
+++ b/tools/CreateLayout/Program.cs
@@ -189,8 +189,10 @@ private Task CopyDcpAsync()
var dcpPath = FindDcpPath();
if (dcpPath is null)
{
- Log(" WARNING: DCP not found. Skipping.");
- return Task.CompletedTask;
+ throw new InvalidOperationException(
+ $"DCP package not found for RID '{_rid}'. " +
+ $"Ensure the DCP NuGet package for the target platform is restored before running CreateLayout. " +
+ $"A bundle without DCP would fail layout validation at runtime.");
}
var dcpDir = Path.Combine(_outputPath, "dcp");
From d5b2bea3cc223d50d77be61da53991e908975826 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Tue, 24 Mar 2026 08:34:05 +0000
Subject: [PATCH 2/2] Add validation for unrecognized RID patterns and document
supported format
Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/a71f0181-f863-4d63-b275-47c8eb198dee
---
eng/Bundle.proj | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/eng/Bundle.proj b/eng/Bundle.proj
index 41e1f825c1c..4f6c79f644a 100644
--- a/eng/Bundle.proj
+++ b/eng/Bundle.proj
@@ -110,7 +110,10 @@
+ be missing DCP because the default BuildOs/BuildArch resolve to the build machine.
+
+ Supported RID format: {os}-{arch} where os is win/osx/linux/linux-musl
+ and arch is x64/arm64/x86. Update this mapping when adding new RID patterns. -->
<_BundleBuildOs Condition="$(TargetRid.StartsWith('win-'))">windows
<_BundleBuildOs Condition="$(TargetRid.StartsWith('osx-'))">darwin
<_BundleBuildOs Condition="$(TargetRid.StartsWith('linux-musl-'))">linux-musl
@@ -120,6 +123,8 @@
<_BundleBuildArch Condition="$(TargetRid.EndsWith('-arm64'))">arm64
<_BundleBuildArch Condition="$(TargetRid.EndsWith('-x86'))">386
+