Skip to content
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

Remove direct dependency on zlib? #385

Open
garethsb opened this issue Apr 8, 2024 · 0 comments
Open

Remove direct dependency on zlib? #385

garethsb opened this issue Apr 8, 2024 · 0 comments

Comments

@garethsb
Copy link
Contributor

garethsb commented Apr 8, 2024

d5a45b0 added a direct dependency on zlib in order to avoid version conflict between indirect dependencies on zlib via cpprestsdk and boost.

Now that we are using Conan 2, we have more facilities to avoid that sort of breakage.
For starters, the recipes for Boost and cpprestsdk now specify a version range:
https://github.com/conan-io/conan-center-index/blob/66ef25739f25d2a23c131bc4eb0fd0dfab8450b5/recipes/boost/all/conanfile.py#L650
https://github.com/conan-io/conan-center-index/blob/66ef25739f25d2a23c131bc4eb0fd0dfab8450b5/recipes/cpprestsdk/all/conanfile.py#L63

Secondly, Conan now provides a way of clearly specifying an override for dependencies which still isn't a direct dependency:
https://docs.conan.io/2/tutorial/versioning/conflicts.html

However, as far as I know, that feature is not available as a conan install command line argument, nor available within a conanfile.txt. I don't think lockfiles are the answer, because this conflict can happen while computing the dependency graph the first time.

So I think the correct solution is to use a conanfile.py with an override=True requirement, instead of a conanfile.txt.

Note that in the CCI recipe, I am actually removing the zlib dependency completely, because the best practice is that override=True is specified by the ultimate consumer recipe:
conan-io/conan-center-index#23411

If we keep the conanfile.txt, we should still remove the [imports] section, since this is ignored in Conan 2, you need to use generators:
https://docs.conan.io/1/migrating_to_2.0/recipes.html#removed-imports-method

The CCI recipe already has a fully-fledged generate method:
https://github.com/conan-io/conan-center-index/blob/66ef25739f25d2a23c131bc4eb0fd0dfab8450b5/recipes/nmos-cpp/all/conanfile.py#L90

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant