mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 11:21:12 +08:00
070a18974b
Included is a script that sets up all vcpkg's Azure infrastructure for Windows PR tests, and several updates to baselines. The baseline updates are generally caused by an updated copy of the MSVC++ compiler caused by updating the VMs, but some are caused by missed failures only detected now because this did a cleared out archives directory first. Some of the build infrastructure isn't what I'd call 'pretty' (e.g. we're split into more scripts and such than I'd like) but this mirrors how our existing PR system works. It is expected that the existing vcpkg Windows PR system will hate these baseline updates so we'll need to merge this, then remove that (duplicate) workflow immediately afterwards, then delete all the Windows VMs powering the old infrastructure.
73 lines
2.0 KiB
PowerShell
73 lines
2.0 KiB
PowerShell
# Copyright (c) Microsoft Corporation.
|
|
# SPDX-License-Identifier: MIT
|
|
#
|
|
|
|
<#
|
|
.SYNOPSIS
|
|
Generates a list of ports to skip in the CI.
|
|
|
|
.DESCRIPTION
|
|
generate-skip-list takes a triplet, and the path to the ci.baseline.txt
|
|
file, and generates a skip list string to pass to vcpkg.
|
|
|
|
.PARAMETER Triplet
|
|
The triplet to find skipped ports for.
|
|
|
|
.PARAMETER BaselineFile
|
|
The path to the ci.baseline.txt file.
|
|
#>
|
|
[CmdletBinding()]
|
|
Param(
|
|
[string]$Triplet,
|
|
[string]$BaselineFile
|
|
)
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
if (-not (Test-Path -Path $BaselineFile)) {
|
|
Write-Error "Unable to find baseline file $BaselineFile"
|
|
}
|
|
|
|
#read in the file, strip out comments and blank lines and spaces
|
|
$baselineListRaw = Get-Content -Path $BaselineFile `
|
|
| Where-Object { -not ($_ -match "\s*#") } `
|
|
| Where-Object { -not ( $_ -match "^\s*$") } `
|
|
| ForEach-Object { $_ -replace "\s" }
|
|
|
|
###############################################################
|
|
# This script is running at the beginning of the CI test, so do a little extra
|
|
# checking so things can fail early.
|
|
|
|
#verify everything has a valid value
|
|
$missingValues = $baselineListRaw | Where-Object { -not ($_ -match "=\w") }
|
|
|
|
if ($missingValues) {
|
|
Write-Error "The following are missing values: $missingValues"
|
|
}
|
|
|
|
$invalidValues = $baselineListRaw `
|
|
| Where-Object { -not ($_ -match "=(skip|pass|fail|ignore)$") }
|
|
|
|
if ($invalidValues) {
|
|
Write-Error "The following have invalid values: $invalidValues"
|
|
}
|
|
|
|
$baselineForTriplet = $baselineListRaw `
|
|
| Where-Object { $_ -match ":$Triplet=" }
|
|
|
|
# Verify there are no duplicates (redefinitions are not allowed)
|
|
$file_map = @{ }
|
|
foreach ($port in $baselineForTriplet | ForEach-Object { $_ -replace ":.*$" }) {
|
|
if ($null -ne $file_map[$port]) {
|
|
Write-Error `
|
|
"$($port):$($Triplet) has multiple definitions in $baselineFile"
|
|
}
|
|
$file_map[$port] = $true
|
|
}
|
|
|
|
# Format the skip list for the command line
|
|
$skip_list = $baselineForTriplet `
|
|
| Where-Object { $_ -match "=skip$" } `
|
|
| ForEach-Object { $_ -replace ":.*$" }
|
|
[string]::Join(",", $skip_list)
|