Skip to content

ci: reduce needless file copying; zip GPOs; reliability#42446

Merged
yeelam-gordon merged 6 commits intomainfrom
dev/duhowett/ci-reduce-time-wasted-copying
Oct 17, 2025
Merged

ci: reduce needless file copying; zip GPOs; reliability#42446
yeelam-gordon merged 6 commits intomainfrom
dev/duhowett/ci-reduce-time-wasted-copying

Conversation

@DHowett
Copy link
Copy Markdown
Member

@DHowett DHowett commented Oct 16, 2025

This pull request makes four main changes to the build.

  1. GPOs are now emitted as a ZIP file, rather than a folder to be zipped later.
  2. PDB files are linked into the output folder by hard link, rather than copy, to save disk space.
  3. We no longer copy the entire build output folder into artifacts; instead, we move it, to save disk space.
  4. Failed builds will no longer produce build-arch-release artifacts; instead, they will produce numbered failure artifacts. This means that we can finally re-run a single leg of the build, and it will not fail due to the artifact already existing!

I included a smaller change to the DSC build step to make sure it doesn't accidentally run when everything else failed. Heh.

Altogether, this takes a couple minutes off the build and reduces the demand on the agent's disk by 10-15GB.

@DHowett DHowett requested a review from a team as a code owner October 16, 2025 19:49
@DHowett
Copy link
Copy Markdown
Member Author

DHowett commented Oct 16, 2025

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@DHowett DHowett changed the title ci: reduce needless file copying; zip GPOs ci: reduce needless file copying; zip GPOs; reliability Oct 17, 2025
@DHowett
Copy link
Copy Markdown
Member Author

DHowett commented Oct 17, 2025

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@DHowett
Copy link
Copy Markdown
Member Author

DHowett commented Oct 17, 2025

image

@lei9444
Copy link
Copy Markdown
Contributor

lei9444 commented Oct 17, 2025

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@DHowett
Copy link
Copy Markdown
Member Author

DHowett commented Oct 17, 2025

There are widespread CI failures due to caching. We should disable it for now.

@yeelam-gordon yeelam-gordon merged commit 92d9f10 into main Oct 17, 2025
14 checks passed
khmyznikov pushed a commit that referenced this pull request Oct 21, 2025
This pull request makes four main changes to the build.

1. GPOs are now emitted as a ZIP file, rather than a folder to be zipped
later.
2. PDB files are linked into the output folder by hard link, rather than
copy, to save disk space.
3. We no longer copy the entire build output folder into artifacts;
instead, we *move* it, to save disk space.
4. **Failed builds** will no longer produce `build-arch-release`
artifacts; instead, they will produce numbered failure artifacts. This
means that we can finally re-run a single leg of the build, and it will
not fail due to the artifact already existing!

I included a smaller change to the DSC build step to make sure it
doesn't accidentally run when everything else failed. Heh.

Altogether, this takes a couple minutes off the build and reduces the
demand on the agent's disk by 10-15GB.
@yeelam-gordon yeelam-gordon requested a review from Copilot November 7, 2025 01:46
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 optimizes the Azure Pipelines build process by improving artifact staging performance and adding better failure diagnostics. The key changes focus on replacing expensive copy operations with more efficient alternatives and enhancing conditional execution.

  • Replaced CopyFiles tasks with PowerShell scripts using hard links and move operations to improve performance
  • Added succeeded() condition to DSC build task to prevent execution on previous failures
  • Split artifact publishing into success and failure scenarios for better diagnostics

New-Item -Type Directory $OutDir -EA:Ignore
Write-Host "Linking $($Symbols.Length) symbols into place at $OutDir"
ForEach($s in $Symbols) {
New-Item -Type HardLink -Target $s.FullName (Join-Path $OutDir $s.Name)
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The New-Item cmdlet is missing the -Path parameter name. While PowerShell accepts positional parameters, explicit parameter names improve readability and maintainability. Change to: New-Item -Type HardLink -Path (Join-Path $OutDir $s.Name) -Target $s.FullName

Suggested change
New-Item -Type HardLink -Target $s.FullName (Join-Path $OutDir $s.Name)
New-Item -Type HardLink -Path (Join-Path $OutDir $s.Name) -Target $s.FullName

Copilot uses AI. Check for mistakes.
$FinalOutputRoot = "$(JobOutputDirectory)\$(BuildPlatform)\$(BuildConfiguration)\$(BuildPlatform)"
$ProjectBuildRoot = "$(Build.SourcesDirectory)\$(BuildPlatform)"
$ProjectBuildDirectory = "$ProjectBuildRoot\$(BuildConfiguration)"

Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Move-Item operation may fail if $FinalOutputRoot doesn't exist as a parent directory. While line 597 creates $FinalOutputRoot, Move-Item is attempting to move $ProjectBuildDirectory into it, but the parent of $FinalOutputRoot (containing BuildPlatform/BuildConfiguration) may not exist. Add New-Item -Type Directory (Split-Path $FinalOutputRoot) -Force -EA:Ignore before line 597 to ensure the parent directory structure exists.

Suggested change
New-Item -Type Directory (Split-Path $FinalOutputRoot) -Force -EA:Ignore

Copilot uses AI. Check for mistakes.
mirmirmirr pushed a commit to mirmirmirr/PowerToys that referenced this pull request Nov 9, 2025
)

This pull request makes four main changes to the build.

1. GPOs are now emitted as a ZIP file, rather than a folder to be zipped
later.
2. PDB files are linked into the output folder by hard link, rather than
copy, to save disk space.
3. We no longer copy the entire build output folder into artifacts;
instead, we *move* it, to save disk space.
4. **Failed builds** will no longer produce `build-arch-release`
artifacts; instead, they will produce numbered failure artifacts. This
means that we can finally re-run a single leg of the build, and it will
not fail due to the artifact already existing!

I included a smaller change to the DSC build step to make sure it
doesn't accidentally run when everything else failed. Heh.

Altogether, this takes a couple minutes off the build and reduces the
demand on the agent's disk by 10-15GB.
@yeelam-gordon yeelam-gordon added the Area-Build Issues pertaining to the build system, CI, infrastructure, meta label Nov 11, 2025
@yeelam-gordon yeelam-gordon added this to the PowerToys 0.96 milestone Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Build Issues pertaining to the build system, CI, infrastructure, meta

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants