Skip to content

Commit 2b211d0

Browse files
authored
Fix =skip handling. (#1849)
Billy made a bit of a mistake in #1822 resulting in the blizzard of failures in https://dev.azure.com/vcpkg/public/_build/results?buildId=122788
1 parent 1cc117b commit 2b211d0

File tree

9 files changed

+48
-1
lines changed

9 files changed

+48
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "always-built",
3+
"version": "1.0.0"
4+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
message(FATAL_ERROR "This port should always cascade and should not be attempted.")
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "always-cascade",
3+
"version": "1.0.0",
4+
"dependencies": [
5+
"always-skip"
6+
]
7+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
message(FATAL_ERROR "This port should always be skipped by baseline.txt and should not be attempted.")
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "always-skip",
3+
"version": "1.0.0",
4+
"dependencies": [
5+
"always-built"
6+
]
7+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
always-skip:arm64-osx=skip
2+
always-skip:x64-linux=skip
3+
always-skip:x64-osx=skip
4+
always-skip:x64-windows=skip
5+
always-skip:x86-windows=skip

azure-pipelines/end-to-end-tests-dir/ci.ps1

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,27 @@ SUMMARY FOR $Triplet
9393
UNSUPPORTED: 1
9494
"@
9595

96+
# test that skipped ports aren't "put back" by downstream dependencies that aren't skipped
97+
Refresh-TestRoot
98+
$Output = Run-VcpkgAndCaptureOutput ci @commonArgs --x-builtin-ports-root="$PSScriptRoot/../e2e-assets/ci-skipped-ports" --binarysource=clear --ci-baseline="$PSScriptRoot/../e2e-assets/ci-skipped-ports/baseline.txt"
99+
Throw-IfFailed
100+
if (-not ($Output -match 'always-built:[^:]+: \*:' -and $Output -match 'Building always-built:[^@]+@1\.0\.0\.\.\.')) {
101+
throw 'did not attempt to build always-built'
102+
}
103+
if (-not ($Output -match 'always-skip:[^:]+: skip\n')) {
104+
throw 'tried to build skipped'
105+
}
106+
# This should be statically determinable but at the moment we do not
107+
# if (-not ($Output -match 'always-cascade:[^:]+: cascade\n')) {
108+
# throw 'tried to build cascaded'
109+
# }
110+
Throw-IfNonContains -Actual $Output -Expected @"
111+
SUMMARY FOR $Triplet
112+
SUCCEEDED: 1
113+
CASCADED_DUE_TO_MISSING_DEPENDENCIES: 1
114+
EXCLUDED: 1
115+
"@
116+
96117
# test that features included only by skipped ports are not included
97118
$xunitFile = Join-Path $TestingRoot 'xunit.xml'
98119
Refresh-TestRoot

src/vcpkg/commands.ci.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ namespace
197197
}
198198

199199
ret.report_lines.insert_or_assign(exclusion.first, fmt::format("{:>40}: {}", exclusion.first, *state));
200-
ret.known.emplace(exclusion.first, known_result);
200+
ret.known.insert_or_assign(exclusion.first, known_result);
201201
}
202202

203203
return ret;

0 commit comments

Comments
 (0)