Skip to content

Commit

Permalink
Merge pull request #15 from adrianreber/2023-01-16-protobuf-3
Browse files Browse the repository at this point in the history
Switch to protobuf 3.x crates
  • Loading branch information
adrianreber authored Jan 17, 2023
2 parents 87a5e0b + 243d352 commit 4b1b5da
Show file tree
Hide file tree
Showing 10 changed files with 6,266 additions and 7,004 deletions.
6 changes: 2 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ license-file = "LICENSE"

[dependencies]
libc = "0.2"
protobuf = "2.27.1"
anyhow = "1.0.56"

[build-dependencies]
protobuf-codegen-pure = "2.25.2"
protobuf = "3.2.0"
rust-criu-protobuf = { path = "rust-criu-protobuf" }

[lib]
name = "rust_criu"
Expand Down
10 changes: 1 addition & 9 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
extern crate protobuf_codegen_pure;

fn main() {
protobuf_codegen_pure::Codegen::new()
.out_dir("src/proto")
.inputs(["proto/rpc.proto"])
.include("proto")
.run()
.expect("Codegen failed.");

std::process::Command::new("gcc")
.args(["test/piggie.c", "-o", "test/piggie"])
.status()
.unwrap();
println!("cargo:rerun-if-changed=test/piggie.c");
}
14 changes: 14 additions & 0 deletions rust-criu-protobuf/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "rust-criu-protobuf"
version = "0.1.0"
edition = "2021"

[dependencies]
protobuf = "3.2.0"

[build-dependencies]
protobuf-codegen = "3.2.0"

[lib]
name = "rust_criu_protobuf"
path = "src/mod.rs"
11 changes: 11 additions & 0 deletions rust-criu-protobuf/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
extern crate protobuf_codegen;

fn main() {
protobuf_codegen::Codegen::new()
.includes(["proto"])
.input("proto/rpc.proto")
.out_dir("src")
.run_from_script();

println!("cargo:rerun-if-changed=proto/rpc.proto");
}
File renamed without changes.
3 changes: 3 additions & 0 deletions rust-criu-protobuf/src/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// @generated

pub mod rpc;
Loading

0 comments on commit 4b1b5da

Please sign in to comment.