Skip to content

Commit b57ad11

Browse files
committed
🐛 fix: vendor protoc for publish verification
1 parent f27d1cd commit b57ad11

4 files changed

Lines changed: 71 additions & 1 deletion

File tree

Cargo.lock

Lines changed: 65 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ prost = "0.14.3"
3939
prost-build = "0.14.3"
4040
prost-reflect = { version = "0.16.3", features = ["serde"] }
4141
prost-types = "0.14.3"
42+
protoc-bin-vendored = "3.2.0"
4243
rand = "0.9.2"
4344
reqwest = { version = "0.13.2", default-features = false, features = ["json", "query", "rustls", "http2"] }
4445
salsa20 = "0.10.2"

crates/aelf-proto/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pbjson-build.workspace = true
2020
prost.workspace = true
2121
prost-build.workspace = true
2222
prost-types.workspace = true
23+
protoc-bin-vendored.workspace = true
2324

2425
[lints]
2526
workspace = true

crates/aelf-proto/build.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ use std::path::PathBuf;
55
fn main() -> Result<(), Box<dyn std::error::Error>> {
66
let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
77
let proto_root = manifest_dir.join("proto/upstream");
8+
let protoc = protoc_bin_vendored::protoc_bin_path()?;
9+
let protoc_include = protoc_bin_vendored::include_path()?;
810
let mut files = collect_proto_files(&proto_root)?;
911
files.sort();
1012

@@ -20,7 +22,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
2022
config.compile_well_known_types();
2123
config.extern_path(".google.protobuf", "::pbjson_types");
2224
config.include_file("_includes.rs");
23-
config.compile_protos(&files, &[proto_root])?;
25+
config.protoc_executable(protoc);
26+
config.compile_protos(&files, &[proto_root, protoc_include])?;
2427

2528
let descriptor_bytes = fs::read(&descriptor_path)?;
2629
let packages = collect_packages(&descriptor_bytes)?;

0 commit comments

Comments
 (0)