-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[vcpkg-tool] default-features are enabled for all dependencies even if not required. #24548
Comments
No that is a design decisions. You need to be explicit about every dependency from which you don't want to have the defaults. |
I think I am explicit with As vcpkg user I have not the knowledge to set all dependencies to just "core" to get the expected result. But If I need a feature of a dependent library directly, I will be able can ask for it explicit. This is also interesting in vase of updates. Imagine a library does not longer depend on a library. It is just removed, including all its dependencies. If build script has to list all of them explicit, they are still installed without any use. Since we don't know the requirement of the target software installing the default for named libraries is reasonable, but it is a wast of resources for dependent libraries where we definitely know that a certain feature is not required. Do you have an example where this assumption is wrong? Is there a thread where this issue has already been discussed? |
|
I have read trough the whole discussion of #11602, but there was not a single argument why the current behavior is favored over the proposed, except that "it is a design decision". I think the given real live example shows impressive that we should revise the design decision. Do you have a real live counter example? |
You are maybe interested in #19173 or a similar behavior |
Yes, but I see no reason why such "--minimal-dependencies" feature is not the default. Do you? |
I have also added a comment to your microsoft/vcpkg-tool#177 |
IMO there are competing perspectives and goals, e.g.
You cannot achieve them all equally well. I'm not enthusiastic about the current approach, but at least I don't have to care too much when adding a feature interface to existing ports (e.g. gui and icu for qt5-base), and I enjoy less rebuilds of installed packages when the next installed packages requests a new feature in a remote dependency. |
For the dependencies: "dependencies": [
{
"name": "port-name",
"default-features": false
}
] We should use this method in order to avoid consuming resources as much as possible on the installation of unnecessary default features. For install, installing default features without declaring feature
|
@JackBoosY Do you propose that the example vcpkg.json fragment above of a of port |
@daschuer If we set {
"name": "a",
...
"dependencies": [
{
"name": "b",
"default-features": false
}
]
}
|
This is currently not the case unfortunately and the core part of this issue. (See my initial post). Translated to the abstract example we have: |
I will double confirm this with my team members later. |
If we change to the proposed mode we have both. Those, don't care about features and just use the port name get the default features of the library, but also no known-unnecessary dependencies, saving HDD and CPU.
That's a fair point, for the current behavior and applies only if the new required feature is part of the default feature set.
Currently we sit in the middle. The CI does not reflect the users setup because they will install the core version of the packages, but we have also no single well-defined installation (CI) because the packages can depend on any feature of another package not only default. Maybe we tweak the CI that all packages are installed as default + features others are depending on, this mode will also add convenience when changing package dependencies. On the other hand we do not detect issues early with the package dependencies. For instance if a package |
Afaik this is already the case. Imho installing default features of transitive dependencies is a good thing, but maybe ports have default features that shouldn't be default features. For example if a have a lib A that is a http curl wrapper, the lib depends on curl[core]. If I now depend on A and want to do a https query it would fail with your proposal, because it would not install the ssl support of curl, which is imho a bad user experience. |
I think we have the issue of a missing definition of default-feature, a rule set for it. For me the default features of a library is what upstream considers as default. They have anyway the power to add or remove dependencies without making them a feature.
Can you please clarify when this applies? Do you have a real live example when it has make your work easier? |
After some discussion, I confirm this behavor is by design for both install command and the dependency relationship. |
We hope your question was answered to your satisfaction; if it wasn't, you can reopen with more info. |
I have not yet understand what is the main argument for the current behavior that overrules all others. |
I have create #24539 to remove extra pointless dependencies form our target project.
Unfortunately it works only half way round. Installing vamp-sdk only, still pulls in the default libsndfile with all dependencies into the project. The target project needs to ship pointless libraries just to satisfy the linker. In this case the vamp-host can only handle wav files but is now linked to libraries for all sort of files.
however, explicitly installing the libsndfile[core] does work:
Is this an vcpkg-tool regression?
Environment
All
To Reproduce
See above
Expected behavior
My expectation would be that I install the default features when installing the library explicit and installing the bare minimum when it is pulled in as dependency.
The text was updated successfully, but these errors were encountered: