From 8e1b512f19a19893d638da6a8e38ddd9310854ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Milenkovi=C4=87?= Date: Tue, 21 Jan 2025 21:15:19 +0000 Subject: [PATCH] fix: scheduler compiles keda even if it's disabled which will require `protoc` installed which affects user experience. with this patch `protoc` will be required only if `keda-scaler` feature is enabled. --- ballista/scheduler/build.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ballista/scheduler/build.rs b/ballista/scheduler/build.rs index 9f2f123f2..3c72b5cac 100644 --- a/ballista/scheduler/build.rs +++ b/ballista/scheduler/build.rs @@ -18,12 +18,18 @@ fn main() -> Result<(), String> { #[cfg(feature = "build-binary")] println!("cargo:rerun-if-changed=scheduler_config_spec.toml"); + #[cfg(feature = "build-binary")] configure_me_codegen::build_script_auto() .map_err(|e| format!("configure_me code generation failed: {e}"))?; + #[cfg(feature = "keda-scaler")] println!("cargo:rerun-if-changed=proto/keda.proto"); + + #[cfg(feature = "keda-scaler")] tonic_build::configure() .compile_protos(&["proto/keda.proto"], &["proto"]) - .map_err(|e| format!("protobuf compilation failed: {e}")) + .map_err(|e| format!("protobuf compilation failed: {e}"))?; + + Ok(()) }