Repository navigation
test-features: add --[no-]enforce-cascades - #2182
Merged
Billy O'Neal (BillyONeal) merged 2 commits intoNov 4, 2026
Merged
Billy O'Neal (BillyONeal) merged 2 commits into
Billy O'Neal (BillyONeal) merged 2 commits into
Conversation
Previously, x-test-features reported cascades with an implicit pass expectation only when --all was specified. Allow callers to control this independently of which ports are selected: * --enforce-cascades enables these diagnostics for selected ports. * --no-enforce-cascades disables these diagnostics even with --all. * When unspecified, retain the existing default: on with --all, off otherwise. Explicit baseline expectations are still checked regardless of this switch. Disabling enforcement does not hide dependency build failures or cascades that contradict explicit pass/fail expectations. Store ParsedArguments::switches as a map of names to bool values so the existing console parser's no- handling no longer loses explicit false values. Add switch_on for existing default-off callers and read_switch, returning a const bool pointer, to distinguish unspecified from false. Migrate existing callers and preserve enabled-only artifact forwarding and mutually exclusive artifact switch checks. Also honor --no-verbose in x-add-version while preserving its defaults. Document why --only-downloads must imply keep-going and CMake variable arguments must imply editable/non-cached builds rather than treating those implications as overridable defaults. Update localized help and regenerate the message map. Add coverage for static and dynamic cascade overrides, unchanged explicit baseline enforcement, switch values and artifact forwarding, and add-version verbosity with and without --all. Validation: Windows x64 Debug builds; focused argument, console parser, and depend-info unit tests; complete test-features and versions E2E suites; clang-format, whitespace, and message usage checks. Related: microsoft#1686 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are blocking approval.
No open issues 🎉
What changed in this PR
Adds independent control over cascade diagnostics in x-test-features, extending #1686 while preserving the existing defaults. The shared argument parser now distinguishes omitted switches from explicitly disabled ones.
Changes:
- Adds
--enforce-cascadesand--no-enforce-cascades, with regression coverage for overrides and dependency failures. - Migrates command switch consumers to boolean-aware accessors and makes
x-add-versionhonor--no-verbose. - Updates help text and documents why download-only builds require keep-going and CMake variable arguments require non-cached builds.
| File | Description |
|---|---|
| src/vcpkg/vcpkgcmdarguments.cpp | Preserves explicit false values and implements switch accessors. |
| src/vcpkg/configure-environment.cpp | Forwards and validates only enabled artifact switches. |
| src/vcpkg/commands.z-generate-message-map.cpp | Uses boolean-aware output-comment handling. |
| src/vcpkg/commands.z-check-tools-sha.cpp | Uses boolean-aware fix handling. |
| src/vcpkg/commands.z-applocal.cpp | Uses the verbosity switch accessor. |
| src/vcpkg/commands.upgrade.cpp | Migrates upgrade switch checks. |
| src/vcpkg/commands.update-registry.cpp | Migrates all-registries switch handling. |
| src/vcpkg/commands.update-baseline.cpp | Migrates baseline-update switch checks. |
| src/vcpkg/commands.test-features.cpp | Adds cascade enforcement overrides across cascade paths. |
| src/vcpkg/commands.set-installed.cpp | Migrates switches and explains required keep-going behavior. |
| src/vcpkg/commands.search.cpp | Migrates search output switches. |
| src/vcpkg/commands.remove.cpp | Migrates removal switch checks. |
| src/vcpkg/commands.regenerate.cpp | Migrates forwarded regeneration switches. |
| src/vcpkg/commands.print-usage.cpp | Migrates usage-generation switches. |
| src/vcpkg/commands.package-info.cpp | Migrates package-query switches. |
| src/vcpkg/commands.new.cpp | Migrates project-creation switches. |
| src/vcpkg/commands.list.cpp | Migrates listing output switches. |
| src/vcpkg/commands.install.cpp | Migrates switches and documents mandatory build implications. |
| src/vcpkg/commands.format-manifest.cpp | Migrates manifest-formatting switches. |
| src/vcpkg/commands.find.cpp | Migrates find output switches. |
| src/vcpkg/commands.fetch.cpp | Migrates status-stream switch handling. |
| src/vcpkg/commands.export.cpp | Migrates export switch checks. |
| src/vcpkg/commands.env.cpp | Migrates environment-selection switches. |
| src/vcpkg/commands.edit.cpp | Migrates editor-target switches. |
| src/vcpkg/commands.download.cpp | Migrates download and progress switches. |
| src/vcpkg/commands.depend-info.cpp | Migrates dependency-display switches. |
| src/vcpkg/commands.ci.cpp | Migrates CI switch checks. |
| src/vcpkg/commands.ci-verify-versions.cpp | Migrates version-verification switches. |
| src/vcpkg/commands.check-support.cpp | Migrates JSON-output switch handling. |
| src/vcpkg/commands.add-version.cpp | Honors explicit verbosity overrides while retaining defaults. |
| src/vcpkg-test/commands.dependinfo.cpp | Updates switch fixtures and tests disabled graph switches. |
| src/vcpkg-test/arguments.cpp | Tests tri-state switches and disabled artifact forwarding. |
| locales/messages.json | Updates generated English help messages. |
| include/vcpkg/vcpkgcmdarguments.h | Defines boolean switch storage and accessors. |
| include/vcpkg/configure-environment.h | Clarifies enabled-switch forwarding in a comment. |
| include/vcpkg/base/message-data.inc.h | Declares cascade and verbosity help text. |
| include/vcpkg/base/contractual-constants.h | Defines the cascade enforcement switch name. |
| azure-pipelines/end-to-end-tests-dir/versions.ps1 | Tests verbosity defaults and overrides. |
| azure-pipelines/end-to-end-tests-dir/test-features.ps1 | Tests cascade overrides and preserved failure diagnostics. |
Review effort: Balanced
Victor Romero (vicroms)
approved these changes
Nov 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As of #1686 ,
x-test-featuresreports cascades with an implicit pass expectation only when--allwas specified. Allow callers to control this independently of which ports are selected:--enforce-cascadesenables these diagnostics for selected ports.--no-enforce-cascadesdisables these diagnostics even with--all.--all, off otherwise.Disabling enforcement does not hide dependency build failures or cascades that contradict explicit pass/fail expectations.
Drive by: honor
--no-verboseinx-add-versionwhile preserving its defaults. Document why--only-downloadsmust imply--keep-goingand CMake variable arguments must imply--editable/non-cached builds rather than treating those implications as overridable defaults.