Skip to content

Commit

Permalink
fix: add experimental_allow_proto3_optional compile option
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuliquan committed Aug 3, 2024
1 parent 6ff0884 commit 91c6af3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/arroyo-rpc/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ use std::env;
use std::path::PathBuf;

fn main() -> Result<(), Box<dyn std::error::Error>> {
tonic_build::compile_protos("proto/rpc.proto")?;
tonic_build::configure()
.protoc_arg("--experimental_allow_proto3_optional")
.compile(&["proto/rpc.proto"], &["proto/"])?;

let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());

tonic_build::configure()
.protoc_arg("--experimental_allow_proto3_optional")
.file_descriptor_set_path(out_dir.join("api_descriptor.bin"))
.type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]")
.type_attribute(".", "#[serde(rename_all = \"camelCase\")]")
Expand Down

0 comments on commit 91c6af3

Please sign in to comment.