From cbc8eed4767bc373575449d89df083f3e92d9ee0 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Mon, 22 Jul 2024 10:23:34 -0700 Subject: [PATCH] build: bootstrap vcpkg before nuget restore (#17592) `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. --- build/pipelines/templates-v2/job-build-project.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/pipelines/templates-v2/job-build-project.yml b/build/pipelines/templates-v2/job-build-project.yml index fd3302e888..47390bbbf3 100644 --- a/build/pipelines/templates-v2/job-build-project.yml +++ b/build/pipelines/templates-v2/job-build-project.yml @@ -159,10 +159,10 @@ jobs: .\build\scripts\Generate-ThirdPartyNotices.ps1 -MarkdownNoticePath .\NOTICE.md -OutputPath .\src\cascadia\CascadiaPackage\NOTICE.html displayName: Generate NOTICE.html from NOTICE.md - - template: .\steps-restore-nuget.yml - - template: .\steps-install-vcpkg.yml + - template: .\steps-restore-nuget.yml + - pwsh: |- .\build\scripts\Set-LatestVCToolsVersion.ps1 displayName: Work around DD-1541167 (VCToolsVersion)