Skip to content

Commit db444f8

Browse files
authored
Merge pull request #16007 from eerhardt/MergeRelease13.2IntoMain
Merge release13.2 into main
2 parents 80b984c + c313d90 commit db444f8

File tree

111 files changed

+7471
-645
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+7471
-645
lines changed

.github/workflows/build-cli-native-archives.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,22 @@ on:
1313
targets:
1414
description: >
1515
JSON array of target objects to build. Each object must have 'os', 'runner', and 'rids' keys.
16-
Defaults to all platforms (linux-x64, win-x64, osx-arm64).
16+
Defaults to all platforms (linux-x64, linux-arm64, win-x64, win-arm64, osx-arm64).
1717
required: false
1818
type: string
1919
default: >-
2020
[
2121
{"os": "ubuntu-latest", "runner": "8-core-ubuntu-latest", "rids": "linux-x64"},
22+
{"os": "ubuntu-latest", "runner": "ubuntu-24.04-arm", "rids": "linux-arm64"},
2223
{"os": "windows-latest", "runner": "windows-latest", "rids": "win-x64"},
24+
{"os": "windows-latest", "runner": "windows-11-arm", "rids": "win-arm64"},
2325
{"os": "macos-latest", "runner": "macos-latest", "rids": "osx-arm64"}
2426
]
2527
2628
jobs:
2729

2830
build_cli_archives:
29-
name: Build CLI (${{ matrix.targets.os }})
31+
name: Build CLI (${{ matrix.targets.rids }})
3032
runs-on: ${{ matrix.targets.runner }}
3133
strategy:
3234
matrix:

