mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-08-29 10:09:43 +02:00
## Summary of the Pull Request Pins the .NET 10 SDK used by CI to `10.0.302`, whose `10.0.10` runtime matches the .NET servicing packages declared in `Directory.Packages.props`. This prevents dependency-audit failures caused by the floating `10.0` SDK channel advancing independently of the repository's package versions. ## PR Checklist - [x] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [x] **Tests:** N/A for this pipeline-only configuration change; validation is documented below ## Detailed Description of the Pull Request / Additional comments The CI template previously passed `10.0` to `dotnet-install.ps1 -Channel`. After .NET 10.0.11 became the latest release, CI combined SDK-provided 10.0.11 runtime assets with NuGet runtime assets pinned to 10.0.10. `.pipelines/verifyDepsJsonLibraryVersions.ps1` consequently detected different `System.Private.Windows.GdiPlus.dll` file versions across generated `.deps.json` files. This PR: - Adds the optional `exactVersion` parameter to `.pipelines/v2/templates/steps-ensure-dotnet-version.yml`. Existing callers continue using channel-based installation when the parameter is omitted. - Sets `exactVersion` to `10.0.302` in `.pipelines/v2/templates/job-build-project.yml`; that SDK contains the 10.0.10 runtime. - Defines `DotNetRuntimePackageVersion` once in `Directory.Packages.props` and references it from all 23 .NET servicing packages. - Adds cross-referenced comments so future SDK and runtime package servicing updates remain aligned. ## Validation Steps Performed - Confirmed the centralization assertion failed before the change with 23 literal `10.0.10` package versions and passed afterward with 23 `$(DotNetRuntimePackageVersion)` references and no remaining literals. - Restored `PowerToys.slnx` successfully using `tools/build/build.ps1 -RestoreOnly`. - Ran `dotnet-install.ps1 -Version 10.0.302 -DryRun` and confirmed that it resolves the exact `10.0.302` SDK payload. - Parsed `Directory.Packages.props` successfully as XML. - Ran `git diff --check` successfully. - Azure Pipelines validation remains pending while this PR is in Draft. --------- Co-authored-by: Yu Leng <yuleng@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
41 lines
1.4 KiB
YAML
41 lines
1.4 KiB
YAML
parameters:
|
|
- name: version
|
|
type: string
|
|
default: "10.0"
|
|
- name: exactVersion
|
|
type: string
|
|
default: ""
|
|
- name: sdk
|
|
type: boolean
|
|
default: false
|
|
|
|
# You might be wondering, "Why didn't they use UseDotNet?"
|
|
# Azure Pipelines is practically unmaintained, that's why.
|
|
#
|
|
# "[BUG]: UseDotNet task installs x86 build on Windows arm64"
|
|
# https://github.com/microsoft/azure-pipelines-tasks/issues/20300
|
|
#
|
|
# Herein we replicate 90% of the meaningful logic in that task.
|
|
steps:
|
|
- pwsh: |-
|
|
curl.exe -J -L -O "https://dot.net/v1/dotnet-install.ps1"
|
|
if (-not (Test-Path dotnet-install.ps1)) {
|
|
Write-Error "Failed to download dotnet-install.ps1"
|
|
exit 1
|
|
}
|
|
$NEW_DOTNET_ROOT = "$(Agent.ToolsDirectory)\dotnet"
|
|
$EXACT_VERSION = "${{parameters.exactVersion}}"
|
|
if ([string]::IsNullOrWhiteSpace($EXACT_VERSION)) {
|
|
& ./dotnet-install.ps1 -Channel "${{parameters.version}}" -InstallDir $NEW_DOTNET_ROOT
|
|
} else {
|
|
& ./dotnet-install.ps1 -Version $EXACT_VERSION -InstallDir $NEW_DOTNET_ROOT
|
|
}
|
|
Write-Host "##vso[task.setvariable variable=DOTNET_ROOT]${NEW_DOTNET_ROOT}"
|
|
Write-Host "##vso[task.prependpath]${NEW_DOTNET_ROOT}"
|
|
Remove-Item dotnet-install.ps1 -ErrorAction:Ignore
|
|
${{ if eq(parameters.sdk, true) }}:
|
|
displayName: "Install .NET ${{parameters.version}} SDK"
|
|
${{ else }}:
|
|
displayName: "Install .NET ${{parameters.version}}"
|
|
retryCountOnTaskFailure: 3
|