forked from vllm-project/router
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.rs
More file actions
31 lines (26 loc) · 1.18 KB
/
build.rs
File metadata and controls
31 lines (26 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Only regenerate if the proto file changes
println!("cargo:rerun-if-changed=src/proto/vllm_scheduler.proto");
// Configure protobuf compilation with custom settings
let config = tonic_prost_build::Config::new();
// Skip serde for types that use prost_types::Struct
// These cause conflicts and we don't need serde for all generated types
// Configure tonic-build for gRPC code generation
tonic_prost_build::configure()
// Generate both client and server code
.build_server(true)
.build_client(true)
// Add a module-level attribute for documentation and clippy warnings
.server_mod_attribute(
"vllm.grpc.scheduler",
"#[allow(unused, clippy::mixed_attributes_style)]",
)
.client_mod_attribute(
"vllm.grpc.scheduler",
"#[allow(unused, clippy::mixed_attributes_style)]",
)
// Compile the proto file with the custom config
.compile_with_config(config, &["src/proto/vllm_scheduler.proto"], &["src/proto"])?;
println!("cargo:warning=Protobuf compilation completed successfully");
Ok(())
}