From 740e68e07440863116cdcb03227b0a1a3af9cfc6 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Thu, 6 Nov 2025 19:05:24 -0600 Subject: [PATCH] build: remove SHINE pool image override (to enable Server 2022) (#43287) I am changing the default build pool image from Windows Server 2019 to Server 2022, as the 2019 images are deprecated and their use will become a permanent error soon. However, I cannot do that while PowerToys contains build image overrides. These overrides prevent it from choosing the Server 2022 images. As a drive-by, I fixed the following issues: - `NUGET_PACKAGES` was being read from the ambient environment. It was used in the package cache _and_ in the WIX projects directly (!). To make the build more predictable, we now set it during build time. - We _still_ had build step conditions that resulted in extra work being done during build failure. - The release builds now produce numbered failure log artifacts just like the CI builds do. - I have adjusted the default disk configuration to give enough space to `C:\`, so we no longer need the work directory override or custom data disk. The screenshot below is from a test run where I overrode the pool image to be `SHINE-VS17-Latest-2022`. We do not want to do that in the final configuration, so I had to revert that change. image --- .pipelines/v2/release.yml | 4 ---- .pipelines/v2/templates/job-build-project.yml | 11 ++++++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.pipelines/v2/release.yml b/.pipelines/v2/release.yml index e8cc7d5ed8..71f80f574b 100644 --- a/.pipelines/v2/release.yml +++ b/.pipelines/v2/release.yml @@ -52,8 +52,6 @@ extends: name: SHINE-INT-S ${{ if eq(parameters.useVSPreview, true) }}: demands: ImageOverride -equals SHINE-VS17-Preview - ${{ else }}: - image: SHINE-VS17-Latest os: windows sdl: tsa: @@ -75,7 +73,6 @@ extends: name: SHINE-INT-L demands: # Our INT agents have a large disk mounted at P:\ - - WorkFolder -equals P:\_work - ${{ if eq(parameters.useVSPreview, true) }}: - ImageOverride -equals SHINE-VS17-Preview os: windows @@ -126,7 +123,6 @@ extends: parameters: pool: name: SHINE-INT-L - image: SHINE-VS17-Latest os: windows official: true codeSign: true diff --git a/.pipelines/v2/templates/job-build-project.yml b/.pipelines/v2/templates/job-build-project.yml index 34e4ce4340..62cb993d5d 100644 --- a/.pipelines/v2/templates/job-build-project.yml +++ b/.pipelines/v2/templates/job-build-project.yml @@ -111,6 +111,7 @@ jobs: ${{ else }}: OutputBuildPlatform: ${{ platform }} variables: + NUGET_PACKAGES: 'C:\NuGetPackages' # Some of our build steps cache these here... and it was apparently part of the global environment MakeAppxPath: 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x86\MakeAppx.exe' # Azure DevOps abhors a vacuum # If these are blank, expansion will fail later on... which will result in direct substitution of the variable *names* @@ -139,6 +140,10 @@ jobs: - output: pipelineArtifact artifactName: $(JobOutputArtifactName) targetPath: $(Build.ArtifactStagingDirectory) + - output: pipelineArtifact + artifactName: $(JobOutputArtifactName)-failure-$(System.JobAttempt) + targetPath: $(LogOutputDirectory) + condition: or(failed(), canceled()) steps: - checkout: self clean: true @@ -395,7 +400,7 @@ jobs: ### HACK: On ARM64 builds, building an app with Windows App SDK copies the x64 WebView2 dll instead of the ARM64 one. This task makes sure the right dll is used. - task: CopyFiles@2 displayName: HACK Copy core WebView2 ARM64 dll to output directory - condition: eq(variables['BuildPlatform'],'arm64') + condition: and(succeeded(), eq(variables['BuildPlatform'], 'arm64')) inputs: contents: packages/Microsoft.Web.WebView2.1.0.2903.40/runtimes/win-ARM64/native_uap/Microsoft.Web.WebView2.Core.dll targetFolder: $(Build.SourcesDirectory)/ARM64/Release/WinUI3Apps/ @@ -434,11 +439,11 @@ jobs: inputs: testResultsFormat: VSTest testResultsFiles: '**/*.trx' - condition: ne(variables['BuildPlatform'],'arm64') + condition: and(succeeded(), ne(variables['BuildPlatform'], 'arm64')) # Native dlls - task: VSTest@2 - condition: ne(variables['BuildPlatform'],'arm64') # No arm64 agents to run the tests. + condition: and(succeeded(), ne(variables['BuildPlatform'], 'arm64')) # No arm64 agents to run the tests. displayName: 'Native Tests' inputs: platform: '$(BuildPlatform)'