Fix a bunch of cases where default features were incorrectly included#2012
Fix a bunch of cases where default features were incorrectly included#2012cqundefine wants to merge 1 commit intomicrosoft:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes cases where default features were being incorrectly included, particularly around host dependencies (notably when cross-compiling with default features disabled). It updates dependency planning behavior and adds regression tests to ensure host/target default-feature metadata is handled as intended.
Changes:
- Prevents adding a default-feature reinstall requirement for non-user-requested clusters when the package isn’t installed.
- Adjusts versioned dependency graph handling so host dependencies don’t get implicit default features; default features for versioned plans are only emitted when enabled for the node.
- Adds new unit tests covering host dependency default-feature suppression in both classic and versioned planning.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/vcpkg/dependencies.cpp | Fixes default-feature inclusion logic in both classic cluster reinstall handling and versioned dependency planning (esp. host deps). |
| src/vcpkg-test/plan.cpp | Adds tests asserting host-dependency default-feature metadata is suppressed appropriately in classic plans. |
| src/vcpkg-test/dependencies.cpp | Adds a versioned-plan test ensuring host dependencies respect explicit no-defaults. |
f3f6d11 to
f272979
Compare
f272979 to
c9b5533
Compare
c9b5533 to
a07cfe0
Compare
|
I would like to see the exact install command and problem before the change. |
|
(For such cases, I prefer to push tests first, to demonstrate the error in CI.) |
Right, so with this simple test package (just added it to the vcpkg repository for testing): {
"name": "testport",
"version": "0.0.0",
"description": "test",
"dependencies": [
{
"name": "testport",
"host": true,
"default-features": false
}
],
"default-features": [
"a"
],
"features": {
"a": {
"description": "a"
}
}
}Calling Running the same command with a binary built with those fixes it correctly skips adding the
Do you think that is something I should do now, like revert the fix, let the CI run and then readd the fix? |
This is not nice but expected, should've been |
|
Right, already works as intended by Microsoft. Cf. microsoft/vcpkg#51325 for a recent discussion. |
In some cases related to host dependencies, default features were being included even those they were disabled, found this when cross compiling
qtbasewith default features disabled.