Move our big OSS dependencies to vcpkg (#15855)

This pull request removes the following vendored open source, in favor
of getting it from vcpkg:

- CLI11 2.4
- jsoncpp 1.9
- fmt 7.1.3
- gsl 3.1 (not vendored, but submoduled--arguably worse!)

Now that Visual Studio 2022 includes a built-in workload for vcpkg, the
onboarding process is much smoother. Terminal should only require the
vcpkg workload.

I've added some build rules that detect vcpkg via VS and via the user's
environment before falling back to a location in the source tree. The CI
pipeline will fall back to installing and bootstrapping vcpkg in
dep/vcpkg if necessary.

Some OSS has not been (and will not be) migrated:

- wyhash: ours is included directly in til/hash
- pcg_random: we have a stripped down copy compared to vcpkg
- stb_rect: vcpkg only ships *all of STB*; ours is a stripped down copy
- chromium numerics: vcpkg does not ship Chromium, especially not this
  tiny fraction of Chromium
- dynamic_bitset and libpopcnt: removing in #17510
- interval_tree: no vcpkg equivalent

To support the needs of the inbox Windows build, I've split up our vcpkg
manifest into dependencies for all projects and dependencies just for
Terminal. To support this, we now offer a `terminal` feature. The vcpkg
rules in `common.build.pre.props` are set up to turn it on, whereas the
build rules we eventually write for the OS will not be.

Most of the work is concentrated in `common.build.pre.props`.
This commit is contained in:
Dustin L. Howett
2024-07-19 11:29:37 -07:00
committed by GitHub
parent 955b1d2683
commit 3c5800f575
57 changed files with 105 additions and 32983 deletions

View File

@@ -161,6 +161,8 @@ jobs:
- template: .\steps-restore-nuget.yml
- template: .\steps-install-vcpkg.yml
- pwsh: |-
.\build\scripts\Set-LatestVCToolsVersion.ps1
displayName: Work around DD-1541167 (VCToolsVersion)

View File

@@ -0,0 +1,16 @@
steps:
- pwsh: |-
$VsInstallRoot = & 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe' -requires Microsoft.VisualStudio.Component.Vcpkg -property installationPath
If ([String]::IsNullOrEmpty($VsInstallRoot)) {
Remove-Item -Recurse -Force dep/vcpkg -ErrorAction:Ignore
git clone https://github.com/microsoft/vcpkg dep/vcpkg
cd dep/vcpkg
& ./bootstrap-vcpkg.bat
$VcpkgRoot = $PWD
Write-Host "Using vcpkg from local checkout ($VcpkgRoot)"
} Else {
$VcpkgRoot = Join-Path $VsInstallRoot "VC\vcpkg"
Write-Host "Using vcpkg from Visual Studio installation ($VcpkgRoot)"
}
echo "##vso[task.setvariable variable=VCPKG_ROOT]$VcpkgRoot"
displayName: Detect VS vcpkg or bootstrap locally