[release/v7.5] Bring Release Changes from v7.6.0-preview.6#26963
Conversation
…Shell#26627) 1. Fix the conditions used in `release-MSIX-Publish.yml` 2. Update `build.psm1` to not install dotnet format tool for ADO build.
There was a problem hiding this comment.
Pull request overview
Backports build infrastructure changes to release/v7.5 to adjust bootstrap behavior in CI, specifically around locating dotnet and installing developer-only .NET global tools.
Changes:
- Ensures
Find-Dotnetis invoked prior to later bootstrap steps that may calldotnet. - Skips installing the
dotnet-formatglobal tool when running under Azure Pipelines ($env:TF_BUILD).
| # Ensure dotnet is available | ||
| Find-Dotnet |
There was a problem hiding this comment.
Find-Dotnet is now invoked unconditionally, which changes Start-PSBootstrap -Scenario Package behavior (it may emit warnings and potentially adjust PATH even though dotnet isn’t needed). Consider gating this call to scenarios that actually require dotnet (e.g., All/Both/DotNet/Tools) or moving it into the Tools and TF_BUILD blocks where dotnet is used.
| # Ensure dotnet is available | |
| Find-Dotnet | |
| # Ensure dotnet is available only for scenarios that use it or in TF_BUILD | |
| if ($Scenario -in 'All', 'Both', 'DotNet', 'Tools' -or $env:TF_BUILD) { | |
| Find-Dotnet | |
| } |
| Write-LogGroupStart -Title "Install .NET Global Tools" | ||
| Write-Log -message "Installing .NET global tools" | ||
|
|
||
| # Install dotnet-format | ||
| Write-Verbose -Verbose "Installing dotnet-format global tool" | ||
| Start-NativeExecution { | ||
| dotnet tool install --global dotnet-format | ||
| # Install dotnet-format | ||
| Write-Verbose -Verbose "Installing dotnet-format global tool" | ||
| Start-NativeExecution { | ||
| dotnet tool install --global dotnet-format | ||
| } | ||
| Write-LogGroupEnd -Title "Install .NET Global Tools" |
There was a problem hiding this comment.
The "Install .NET Global Tools" log group isn’t protected with a try/finally. If dotnet tool install fails (and Start-NativeExecution throws), the group won’t be closed, which can break log grouping in CI. Wrap the body in try { ... } finally { Write-LogGroupEnd ... }.
Backport of #26627 to release/v7.5
Triggered by @adityapatwardhan on behalf of @jshigetomi
Original CL Label: CL-BuildPackaging
/cc @PowerShell/powershell-maintainers
Impact
REQUIRED: Choose either Tooling Impact or Customer Impact (or both). At least one checkbox must be selected.
Tooling Impact
Modifies Start-PSBootstrap in build.psm1 to skip installing dotnet-format global tool in CI (TF_BUILD) environments and moves Find-Dotnet call outside the conditional block.
Customer Impact
Regression
REQUIRED: Check exactly one box.
This is not a regression.
Testing
N/A - Build infrastructure change. Can only be verified interactively or during CI runs. Original PR was tested in CI.
Risk
REQUIRED: Check exactly one box.
Only changes dotnet tool installation logic in build.psm1 to skip installing dotnet-format in CI environments. No runtime or product code changes.
Merge Conflicts
Conflict in .pipelines/templates/release-MSIX-Publish.yml resolved by keeping the existing release/v7.5 version. The YAML condition syntax fix (from '$(VAR)' to variables['VAR']) was already present in release/v7.5. Only the build.psm1 changes apply.