如何修改/影响/适应柯南依赖

时间:2021-04-23 09:10:28

标签: conan

我不是柯南专家,所以也许有一个明显的解决方案。但这不是微不足道的,因为我为此苦苦挣扎了一段时间并且找不到解决方案。

我们的项目需要镶木地板,我们通过像这样的柯南箭头包 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/1.1.1j 冲突。

我觉得这很烦人,因为我们明确不想要也不需要 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 被引入的原因是因为 thrift 和 libevent。

鉴于我们无法更改 CI 容器,因为这样我们基本上会放弃对我们需要支持的平台的支持,因此这里有什么解决方案?

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

  • 我们能否以某种方式影响箭头的依赖树以避免对 openssl 的任何引用?例如。提供没有 openssl 的 thrift/libevent 的专用版本(如果这甚至可能的话)?

  • 还有其他选择吗?

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

1 个答案:

答案 0 :(得分:2)

明显的建议:Update柯南到最新版本 (1.35.1)。

pip install -U conan

柯南中心索引(所有官方)中的包不会被任何旧版本阻止,实际上它是强制性的,必须使用最新的柯南版本进行测试。 Conan Center Index 假设您也运行最新的 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 首先依赖于柯南版本?我们不能修复或解决这个问题吗?

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

<块引用>

我们能否以某种方式影响箭头的依赖树以避免对 openssl 的任何引用?例如。提供没有 openssl 的 thrift/libevent 的专用版本(如果这甚至可能的话)?

可以,但不推荐。您可以在 conanfile.txt 中声明箭头使用的其他包版本,它会强制柯南使用您的版本。

<块引用>

还有其他选择吗?

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

相关问题