build: force the latest VCToolsVersion; see DD-1541167 for more (#17156)

Stolen from PowerToys.

BODGY
This commit is contained in:
Dustin L. Howett 2024-04-29 12:52:00 -05:00 committed by GitHub
parent 5b8eadb2ea
commit 5d2d3856a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 0 deletions

View File

@ -142,6 +142,10 @@ jobs:
- template: .\steps-restore-nuget.yml
- pwsh: |-
.\build\scripts\Set-LatestVCToolsVersion.ps1
displayName: Work around DD-1541167 (VCToolsVersion)
- ${{ parameters.beforeBuildSteps }}
- task: VSBuild@1

View File

@ -0,0 +1,8 @@
$VSInstances = ([xml](& 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe' -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -include packages -format xml))
$VSPackages = $VSInstances.instances.instance.packages.package
$LatestVCPackage = ($VSInstances.instances.instance.packages.package | ? { $_.id -eq "Microsoft.VisualCpp.CRT.Source" })
$LatestVCToolsVersion = $LatestVCPackage.version;
Write-Output "Latest VCToolsVersion: $LatestVCToolsVersion"
Write-Output "Updating VCToolsVersion environment variable for job"
Write-Output "##vso[task.setvariable variable=VCToolsVersion]$LatestVCToolsVersion"

View File

@ -61,6 +61,7 @@ void SystemConfigurationProvider::GetSettingsFromLink(
// Hence, we make it seem like the console is in fact configured to use a
// TrueType font by the user.
#pragma warning(suppress : 26485) // This isn't even really _supposed to be_ an array-to-pointer decay: it's passed as a string view.
pLinkSettings->SetFaceName(DEFAULT_TT_FONT_FACENAME);
pLinkSettings->SetFontFamily(TMPF_TRUETYPE);