conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
960 stars 1.77k forks source link

[question] Conflicting zlib build dependency between swig and protobuf #19943

Open hpesoj opened 1 year ago

hpesoj commented 1 year ago

What is your question?

It seems the version of zlib that pcre2 depends on was updated recently. Now this conanfile.py:

from conans import ConanFile

class MyConan(ConanFile):
    build_requires = [
        "protobuf/3.21.12",
        "swig/4.1.0",
    ]

Results in this error:

ERROR: Conflict in pcre2/10.40:
    'pcre2/10.40' requires 'zlib/1.3' while 'protobuf/3.21.12' requires 'zlib/1.2.13'.
    To fix this conflict you need to override the package 'zlib' in your root package.

But it seems there is no "override" option for build dependencies. How can I fix this?

Using Conan 1.54.0 on Ubuntu 20.04.

hpesoj commented 1 year ago

I've realized that we can build protobuf with with_zlib=False as we don't actually use the compression features, so we can avoid this specific error.

This issue suggests that this is a limitation of Conan 1, and that this error is happening because protobuf should have been updated to zlib/1.3 at the same time as pcre2/10.40? Will upgrading to Conan 2 avoid this issue of conflicting transitive tool dependencies?