Skip to content

Commit

Permalink
Vendored protoc binary (#6)
Browse files Browse the repository at this point in the history
- Add protoc-bin-vendored crate
- Use vendored protoc binary to generate protobufs
  • Loading branch information
roderickvd authored Aug 13, 2024
1 parent 3d766e9 commit 4f8b0d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ log = "0.4"
lru_time_cache = "0.11"
machine-uid = "0.5"
protobuf = { version = "3.2", features = ["with-bytes"] }
protoc-bin-vendored = "3.0"
rand = "0.8"
reqwest = { version = "0.12", default-features = false, features = ["brotli", "cookies", "gzip", "json", "macos-system-configuration", "native-tls", "stream"] }
semver = "1.0"
Expand All @@ -44,4 +45,4 @@ url = "2.3"
uuid = { version = "1.2", features = ["fast-rng", "serde", "v4", "v5"] }

[build-dependencies]
protobuf-codegen = "3"
protobuf-codegen = "3"
3 changes: 2 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ use std::path::Path;
fn main() {
let proto_dir = Path::new("src/protocol/connect/protos");

// Use `protoc` if available or fall back to a pure Rust parser.
protobuf_codegen::Codegen::new()
.protoc()
.protoc_path(&protoc_bin_vendored::protoc_bin_path().expect("could not find protoc binary"))
.cargo_out_dir("protos")
.include(proto_dir)
.input(proto_dir.join("queue.proto"))
Expand Down

0 comments on commit 4f8b0d2

Please sign in to comment.