Problem with dependencies default-features and baseline
@FrankXie05 is already working on this.
Since Nov 6, 2024.
- Dominant language
- CMake
- Stars
- 27.5k
- Forks
- 7.7k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 321
Description
**Describe the bug**
When using a manifest, the `"default-features" : false` of the dependencies seems to be applied to the port in the "builtin-baseline" and not to the port finally built, based on "version>=".
**Environment**
- OS: Ubuntu 22.04 (not tested in others)
- Compiler: N/A
**To Reproduce**
Consider first the following manifest to install libraw with jasper not pulling all the dependencies it has as default features:
```
{
"$schema" : "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name" : "test",
"dependencies" : [
{
"name": "jasper",
"default-features": false
},
{
"name": "libraw",
"version>=" : "0.21.3"
}
],
"builtin-baseline" : "ee9c88f9ec9ada660a5ab0c92ac71bfea9e3704f"
}
```
If we run `vcpkg --dry-run install` we can see that jasper is including freeglut (and other dependencies) and it should not include them if we look at the libraw port for the version to be built and installed.
Now, change the builtin-baseline to just the next commit in the history, a45fe2ce6039339ee7a076ebd3dcee0fa6cc1287 and run again `vcpkg --dry-run install`. Now jasper is not including freeglut.
The latest commit used as baseline is relevant to the test, since it is the one where freeglut dependency was changed in libraw to `"default-features": false` (libraw version 0.21.1#3). Please note that we have changed the baseline commit, but the libraw port selected with `"version>="` is always 0.21.3, the latest one, so we have in both cases the `"default-features": false` in libraw when including jasper as a dependency.
If I copy the libraw port to an overlay directory, the default-features is correctly evaluated.
**Expected behavior**
libraw should include jasper as `"default-features": false` as stated in the port to be built ("version>=" : "0.21.3") independently of the `"builtin-baseline"` in the manifest.
**Failure logs**
N/A
**Additional context**
N/A
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.