[bug] 2.0 check_component_requires and ConanFileDependencies
See original GitHub issueIn relation to https://github.com/conan-io/conan/issues/12027 and https://github.com/conan-io/conan/pull/12280:
Similar to the dependency graph in issue #12027 I have a transitive dependency identical to a direct dependency. It looks to me like new function conans.model.build_info.check_component_requires is checking for direct dependencies conflicts with cpp_info via the ConanFileDependencies interface.
The issue i’m seeing is a I have:
...
self.requires("packageA/0.0.1") # This package also requires boost/1.76.0
self.requires("boost/1.76.0")
...
self.cpp_info.component["component"].requires(["boost::boost"])
Output: ERROR: packageB/0.0.1: required component package 'boost::' not in dependencies
I’m a little unclear of exactly where the traits for the dependencies are set, but the transitive dependency appears to be overwriting the list entry for the direct entry. From debugging, conanfile.dependencies[“boost/1.76.0”].direct = False which is getting thrown out by the filter call in check_component_requires.
I’m not sure if this is expected behavior or not, but it seems like the entries conanfile.dependencies should |= some of the traits (run, libs, headers, direct, etc.) if there is a duplicate dependency.
Environment Details (include every applicable attribute)
conan profile show
Host profile:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=9
os=Linux
os.distro=Ubuntu20.04
[conf]
tools.system.package_manager:mode=install
tools.system.package_manager:sudo=True
python3 --version
Python 3.8.10
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
We just upgraded to 2.0.0-beta4. It looks like both of those fixes were merged into there, so we are running with them.
Closed by https://github.com/conan-io/conan/pull/12388, will be in beta.5