Skip to content

Commit 8e1b512

Browse files
committed
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.
1 parent 8539c49 commit 8e1b512

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ballista/scheduler/build.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,18 @@
1818
fn main() -> Result<(), String> {
1919
#[cfg(feature = "build-binary")]
2020
println!("cargo:rerun-if-changed=scheduler_config_spec.toml");
21+
2122
#[cfg(feature = "build-binary")]
2223
configure_me_codegen::build_script_auto()
2324
.map_err(|e| format!("configure_me code generation failed: {e}"))?;
2425

26+
#[cfg(feature = "keda-scaler")]
2527
println!("cargo:rerun-if-changed=proto/keda.proto");
28+
29+
#[cfg(feature = "keda-scaler")]
2630
tonic_build::configure()
2731
.compile_protos(&["proto/keda.proto"], &["proto"])
28-
.map_err(|e| format!("protobuf compilation failed: {e}"))
32+
.map_err(|e| format!("protobuf compilation failed: {e}"))?;
33+
34+
Ok(())
2935
}

0 commit comments

Comments
 (0)