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

[question] Issue with replace_requires and zlib-ng compatibility in Conan #17557

Open
1 task done
karel-tomanec opened this issue Jan 10, 2025 · 1 comment
Open
1 task done
Assignees

Comments

@karel-tomanec
Copy link

karel-tomanec commented Jan 10, 2025

What is your question?

Hi,

I am using zlib-ng in my project build, packaged via the official Conan recipe. I would like to integrate minizip-ng, which depends on zlib and OpenSSL. OpenSSL also uses zlib. My goal is to replace all zlib dependencies with zlib-ng, as it should be API-compatible when the zlib_compat=True option is set.

I found that this can potentially be achieved using [replace_requires] as described in the https://blog.conan.io/2024/02/20/Conan-2-graph-features.html.

Build profile:

[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=14
compiler.runtime=dynamic
compiler.version=194
os=Windows

Host profile:

[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=14
compiler.runtime=dynamic
compiler.version=194
os=Windows

[options]
zlib-ng/*:zlib_compat=True

[replace_requires]
zlib/*: zlib-ng/2.2.2

However, when I try to install all the dependencies for minizip-ng, I encounter the following error:

Error: minizip-ng/4.0.7: Error in generate() method, line 125
	deps.generate()
	ConanException: error generating context for 'openssl/3.3.2': Component 'zlib-ng::zlib' not found in 'zlib-ng' package requirement

It seems that using [replace_requires] modifies the component from zlib::zlib to zlib-ng::zlib. However, for the zlib_compat=True option, I believe the component should remain zlib::zlib. This issue also occurs when I try to use OpenSSL directly as a dependency (without involving minizip-ng).

Any guidance or suggestions on resolving this would be greatly appreciated.

Additional Info:

  • Conan version: 2.9.1

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@memsharded
Copy link
Member

Thanks for your question @karel-tomanec

I have been able to reproduce with:

conan install --requires="minizip-ng/[*]" -pr=profile --build=missing

I am investigating it.

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

No branches or pull requests

2 participants