Skip to content

Clean vcpkg artifacts on solution clean#6339

Open
Trenly wants to merge 1 commit into
microsoft:masterfrom
Trenly:fix/clean-solution-vcpkg-artifacts
Open

Clean vcpkg artifacts on solution clean#6339
Trenly wants to merge 1 commit into
microsoft:masterfrom
Trenly:fix/clean-solution-vcpkg-artifacts

Conversation

@Trenly

@Trenly Trenly commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

📖 Description

Add a CleanVcpkg target in src\vcpkg.props so Visual Studio Clean Solution removes repository-local vcpkg artifacts.

The target:

  • Deletes $(VcpkgInstalledDir) (src\vcpkg_installed\)
  • Deletes src\VcpkgPortOverlay\.created so overlay ports regenerate on next build

Also adds an XML comment block explaining why this cleanup is necessary.

🔗 References

Resolves #6338

🔍 Validation

Manual local verification of MSBuild target wiring only.

✅ Checklist

📋 Issue Type

  • Bug fix
  • Feature
  • Task

Assisted-by: GitHub Copilot

Microsoft Reviewers: Open in CodeFlow

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Trenly Trenly marked this pull request as ready for review June 26, 2026 17:57
@Trenly Trenly requested a review from a team as a code owner June 26, 2026 17:57
@florelis

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@florelis

Copy link
Copy Markdown
Member

What's the scenario you're thinking about that may require cleaning the vcpkgs?
I can only think of the case where you are updating the ports from our custom overlay. If that is the only case, maybe we don't need it in most cases and could have it gated behind some option, or make the target smarter to only clean up when the ports changed.

@Trenly

Trenly commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

What's the scenario you're thinking about that may require cleaning the vcpkgs? I can only think of the case where you are updating the ports from our custom overlay. If that is the only case, maybe we don't need it in most cases and could have it gated behind some option, or make the target smarter to only clean up when the ports changed.

Take for example #6301 - That was only discovered because I removed the vcpkgs. In most workflows, I would expect "Clean" to remove all build artifacts and produce a 100% brand new build - which wasn’t the case.

While a simple rebuild would skip updating the vcpkgs, if I am explicitly running a clean, I would have thought that the vcpkgs would have also been cleaned up too - regardless of if there were port changes or not. In my mind, Clean means to perform the next build as if it were the first build the system ever ran

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clean Solution does not remove vcpkg artifacts

2 participants