From 095a098a4416d3222d26303a435fbdacc81db12e Mon Sep 17 00:00:00 2001 From: mo khan Date: Wed, 16 Jul 2025 16:50:56 -0600 Subject: chore: compile protobuf definitions --- .gitmodules | 2 +- Cargo.lock | 1 + Cargo.toml | 4 ++++ buf.gen.yaml | 2 ++ build.rs | 9 +++++++++ etc/proto/authzed | 1 + protos/authzed | 1 - 7 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 build.rs create mode 160000 etc/proto/authzed delete mode 160000 protos/authzed diff --git a/.gitmodules b/.gitmodules index b196c8e2..b657401e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "protos/authzed"] - path = protos/authzed + path = etc/proto/authzed url = https://github.com/authzed/api.git diff --git a/Cargo.lock b/Cargo.lock index 4f207d52..5489dd82 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -161,6 +161,7 @@ dependencies = [ "log", "please", "prost", + "prost-build", "prost-types", "reqwest", "serde", diff --git a/Cargo.toml b/Cargo.toml index da63829e..fb0668bc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,3 +32,7 @@ urlencoding = "2.1" tokio-stream = "0.1" tokio-test = "0.4.0" tonic-build = "0.13" + +[build-dependencies] +prost-build = "0.13.5" +tonic-build = "0.13" diff --git a/buf.gen.yaml b/buf.gen.yaml index 5af20b34..e7215145 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -6,3 +6,5 @@ plugins: out: src/rpc opt: - compile_well_known_types + - disable_comments + - skip_debug diff --git a/build.rs b/build.rs new file mode 100644 index 00000000..8ba38bf2 --- /dev/null +++ b/build.rs @@ -0,0 +1,9 @@ +use std::io::Result; + +fn main() -> Result<()> { + let _ = tonic_build::configure().out_dir("src/rpc").compile_protos( + &["etc/proto/authzed/authzed/api/v1/permission_service.proto"], + &["etc/proto/authzed"], + ); + Ok(()) +} diff --git a/etc/proto/authzed b/etc/proto/authzed new file mode 160000 index 00000000..93ee7611 --- /dev/null +++ b/etc/proto/authzed @@ -0,0 +1 @@ +Subproject commit 93ee7611fb4f7abeb69b2918c8509f24ccef366d diff --git a/protos/authzed b/protos/authzed deleted file mode 160000 index 93ee7611..00000000 --- a/protos/authzed +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 93ee7611fb4f7abeb69b2918c8509f24ccef366d -- cgit v1.2.3