conan info
命令用于获取有关包的依赖关系图的信息。以thrift
为例,如下查询thrift/0.13.0
的依赖关系详情:
$ conan info thrift/0.13.0@
boost/1.78.0
ID: ff68d7a235dfb0d14c40ddef58cc716150cba5f6
BuildID: None
Context: host
Remote: conancenter=https://center.conan.io
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: libraries, cpp
Provides: boost
Recipe: Cache
Binary: Missing
Binary remote: conancenter
Creation date: 2022-02-21 16:11:05 UTC
Required by:
thrift/0.13.0
Requires:
zlib/1.2.11
bzip2/1.0.8
bzip2/1.0.8
ID: d9d4b222f9e8db0529bc4a08685d8a80c5b6eadb
BuildID: None
Context: host
Remote: conancenter=https://center.conan.io
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: bzip2, data-compressor, file-compression
Provides: bzip2
Recipe: Cache
Binary: Download
Binary remote: conancenter
Creation date: 2022-01-24 21:45:30 UTC
Required by:
boost/1.78.0
libevent/2.1.12
ID: 00ca1cc2eae480d2d07a9224b72d320c5b3fae8d
BuildID: None
Context: host
Remote: conancenter=https://center.conan.io
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: event, notification, networking, async
Provides: libevent
Recipe: Cache
Binary: Download
Binary remote: conancenter
Creation date: 2022-01-23 04:11:00 UTC
Required by:
thrift/0.13.0
Requires:
openssl/1.1.1m
openssl/1.1.1m
ID: 63da998e3642b50bee33f4449826b2d623661505
BuildID: None
Context: host
Remote: conancenter=https://center.conan.io
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: openssl, ssl, tls, encryption, security
Provides: openssl
Recipe: Cache
Binary: Missing
Binary remote: conancenter
Creation date: 2022-02-25 20:23:27 UTC
Required by:
libevent/2.1.12
thrift/0.13.0
thrift/0.13.0
ID: f2d1fdb95bb1e441f36c5f3675d1631dc13bbfbf
BuildID: None
Context: host
Remote: conancenter=https://center.conan.io
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: thrift, serialization, rpc
Provides: thrift
Recipe: Cache
Binary: Download
Binary remote: conancenter
Creation date: 2022-01-12 18:22:36 UTC
Requires:
boost/1.78.0
openssl/1.1.1m
zlib/1.2.11
libevent/2.1.12
zlib/1.2.11
ID: 63da998e3642b50bee33f4449826b2d623661505
BuildID: None
Context: host
Remote: conancenter=https://center.conan.io
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: zlib, compression
Provides: zlib
Recipe: Cache
Binary: Download
Binary remote: conancenter
Creation date: 2022-01-25 09:24:47 UTC
Required by:
thrift/0.13.0
boost/1.78.0
指定--graph
参数可以生成依赖关系图
$ conan info thrift/0.13.0@ -r conancenter --graph d:\tmp\info.html
用Chrome浏览器打开生成的info.html,如下:
包名末尾的
@
符号对于搜索特定包很重要。如果不添加@
,柯南会将参数解释为模式搜索(模糊匹配),并返回所有匹配thrift/0.13.0
的包,并且可能有不同的用户和频道。
需要说明的是,上面的示例中我们给conan info
命令的第一个参数是个包名thrift/0.13.0@
指定要获取 thrift/0.13.0
的依赖信息。
如果这个参数是个包含conanfile.py或conanfile.txt的路径,一样是有效的。
比如我们要获取自己的项目的依赖关系图,可以用:
$ conan info.
$ conan info./conanfile.txt
$ conan info./conanfile.py
这里.
代表当前文件夹(必须有conanfile.py或conanfile.txt),关于这部分可以参考Conan官方更详细的说明《Inspecting Dependencies》