Skip to content

Commit 5c41e8f

Browse files
committed
fix: pin protoc versions
1 parent a8edecc commit 5c41e8f

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ merkle_proof = { git = "https://github.com/sigp/lighthouse.git", package = "merk
8585
prost = "0.13"
8686
prost-build = "0.13"
8787
prost-types = "0.13"
88+
protoc-bin-vendored = "3.2.0"
8889
rand = { version = "0.8.5", features = ["std_rng"] }
8990
redb = "3.0.0"
9091
reqwest = { version = "0.12", default-features = false, features = ["json", "multipart", "rustls-tls"] }

crates/types/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ async-trait.workspace = true
4848

4949
[build-dependencies]
5050
prost-build = { workspace = true }
51+
protoc-bin-vendored = { workspace = true }
5152

5253
[lints]
5354
workspace = true

crates/types/build.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#![allow(missing_docs)]
22

33
use std::io::Result;
4+
use std::env;
45

56
fn main() -> Result<()> {
67
let protos = &["proto/consensus.proto", "proto/sync.proto", "proto/liveness.proto"];
@@ -9,6 +10,12 @@ fn main() -> Result<()> {
910
println!("cargo:rerun-if-changed={proto}");
1011
}
1112

13+
if env::var("PROTOC").is_err() {
14+
let protoc = protoc_bin_vendored::protoc_bin_path()
15+
.map_err(|error| std::io::Error::new(std::io::ErrorKind::Other, error))?;
16+
env::set_var("PROTOC", protoc);
17+
}
18+
1219
let mut config = prost_build::Config::new();
1320
config.enable_type_names();
1421
config.bytes(["."]);

0 commit comments

Comments
 (0)