如何修改/影响/调整conan依赖关系



我不是conan专家,所以可能有一个明显的解决方案。但这不可能是微不足道的,因为我已经为此挣扎了一段时间,找不到解决方案。

我们的项目需要镶木地板,我们通过这样的conanarrow包将其包括在内,conanfile.txt:

[requires]
arrow/2.0.0
[generators]
cmake
[options]
spdlog:=gcc
arrow:shared=False
arrow:parquet=True
arrow:fPIC=False
arrow:with_re2=False
arrow:with_protobuf=False
arrow:with_openssl=False
arrow:with_gflags=False
arrow:with_glog=False
arrow:with_grpc=False
arrow:with_utf8proc=False
arrow:with_zstd=False
arrow:with_bz2=False

(我删除了所有其他包,但没有那么多(

问题出在我们的CI上,我们得到了错误:

...
Downloading conanmanifest.txt
Downloading conanfile.py
Downloading conan_export.tgz
thrift/0.13.0: Downloaded recipe revision 0
openssl/1.1.1j: Not found in local cache, looking in remotes...
openssl/1.1.1j: Trying with 'conan-center'...
Downloading conanmanifest.txt
Downloading conanfile.py
Downloading conan_export.tgz
openssl/1.1.1j: Downloaded recipe revision 0
ERROR: openssl/1.1.1j: Cannot load recipe.
Error loading conanfile at '/conan/.conan/data/openssl/1.1.1j/_/_/export/conanfile.py': Current Conan version (1.32.1) does not satisfy the defined one (>=1.33.0).
CMake Error at cmake/conan.cmake:368 (message):
Conan install failed='1'
Call Stack (most recent call first):
cmake/conan.cmake:448 (conan_cmake_install)
CMakeLists.txt:137 (conan_cmake_run)
-- Configuring incomplete, errors occurred!
See also "/builds/0/corsika/build/CMakeFiles/CMakeOutput.log".

正确地表明,在CI上,我们使用conan 1.32.1的容器,这似乎与想要>=1.33.0.

我觉得这很烦人,因为我们明确不想要也不需要openssl,并且我们为箭头关闭了它(见上文(。

当我运行conan info .时,我可以看到:

conanfile.txt
ID: 33d8c2433f5e03548c5229121dbd4f82e354000d
BuildID: None
Requires:
arrow/2.0.0
arrow/2.0.0
ID: cd50fd05198137f0420bf6da1e5029dade26bc93
BuildID: None
Remote: conan-center=https://conan.bintray.com
URL: https://github.com/conan-io/conan-center-index
Homepage: https://arrow.apache.org/
License: Apache-2.0
Description: Apache Arrow is a cross-language development platform for in-memory data
Topics: conan, arrow, memory
Provides: arrow
Recipe: Cache
Binary: Missing
Binary remote: conan-center
Creation date: 2020-11-22 17:53:36 UTC
Required by:
conanfile.txt
Requires:
thrift/0.13.0
boost/1.75.0
ID: d9d3e501899335bccbe5205508f9a4801424ce7d
BuildID: None
Remote: conan-center=https://conan.bintray.com
URL: https://github.com/conan-io/conan-center-index
Homepage: https://www.boost.org
License: BSL-1.0
Description: Boost provides free peer-reviewed portable C++ source libraries
Topics: conan, boost, libraries, cpp
Provides: boost
Recipe: Cache
Binary: Download
Binary remote: conan-center
Creation date: 2021-04-13 19:51:36 UTC
Required by:
thrift/0.13.0
Requires:
zlib/1.2.11
bzip2/1.0.8
libiconv/1.16
bzip2/1.0.8
ID: da606cf731e334010b0bf6e85a2a6f891b9f36b0
BuildID: None
Remote: conan-center=https://conan.bintray.com
URL: https://github.com/conan-io/conan-center-index
Homepage: http://www.bzip.org
License: bzip2-1.0.8
Description: bzip2 is a free and open-source file compression program that uses the Burrows Wheeler algorithm.
Topics: conan, bzip2, data-compressor, file-compression
Provides: bzip2
Recipe: Cache
Binary: Cache
Binary remote: conan-center
Creation date: 2020-09-04 10:44:14 UTC
Required by:
boost/1.75.0
libevent/2.1.12
ID: 6b0981c427aa0eb8bea05add2094df29ed639799
BuildID: None
Remote: conan-center=https://conan.bintray.com
URL: https://github.com/conan-io/conan-center-index
Homepage: https://github.com/libevent/libevent
License: BSD-3-Clause
Description: libevent - an event notification library
Topics: conan, libevent, event
Provides: libevent
Recipe: Cache
Binary: Cache
Binary remote: conan-center
Creation date: 2021-03-18 17:32:39 UTC
Required by:
thrift/0.13.0
Requires:
openssl/1.1.1j
libiconv/1.16
ID: 6af9cc7cb931c5ad942174fd7838eb655717c709
BuildID: None
Remote: conan-center=https://conan.bintray.com
URL: https://github.com/conan-io/conan-center-index
Homepage: https://www.gnu.org/software/libiconv/
License: LGPL-2.1
Description: Convert text to and from Unicode
Topics: libiconv, iconv, text, encoding, locale, unicode, conversion
Provides: libiconv
Recipe: Cache
Binary: Cache
Binary remote: conan-center
Creation date: 2020-10-04 02:46:44 UTC
Required by:
boost/1.75.0
openssl/1.1.1j
ID: 6af9cc7cb931c5ad942174fd7838eb655717c709
BuildID: None
Remote: conan-center=https://conan.bintray.com
URL: https://github.com/conan-io/conan-center-index
Homepage: https://github.com/openssl/openssl
License: OpenSSL
Description: A toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols
Topics: conan, openssl, ssl, tls, encryption, security
Provides: openssl
Recipe: Cache
Binary: Cache
Binary remote: conan-center
Creation date: 2021-03-26 21:05:40 UTC
Required by:
thrift/0.13.0
libevent/2.1.12
thrift/0.13.0
ID: 44b3a17b9712eb98c7cab65c26ec70335992ff20
BuildID: None
Remote: conan-center=https://conan.bintray.com
URL: https://github.com/conan-io/conan-center-index
Homepage: https://github.com/apache/thrift
License: Apache-2.0
Description: Thrift is an associated code generation mechanism for RPC
Topics: conan, thrift, serialization, rpc
Provides: thrift
Recipe: Cache
Binary: Download
Binary remote: conan-center
Creation date: 2021-03-30 05:58:58 UTC
Required by:
arrow/2.0.0
Requires:
boost/1.75.0
openssl/1.1.1j
zlib/1.2.11
libevent/2.1.12
zlib/1.2.11
ID: 6af9cc7cb931c5ad942174fd7838eb655717c709
BuildID: None
Remote: conan-center=https://conan.bintray.com
URL: https://github.com/conan-io/conan-center-index
Homepage: https://zlib.net
License: Zlib
Description: A Massively Spiffy Yet Delicately Unobtrusive Compression Library (Also Free, Not to Mention Unencumbered by Patents)
Topics: conan, zlib, compression
Provides: zlib
Recipe: Cache
Binary: Cache
Binary remote: conan-center
Creation date: 2020-11-15 04:53:34 UTC
Required by:
thrift/0.13.0
boost/1.75.0

引入openssl的原因似乎是因为节俭和libevent。

那么,考虑到我们不能更改CI容器,因为这样我们基本上就放弃了对需要支持的平台的支持,这里的解决方案是什么呢?

  • 为什么openssl首先依赖于conan版本?我们不能解决这个问题吗?

  • 我们能以某种方式影响arrow的依赖树以避免引用openssl吗?例如,提供不带openssl的专用版本的srift/libevent(如果可能的话(?

  • 还有其他选择吗?

(作为一个脚注,我们使用的容器和系统都不是非常过时,所以我相信这个问题很容易影响到许多用户。经过一段时间的搜索,我还没有找到任何解决方案。(

显而易见的建议:将柯南更新到最新版本(1.35.1(。

pip install -U conan

柯南中心索引(所有官方(中的包没有被任何旧版本阻止,事实上,这是强制性的,用最新的柯南版本来测试它们。柯南中心索引假设您也在运行最新的柯南客户端版本:

https://github.com/conan-io/conan-center-index/blob/41d4fbb8c218f9d938ccb8b9d888bff52002e62e/.github/PULL_REQUEST_TEMPLATE.md#L9

https://github.com/conan-io/conan-center-index/blob/c060f7086f3745361795fb6379bd6f0bac000bab/docs/how_to_add_packages.md#L57

为什么openssl首先依赖于conan版本?我们不能解决这个问题吗?

每个新版本都会引入新柯南功能。你不能因为正在食用食谱而简单地更改食谱。即使你下载了配方并删除了该检查,它也会失败,因为你的柯南客户端版本不支持该配方中的某些方法/功能。

我们能以某种方式影响arrow的依赖树以避免任何对openssl的引用吗?例如,提供不带openssl的专用版本的srift/libevent(如果可能的话(?

可以,但不推荐使用。你可以在你的conanfile.txt中声明箭头消耗的其他包版本,这将迫使柯南使用你的版本。

还有其他选择吗?

是的,不要尝试变通方法,做正确的事情,更新您的客户端版本。

相关内容

最新更新