-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.rs
More file actions
31 lines (28 loc) · 986 Bytes
/
build.rs
File metadata and controls
31 lines (28 loc) · 986 Bytes
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
use std::env::consts;
use std::io::Result;
use std::process::Command;
use which::which;
fn main() -> Result<()> {
println!("Build setup for bec_log_ingestor.");
print!("Assuring availability of protoc... ");
let protoc_exists = which("protoc");
if protoc_exists.is_err() {
println!("protoc not found.");
if consts::OS != "linux" {
println!("Auto-fetching of protoc is only intended for use in CI, install it manually.")
} else {
let res = Command::new("sudo").arg("apt-get").arg("update").output();
println!("{:?}", &res);
if res.is_err() {};
let res = Command::new("sudo")
.arg("apt-get")
.arg("install")
.arg("protobuf-compiler")
.output();
println!("{:?}", &res);
if res.is_err() {};
}
};
prost_build::compile_protos(&["src/prometheus_write.proto"], &["src/"])?;
Ok(())
}