-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Cmdpal: Fix cmdpal toolkit restore failure for slnx in release pipeline #44152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
8104e7f to
c85520b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a pipeline build failure in the Command Palette SDK build script by switching from nuget.exe restore to MSBuild-based restore for the PowerToys.slnx solution file. NuGet version 6 doesn't recognize the .slnx file format, which will be supported in NuGet version 7. Additionally, the Microsoft.Windows.SDK.BuildTools package version is updated to 10.0.26100.6901 to align with the version already specified in Directory.Packages.props.
Key changes:
- Replace
nuget.exe restorewithmsbuild.exe /t:restore /p:RestorePackagesConfig=truefor .slnx compatibility - Update Microsoft.Windows.SDK.BuildTools from version 10.0.26100.4188 to 10.0.26100.6901 across packages.config and project files
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/modules/cmdpal/extensionsdk/nuget/BuildSDKHelper.ps1 | Replaced nuget restore with MSBuild restore command for .slnx solution; added $solutionPath variable |
| src/modules/cmdpal/extensionsdk/Microsoft.CommandPalette.Extensions/packages.config | Updated Microsoft.Windows.SDK.BuildTools version to align with repo-wide version |
| src/modules/cmdpal/extensionsdk/Microsoft.CommandPalette.Extensions/Microsoft.CommandPalette.Extensions.vcxproj | Updated WindowsSdkBuildToolsNuget path to reference new SDK version |
| & $nugetPath restore (Join-Path $PSScriptRoot "..\..\..\..\..\PowerToys.slnx") | ||
| $restoreArgs = @( | ||
| $solutionPath | ||
| "/t:Restore" |
Copilot
AI
Dec 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The target name should use lowercase /t:restore to match the established pattern used consistently throughout the codebase (see tools/build/build-common.ps1:90 and tools/build/build-installer.ps1:144). While MSBuild target names are case-insensitive, following the existing convention improves code consistency.
Suggested change:
"/t:restore"| "/t:Restore" | |
| "/t:restore" |
| "/t:Restore" | ||
| "/p:RestorePackagesConfig=true" | ||
| ) | ||
| & $msbuildPath $restoreArgs |
Copilot
AI
Dec 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MSBuild restore command should check $LASTEXITCODE and exit on failure, following the pattern used in tools/build/build-common.ps1:71-75. Without this check, if the restore fails, the script will continue to the build step, potentially causing confusing downstream errors.
Suggested addition after line 65:
if ($LASTEXITCODE -ne 0) {
Write-Error "NuGet restore failed for $solutionPath"
Exit $LASTEXITCODE
}| & $msbuildPath $restoreArgs | |
| & $msbuildPath $restoreArgs | |
| if ($LASTEXITCODE -ne 0) { | |
| Write-Error "NuGet restore failed for $solutionPath" | |
| Exit $LASTEXITCODE | |
| } |
Summary of the Pull Request
Error from pipeline:
Invalid input 'PowerToys.slnx'. The file type was not recognized.
MSBuild version 17.14.23+b0019275e for .NET Framework
Build started 12/8/2025 6:33:14 AM.
Nuget support for slnx will be ready in nuget version 7, so use msbuild to restore
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed