build: bootstrap vcpkg before nuget restore #17592
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
nuget restore
actually runs through MSBuild! However, #15855 added a dependency from our project on a system-installed or locally detectedvcpkg.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.