Skip to content

Commit c3865f3

Browse files
authored
cargo: upgrade to protobuf 3.7 (#541)
* feat!: upgrade to protobuf 3.7 - keep some of the `get_` and `set_` methods around and mark them as deprecated - keep api changes to a minimal Signed-off-by: Sven Kanoldt <[email protected]> * fix: fix all issues related to api combatibility when the protobuf feature is not enabled Signed-off-by: Sven Kanoldt <[email protected]> * implement review feedback and close all minor remarks Signed-off-by: Sven Kanoldt <[email protected]> * fix ci errors Signed-off-by: Sven Kanoldt <[email protected]> --------- Signed-off-by: Sven Kanoldt <[email protected]> Signed-off-by: Sven Kanoldt <[email protected]>
1 parent 7e4e6f2 commit c3865f3

File tree

19 files changed

+1431
-1534
lines changed

19 files changed

+1431
-1534
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ features = ["nightly"]
1717

1818
[features]
1919
default = ["protobuf"]
20-
gen = ["protobuf-codegen-pure"]
20+
gen = ["protobuf-codegen"]
2121
nightly = ["libc"]
2222
process = ["libc", "procfs"]
2323
push = ["reqwest", "libc", "protobuf"]
@@ -28,7 +28,7 @@ fnv = "^1.0"
2828
lazy_static = "^1.4"
2929
libc = { version = "^0.2", optional = true }
3030
parking_lot = "^0.12"
31-
protobuf = { version = "^2.0", optional = true }
31+
protobuf = { version = "^3.7.2", optional = true }
3232
memchr = "^2.3"
3333
reqwest = { version = "^0.12", features = ["blocking"], optional = true }
3434
thiserror = "^2.0"
@@ -43,7 +43,7 @@ hyper = { version = "^0.14", features = ["server", "http1", "tcp"] }
4343
tokio = { version = "^1.0", features = ["macros", "rt-multi-thread"] }
4444

4545
[build-dependencies]
46-
protobuf-codegen-pure = { version = "^2.0", optional = true }
46+
protobuf-codegen = { version = "^3.7.2", optional = true }
4747

4848
[workspace]
4949
members = ["static-metric"]

build.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
#[cfg(feature = "gen")]
44
fn generate_protobuf_binding_file() {
5-
protobuf_codegen_pure::run(protobuf_codegen_pure::Args {
6-
out_dir: "proto",
7-
input: &["proto/proto_model.proto"],
8-
includes: &["proto"],
9-
..Default::default()
10-
})
11-
.unwrap();
5+
protobuf_codegen::Codegen::new()
6+
.out_dir("proto")
7+
.inputs(["proto/proto_model.proto"])
8+
.includes(["proto"])
9+
.run()
10+
.expect("Protobuf codegen failed");
1211
}
1312

1413
#[cfg(not(feature = "gen"))]

proto/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// @generated
2+
3+
pub mod proto_model;

0 commit comments

Comments
 (0)