从源码编译cita-cli时报告错误,use of deprecated item 'protobuf::lazy::ONCE_INIT'

Installing cita-cli v20.2.2 (/Users/tomcat/Downloads/cita-cli/cita-cli)
Updating crates.io index
Compiling cita-tool v0.19.0 (/Users/tomcat/Downloads/cita-cli/cita-tool)
error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:162:19
|
162 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: lint level defined here
–> cita-tool/src/lib.rs:3:9
|
3 | #![deny(warnings)]
| ^^^^^^^^
= note: #[deny(deprecated)] implied by #[deny(warnings)]

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:189:19
|
189 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:642:19
|
642 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:709:19
|
709 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:888:19
|
888 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:915:19
|
915 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:1081:19
|
1081 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:1108:19
|
1108 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:1372:19
|
1372 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:1414:19
|
1414 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:1855:19
|
1855 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:1922:19
|
1922 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:2148:19
|
2148 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:2180:19
|
2180 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:2410:19
|
2410 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:2442:19
|
2442 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:2592:19
|
2592 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:2614:19
|
2614 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:2850:19
|
2850 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:2882:19
|
2882 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:3091:19
|
3091 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:3118:19
|
3118 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:3304:19
|
3304 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:3331:19
|
3331 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:3507:19
|
3507 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:3534:19
|
3534 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:3669:19
|
3669 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:3691:19
|
3691 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:3751:19
|
3751 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:3806:19
|
3806 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::lazy::ONCE_INIT’: Regenerate .proto files to use safer initializer
–> cita-tool/src/protos/blockchain.rs:4077:11
|
4077 | lock: ::protobuf::lazy::ONCE_INIT,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::reflect::message::MessageDescriptor::new’: Please regenerate .rs files from .proto files to use newer APIs
–> cita-tool/src/protos/blockchain.rs:178:17
|
178 | ::protobuf::reflect::MessageDescriptor::new::(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::reflect::message::MessageDescriptor::new’: Please regenerate .rs files from .proto files to use newer APIs
–> cita-tool/src/protos/blockchain.rs:698:17
|
698 | ::protobuf::reflect::MessageDescriptor::new::(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::reflect::message::MessageDescriptor::new’: Please regenerate .rs files from .proto files to use newer APIs
–> cita-tool/src/protos/blockchain.rs:904:17
|
904 | ::protobuf::reflect::MessageDescriptor::new::(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::reflect::message::MessageDescriptor::new’: Please regenerate .rs files from .proto files to use newer APIs
–> cita-tool/src/protos/blockchain.rs:1097:17
|
1097 | ::protobuf::reflect::MessageDescriptor::new::(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::reflect::message::MessageDescriptor::new’: Please regenerate .rs files from .proto files to use newer APIs
–> cita-tool/src/protos/blockchain.rs:1403:17
|
1403 | ::protobuf::reflect::MessageDescriptor::new::(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::reflect::message::MessageDescriptor::new’: Please regenerate .rs files from .proto files to use newer APIs
–> cita-tool/src/protos/blockchain.rs:1911:17
|
1911 | ::protobuf::reflect::MessageDescriptor::new::(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::reflect::message::MessageDescriptor::new’: Please regenerate .rs files from .proto files to use newer APIs
–> cita-tool/src/protos/blockchain.rs:2169:17
|
2169 | ::protobuf::reflect::MessageDescriptor::new::(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::reflect::message::MessageDescriptor::new’: Please regenerate .rs files from .proto files to use newer APIs
–> cita-tool/src/protos/blockchain.rs:2431:17
|
2431 | ::protobuf::reflect::MessageDescriptor::new::(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::reflect::message::MessageDescriptor::new’: Please regenerate .rs files from .proto files to use newer APIs
–> cita-tool/src/protos/blockchain.rs:2603:17
|
2603 | ::protobuf::reflect::MessageDescriptor::new::(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::reflect::message::MessageDescriptor::new’: Please regenerate .rs files from .proto files to use newer APIs
–> cita-tool/src/protos/blockchain.rs:2871:17
|
2871 | ::protobuf::reflect::MessageDescriptor::new::(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::reflect::message::MessageDescriptor::new’: Please regenerate .rs files from .proto files to use newer APIs
–> cita-tool/src/protos/blockchain.rs:3107:17
|
3107 | ::protobuf::reflect::MessageDescriptor::new::(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::reflect::message::MessageDescriptor::new’: Please regenerate .rs files from .proto files to use newer APIs
–> cita-tool/src/protos/blockchain.rs:3320:17
|
3320 | ::protobuf::reflect::MessageDescriptor::new::(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::reflect::message::MessageDescriptor::new’: Please regenerate .rs files from .proto files to use newer APIs
–> cita-tool/src/protos/blockchain.rs:3523:17
|
3523 | ::protobuf::reflect::MessageDescriptor::new::(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::reflect::message::MessageDescriptor::new’: Please regenerate .rs files from .proto files to use newer APIs
–> cita-tool/src/protos/blockchain.rs:3680:17
|
3680 | ::protobuf::reflect::MessageDescriptor::new::(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::reflect::enums::EnumDescriptor::new’: Please regenerate .rs files from .proto files to use newer APIs
–> cita-tool/src/protos/blockchain.rs:3756:17
|
3756 | ::protobuf::reflect::EnumDescriptor::new(“ProofType”, file_descriptor_proto())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: use of deprecated item ‘protobuf::reflect::enums::EnumDescriptor::new’: Please regenerate .rs files from .proto files to use newer APIs
–> cita-tool/src/protos/blockchain.rs:3811:17
|
3811 | ::protobuf::reflect::EnumDescriptor::new(“Crypto”, file_descriptor_proto())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 47 previous errors

error: failed to compile cita-cli v20.2.2 (/Users/tomcat/Downloads/cita-cli/cita-cli), intermediate artifacts can be found at /Users/tomcat/Downloads/cita-cli/target

Caused by:
could not compile cita-tool.

代码从git上拿下来,没有任何调整。请给点建议,谢谢。

你的 rust 版本是多少?
可能是编译器版本的问题。

rustc 1.42.0 (b8cedc004 2020-03-09)

哦,这个可能太新了,编译 protobuf 生成的文件有点问题。
我们用的还是 1.39.0

我本地rustc也是1.42.0,编译最新的master分支是没问题的。
@myfreshcity 你编译的源码是哪个版本?自己有做修改吗?

master分支,没有修改任何代码。 我的是mac系统,但版本是10.13.6。发布二进制包好像是基于mac10.15的版本,所以用源码打包编译。但报告了这个错误。protobuf的源文件blockchain.proto没有上传,如果有这个文件,我们可以自己生成新的.rs文件。
错误看起来是支持的protobuf版本太低导致的。
不得已我只能暂时允许warnings级别,让编译通过。

cita 的 proto 文件都放在下面这个仓库:

我知道怎么回事了。
你是按照项目的Readme里,cargo install编译安装的。
我之前都是直接 Cargo build的。
cargo install确实会有这样的报错,应该是开了更高的告警级别。
我回头把这个问题修复一下。

另外,proto文件就是上面 @leeyr 发的那个链接。
但是其实cita-cli源码里是有个submodule的。
git submodule init
git submodule update
执行上面两条命令就可以了看到proto文件了。

已经修复

谢谢 给力 :+1: