Skip to content

Commit 50ef2f6

Browse files
committed
Fix detection of regressions of independent ports
1 parent 523a634 commit 50ef2f6

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,12 @@ if (-not ($Output.Contains("feature-fails:${Triplet}: BUILD_FAILED:"))) {
113113
if (-not ($Output.Contains("regression:${Triplet}: CASCADED_DUE_TO_MISSING_DEPENDENCIES:"))) {
114114
throw 'regression build must cascade'
115115
}
116+
# Non-dry run with port regression@2
117+
$Output = Run-VcpkgAndCaptureStdErr ci @commonArgs --x-builtin-ports-root="$PSScriptRoot/../e2e-ports/ci" --binarysource="clear;files,$ArchiveRoot" --parent-hashes="$TestingRoot/parent-hashes.json" --overlay-ports="$PSScriptRoot/../e2e-ports/ci-independent-regression/v2"
118+
Throw-IfNotFailed
119+
if (-not ($Output.Contains("REGRESSION: Independent feature-fails:${Triplet} failed with BUILD_FAILED."))) {
120+
throw 'feature-fails[fail] build failure must be reported as independent regression'
121+
}
122+
if ($Output.Contains("REGRESSION: Independent regression:${Triplet} failed with BUILD_FAILED.")) {
123+
throw 'regression (port) build failure must not be reported as independent regression'
124+
}

src/vcpkg/commands.ci.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ namespace
173173
const std::map<PackageSpec, BuildResult>& known,
174174
View<std::string> parent_hashes)
175175
{
176+
// With parent hashes, ports are merely "auto selected" unless the abi hash changed.
177+
auto const default_request_type = parent_hashes.empty() ? RequestType::USER_REQUESTED : RequestType::AUTO_SELECTED;
176178
std::set<PackageSpec> to_keep;
177179
for (auto it = action_plan.install_actions.rbegin(); it != action_plan.install_actions.rend(); ++it)
178180
{
@@ -187,6 +189,10 @@ namespace
187189
to_keep.insert(it->spec);
188190
}
189191
}
192+
else
193+
{
194+
it->request_type = default_request_type;
195+
}
190196

191197
if (Util::Sets::contains(to_keep, it->spec))
192198
{

0 commit comments

Comments
 (0)