From 2c97fe57e00d86a4a8c77ec245b4b31dd09c65f3 Mon Sep 17 00:00:00 2001 From: beltram Date: Tue, 13 Jun 2023 13:45:09 +0200 Subject: [PATCH] try separating mains --- lib/build.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/build.rs b/lib/build.rs index 627317ea..567c1447 100644 --- a/lib/build.rs +++ b/lib/build.rs @@ -1,10 +1,11 @@ +// otherwise fails while building Docker image +#[cfg(not(target_env = "musl"))] fn main() -> Result<(), Box> { - // otherwise fails while building Docker image - #[cfg(not(target_env = "musl"))] - { - for proto in std::fs::read_dir("tests/grpc/protos").unwrap() { - proto.map(|p| p.path()).ok().map(tonic_build::compile_protos).transpose()?; - } + for proto in std::fs::read_dir("tests/grpc/protos")? { + tonic_build::compile_protos(proto?.path())?; } Ok(()) } + +#[cfg(target_env = "musl")] +fn main() -> Result<(), Box> {}