[PR #17592] build: bootstrap vcpkg before nuget restore #31291

Open
opened 2026-01-31 09:46:22 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/17592

State: closed
Merged: Yes


nuget restore actually runs through MSBuild! However, #15855 added a dependency from our project on a system-installed or locally detected vcpkg.targets (or .props).

Our build runs nuget restore before finding or installing vcpkg, so the rules in our project file would try to import vcpkg before it had been found (or installed).

On build agents with vcpkg installed via the VS workload, this was fine: we would import the one that came with VS and go on our merry way. On build agents where it needs to be installed locally, it could not be imported.

The fix in this PR is to install/bootstrap vcpkg before running nuget.

I tried to isolate the vcpkg rules to only run in the absence of nuget, but that didn't work.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/17592 **State:** closed **Merged:** Yes --- `nuget restore` actually runs through MSBuild! However, #15855 added a dependency from our project on a system-installed _or locally detected_ `vcpkg.targets` (or `.props`). Our build runs `nuget restore` before finding or installing vcpkg, so the rules in our project file would try to import vcpkg before it had been found (or installed). On build agents with vcpkg installed via the VS workload, this was fine: we would import the one that came with VS and go on our merry way. On build agents where it needs to be installed locally, it could not be imported. The fix in this PR is to install/bootstrap vcpkg before running nuget. I tried to isolate the vcpkg rules to only run _in the absence of nuget_, but that didn't work.
claunia added the pull-request label 2026-01-31 09:46:22 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#31291