-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Description
Describe the bug
OS: Windows
Conan version: 2.20.1
Problem
When I have [replace_requires] that replaces A with B then a package that has self.cpp_info.components[..].requires = ["A::A"] stops working.
Steps to reproduce
This can be reproduced using zlib (slightly changed) and openssl (unchanged) from conan-center.
- Have default profile with
replace_requiresthat renameszlibintolibz:
conan profile detect
(echo [replace_requires] & echo zlib/*: libz/*) >> %CONAN_HOME%\profiles\default> conan profile show
Host profile:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=14
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows
[replace_requires]
zlib/*: libz/*
...
- Clone https://github.com/conan-io/conan-center-index and replace name from
zlibtolibzinconan-center-index\recipes\zlib\all\conanfile.py:
diff --git a/recipes/zlib/all/conanfile.py b/recipes/zlib/all/conanfile.py
index 717b2e9d..daa51693 100644
--- a/recipes/zlib/all/conanfile.py
+++ b/recipes/zlib/all/conanfile.py
@@ -8,7 +8,7 @@ required_conan_version = ">=1.53.0"
class ZlibConan(ConanFile):
- name = "zlib"
+ name = "libz"
package_type = "library"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://zlib.net"- Create
libzpackage:
conan create --version 1.3.1 conan-center-index\recipes\zlib\all\- Create
opensslpackage:
conan create --version 3.5.2 conan-center-index\recipes\openssl\3.x.x\This step fail at test_package step:
======== Launching test_package ========
======== Computing dependency graph ========
Graph root
openssl/3.5.2 (test package): C:\conan-work\1\conan-center-index\recipes\openssl\3.x.x\test_package\conanfile.py
Requirements
libz/1.3.1#c7c1fafe83a3cafdb8348b6d1e7cc076 - Cache
openssl/3.5.2#cffa50e738053a8c3603e85a3fc4bc19 - Cache
Build requirements
nasm/2.16.01#31e26f2ee3c4346ecd347911bd126904 - Cache
strawberryperl/5.32.1.1#8d114504d172cfea8ea1662d09b6333e - Cache
Replaced requires
zlib/[>=1.2.11 <2]: libz/[>=1.2.11 <2]
...
======== Testing the package ========
...
ERROR: Error in generator 'CMakeDeps': error generating context for 'openssl/3.5.2': Component 'libz::zlib' not found in 'libz' package requirement
Expected behavior
[replace_requires] A/*: B/* must also replace A::A dependencies with B::B
For the example below, expected behavior is that openssl/3.5.2 depends on libz::libz component which means a dependency on all components in libz package according to docs
How to reproduce it
No response