question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug] 2.0 check_component_requires and ConanFileDependencies

See original GitHub issue

In 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:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jsallaycommented, Oct 24, 2022

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.

0reactions
memshardedcommented, Nov 6, 2022

Closed by https://github.com/conan-io/conan/pull/12388, will be in beta.5

Read more comments on GitHub >

github_iconTop Results From Across the Web

[bug] Recipe self.dependencies does not contain any elements
My goal here is not really about the vaidate() method, but to augment the build/test/any requirements (e.g. force a dependency to be in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found