.github/workflows/run-tests.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,15 @@ jobs:
164164
shell: pwsh
165165
run: |
166166
$runnerOs = "${{ runner.os }}"
167-
switch ($runnerOs) {
168-
'Linux' { $rid = 'linux-x64' }
169-
'macOS' { $rid = 'osx-arm64' }
170-
'Windows' { $rid = 'win-x64' }
171-
Default { Write-Error "Unknown runner.os '$runnerOs' for RID mapping"; exit 1 }
167+
$runnerArch = "${{ runner.arch }}"
168+
$rid = switch ("$runnerOs-$runnerArch") {
169+
'Linux-X64' { 'linux-x64' }
170+
'Linux-ARM64' { 'linux-arm64' }
171+
'Windows-X64' { 'win-x64' }
172+
'Windows-ARM64' { 'win-arm64' }
173+
'macOS-ARM64' { 'osx-arm64' }
174+
'macOS-X64' { 'osx-x64' }
175+
Default { Write-Error "Unknown runner OS/arch '$runnerOs-$runnerArch' for RID mapping"; exit 1 }
172176
}
173177
Write-Host "Using RID=$rid"
174178
"RID=$rid" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

.github/workflows/tests.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ jobs:
5050
versionOverrideArg: ${{ inputs.versionOverrideArg }}
5151
targets: '[{"os": "ubuntu-latest", "runner": "8-core-ubuntu-latest", "rids": "linux-x64"}]'
5252

53+
build_cli_archive_linux_arm64:
54+
name: Build native CLI archive (Linux ARM64)
55+
uses: ./.github/workflows/build-cli-native-archives.yml
56+
with:
57+
versionOverrideArg: ${{ inputs.versionOverrideArg }}
58+
targets: '[{"os": "ubuntu-latest", "runner": "ubuntu-24.04-arm", "rids": "linux-arm64"}]'
59+
5360
# Per-OS CLI archive builds produce RID-specific DCP and Dashboard NuGets.
5461
# Split by OS so that test jobs can depend on just their platform's archive,
5562
# allowing Linux tests to start as soon as the Linux archive completes
@@ -61,13 +68,12 @@ jobs:
6168
versionOverrideArg: ${{ inputs.versionOverrideArg }}
6269
targets: '[{"os": "windows-latest", "runner": "windows-latest", "rids": "win-x64"}]'
6370

64-
build_cli_archive_windows_arm:
65-
if: ${{ github.event_name == 'pull_request' && github.repository_owner == 'microsoft' }}
71+
build_cli_archive_windows_arm64:
6672
name: Build native CLI archive (Windows ARM64)
6773
uses: ./.github/workflows/build-cli-native-archives.yml
6874
with:
6975
versionOverrideArg: ${{ inputs.versionOverrideArg }}
70-
targets: '[{"os": "windows-11-arm", "runner": "windows-11-arm", "rids": "win-arm64"}]'
76+
targets: '[{"os": "windows-latest", "runner": "windows-11-arm", "rids": "win-arm64"}]'
7177

7278
build_cli_archive_macos:
7379
name: Build native CLI archive (macOS)
@@ -204,7 +210,7 @@ jobs:
204210
name: Aspire CLI Starter Validation (${{ matrix.os.name }})
205211
runs-on: ${{ matrix.os.runner }}
206212
timeout-minutes: 15
207-
needs: [build_packages, build_cli_archive_windows, build_cli_archive_windows_arm]
213+
needs: [build_packages, build_cli_archive_windows, build_cli_archive_windows_arm64]
208214
if: ${{ github.event_name == 'pull_request' && github.repository_owner == 'microsoft' }}
209215
strategy:
210216
fail-fast: false
@@ -330,7 +336,9 @@ jobs:
330336
setup_for_tests,
331337
build_packages,
332338
build_cli_archive_linux,
339+
build_cli_archive_linux_arm64,
333340
build_cli_archive_windows,
341+
build_cli_archive_windows_arm64,
334342
build_cli_archive_macos,
335343
extension_tests_win,
336344
cli_starter_validation_windows,

eng/Bundle.proj

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,27 @@
106106
<Target Name="_RestoreDcpPackage">
107107
<PropertyGroup>
108108
<_DcpBinlog Condition="'$(ContinuousIntegrationBuild)' == 'true'">-bl:$(ArtifactsLogDir)RestoreDcp.binlog</_DcpBinlog>
109+
110+
<!-- Map TargetRid to DCP BuildOs/BuildArch so the AppHost restore downloads
111+
the correct DCP package for the target platform, not the build machine's platform.
112+
Without this, cross-compiled bundles (e.g., win-arm64 built on win-x64) would
113+
be missing DCP because the default BuildOs/BuildArch resolve to the build machine.
114+
115+
Supported RID format: {os}-{arch} where os is win/osx/linux/linux-musl
116+
and arch is x64/arm64/x86. Update this mapping when adding new RID patterns. -->
117+
<_BundleBuildOs Condition="$(TargetRid.StartsWith('win-'))">windows</_BundleBuildOs>
118+
<_BundleBuildOs Condition="$(TargetRid.StartsWith('osx-'))">darwin</_BundleBuildOs>
119+
<_BundleBuildOs Condition="$(TargetRid.StartsWith('linux-musl-'))">linux-musl</_BundleBuildOs>
120+
<_BundleBuildOs Condition="'$(_BundleBuildOs)' == '' and $(TargetRid.StartsWith('linux-'))">linux</_BundleBuildOs>
121+
122+
<_BundleBuildArch Condition="$(TargetRid.EndsWith('-x64'))">amd64</_BundleBuildArch>
123+
<_BundleBuildArch Condition="$(TargetRid.EndsWith('-arm64'))">arm64</_BundleBuildArch>
124+
<_BundleBuildArch Condition="$(TargetRid.EndsWith('-x86'))">386</_BundleBuildArch>
109125
</PropertyGroup>
110-
<Message Importance="high" Text="Restoring DCP package..." />
111-
<Exec Command="dotnet restore &quot;$(AppHostProjectPath)&quot; $(_DcpBinlog)" />
126+
<Error Condition="'$(_BundleBuildOs)' == '' or '$(_BundleBuildArch)' == ''"
127+
Text="Could not map TargetRid '$(TargetRid)' to DCP BuildOs/BuildArch. Supported RID patterns: win-x64, win-arm64, linux-x64, linux-arm64, linux-musl-x64, osx-x64, osx-arm64." />
128+
<Message Importance="high" Text="Restoring DCP package for $(TargetRid) (BuildOs=$(_BundleBuildOs), BuildArch=$(_BundleBuildArch))..." />
129+
<Exec Command="dotnet restore &quot;$(AppHostProjectPath)&quot; /p:BuildOs=$(_BundleBuildOs) /p:BuildArch=$(_BundleBuildArch) $(_DcpBinlog)" />
112130
</Target>
113131

114132
<Target Name="_RunCreateLayout">

playground/Stress/Stress.TelemetryService/Stress.TelemetryService.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<ItemGroup>
1515
<PackageReference Include="Grpc.Net.ClientFactory" />
16-
<PackageReference Include="Grpc.Tools" />
16+
<PackageReference Include="Grpc.Tools" VersionOverride="2.68.1" PrivateAssets="all" />
1717
<PackageReference Include="Google.Protobuf" />
1818
</ItemGroup>
1919

playground/TestShop/BasketService/BasketService.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
<ItemGroup>
1111
<PackageReference Include="Grpc.AspNetCore" />
12+
<PackageReference Include="Grpc.Tools" VersionOverride="2.68.1" PrivateAssets="all" />
1213
</ItemGroup>
1314

1415
<ItemGroup>

playground/TestShop/MyFrontend/MyFrontend.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@
1414
<PackageReference Include="Yarp.ReverseProxy" />
1515
<PackageReference Include="Google.Protobuf" />
1616
<PackageReference Include="Grpc.Net.ClientFactory" />
17-
<PackageReference Include="Grpc.Tools">
18-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
19-
<PrivateAssets>all</PrivateAssets>
20-
</PackageReference>
17+
<PackageReference Include="Grpc.Tools" VersionOverride="2.68.1" PrivateAssets="all" />
2118
</ItemGroup>
2219

2320
<ItemGroup>

src/Aspire.Cli/Aspire.Cli.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@
129129
<Compile Include="$(SharedDir)ConsoleLogs\SharedAIHelpers.cs" Link="ConsoleLogs\SharedAIHelpers.cs" />
130130
<Compile Include="$(SharedDir)ConsoleLogs\TimestampParser.cs" Link="ConsoleLogs\TimestampParser.cs" />
131131
<Compile Include="$(SharedDir)ConsoleLogs\UrlParser.cs" Link="ConsoleLogs\UrlParser.cs" />
132+
<Compile Include="$(SharedDir)NpmVersionHelper.cs" Link="Utils\NpmVersionHelper.cs" />
132133
</ItemGroup>
133134

134135
<ItemGroup>

src/Aspire.Cli/Bundles/BundleService.cs

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,41 @@ internal static void CleanLayoutDirectories(string layoutPath)
198198
}
199199

