Files
Billy O'Neal e228165b88 Fix --skip-failures feature set divergence between PR and CI. (#1958)
Alternative to: https://github.com/microsoft/vcpkg-tool/pull/1949

Also recorded in https://github.com/microsoft/vcpkg/pull/48797#issuecomment-3645291162

Repeating what @JavierMatosD said from that PR stating the problem:

>When a port is marked =fail in ci.baseline.txt and --skip-failures is active, the port was previously added to the exclusions map before feature resolution. This had two consequences:
>
>1. When a dependency is statically unsupported for the triplet, the tool incorrectly reported a regression for =fail ports that cascaded. The planner knows at plan time that the dependency graph is unsatisfiable
>2. Excluding =fail ports from the plan changed which features were resolved for shared dependencies. A port could pass in PR (fewer features active) but cascade in CI.

To clarify (1), emitting a diagnostic is correct but we claimed that it was a cascade when it's actually a direct failure. Related: https://github.com/microsoft/vcpkg-tool/pull/1955

* include/vcpkg/fwd/build.h et al.
  Add new states to represent *why* something cascaded and let us distinguish between "static" cascades (where the cascade is implied by the baseline or by "supports") and "dynamic" cascades (where the cascade happens because a build fails later)
* include/vcpkg/ci-baseline.h + src/vcpkg/ci-baseline.cpp
  Rename failures/success to fail/pass because those are the words we use in ci.baseline.txt.
  Rename "cidata" to "ci_data" because it was making spell check angry at me.
  Only put =skip things in the exclusion map and always record =fail as an expected_fail. (SkipFailures is now handled elsewhere)
* src/vcpkg/commands.ci.cpp
  Split SkipReason::Cascade into BaselineCascade and SupportsCascade
  In compute_pre_build_statuses, emit 's-fail' for "skipped expected to fail" for --skip-failures. Rather than control coupling with a bool here, callers when --skip-failures is off just pass an empty vector of skipped failures.
  In prune_entirely_known_action_branches, use a switch for looking at the "known" status. Remove the attempts to avoid inserting dependencies; in the current world order if 'forbidden' dependencies made it into the plan calculate_ci_specs failed to remove those.
  In calculate_ci_specs, reorder all the "supports" checking before any of the baseline checking. This allows later reporting stages to see inconsistencies between the baseline and supports clauses without reevaluating supports clauses.
* azure-pipelines/e2e-assets/ci-skipped-ports/baseline.fail.txt: The comment says "fail is skip here" but that's no longer true. Changed those to actually be =skip to make that test otherwise not need to change.
* azure-pipelines/end-to-end-tests-prelude.ps1: Add Run-VcpkgAndCaptureBoth
* azure-pipelines/end-to-end-tests-dir/ci.ps1:
  For tests that were duplicating just to get stdout and stderr, use Run-VcpkgAndCaptureBoth.
  Update expected count blocks for CASCADED_DUE_TO_MISSING_DEPENDENCIES being split.
  Add test that dependencies of failure baselines still contribute features under --skip-failures . This is specifically what https://github.com/microsoft/vcpkg/pull/48797#issuecomment-3645291162 was talking about
  Add test for every "REGRESSION:" line to make sure they aren't bogus.
2026-04-02 12:54:16 -07:00
..