fix: allow older versions of protobuf-compiler to work

Add --experimental_allow_proto3_optional protoc arg in build configs

fixes https://github.com/scsibug/nostr-rs-relay/issues/77
This commit is contained in:
Yuval Adam 2023-02-14 22:18:00 +02:00 committed by Greg Heartsfield
parent 1daa25600d
commit 35a1973a46
2 changed files with 15 additions and 3 deletions

View File

@ -1,4 +1,10 @@
fn main() -> Result<(), Box<dyn std::error::Error>> {
tonic_build::compile_protos("proto/nauthz.proto")?;
tonic_build::configure()
.build_server(false)
.protoc_arg("--experimental_allow_proto3_optional")
.compile(
&["proto/nauthz.proto"],
&["proto"],
)?;
Ok(())
}

View File

@ -1,4 +1,10 @@
fn main() -> Result<(), Box<dyn std::error::Error>> {
tonic_build::compile_protos("../proto/nauthz.proto")?;
tonic_build::configure()
.build_server(false)
.protoc_arg("--experimental_allow_proto3_optional")
.compile(
&["../proto/nauthz.proto"],
&["../proto"],
)?;
Ok(())
}
}