200200
/// <summary>
201-
/// Gets the assembly informational version of the current CLI binary.
201+
/// Gets a fingerprint for the current CLI bundle.
202202
/// Used as the version marker to detect when re-extraction is needed.
203203
/// </summary>
204-
internal static string GetCurrentVersion()
204+
internal static string GetCurrentVersion(string? processPath = null)
205205
{
206-
return VersionHelper.GetDefaultTemplateVersion();
206+
var version = VersionHelper.GetDefaultTemplateVersion();
207+
processPath ??= Environment.ProcessPath;
208+
209+
if (string.IsNullOrEmpty(processPath))
210+
{
211+
return version;
212+
}
213+
214+
try
215+
{
216+
var fileInfo = new FileInfo(processPath);
217+
if (!fileInfo.Exists)
218+
{
219+
return version;
220+
}
221+
222+
return $"{version}|{fileInfo.Length}|{fileInfo.LastWriteTimeUtc.Ticks}";
223+
}
224+
catch (IOException)
225+
{
226+
return version;
227+
}
228+
catch (UnauthorizedAccessException)
229+
{
230+
return version;
231+
}
232+
catch (NotSupportedException)
233+
{
234+
return version;
235+
}
207236
}
208237

209238
/// <summary>

src/Aspire.Cli/Layout/LayoutProcessRunner.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,9 @@
33

44
using System.Text;
55
using Aspire.Cli.DotNet;
6-
using Aspire.Shared;
76

87
namespace Aspire.Cli.Layout;
98

10-
/// <summary>
11-
/// Helper to detect the current runtime identifier.
12-
/// Delegates to shared BundleDiscovery for consistent behavior.
13-
/// </summary>
14-
internal static class RuntimeIdentifierHelper
15-
{
16-
/// <summary>
17-
/// Gets the current platform's runtime identifier.
18-
/// </summary>
19-
public static string GetCurrent() => BundleDiscovery.GetCurrentRuntimeIdentifier();
20-
21-
/// <summary>
22-
/// Gets the archive extension for the current platform.
23-
/// </summary>
24-
public static string GetArchiveExtension() => BundleDiscovery.GetArchiveExtension();
25-
}
26-
279
/// <summary>
2810
/// Runs processes using layout tools via an <see cref="IProcessExecutionFactory"/>.
2911
/// </summary>

0 commit comments

Comments
 (0)