mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-10-18 11:02:54 +00:00
- Change eBPF build from required to optional with graceful fallback - Add match statement to handle build success, failure, and missing cargo-build-bpf cases - Add cargo warnings when eBPF build fails or cargo-build-bpf is not installed - Remove panic on build failure to allow compilation without eBPF toolchain
23 lines
702 B
Rust
23 lines
702 B
Rust
use std::process::Command;
|
|
|
|
fn main() {
|
|
// Try to build the eBPF program, but skip if cargo-build-bpf is not installed
|
|
let status = Command::new("cargo")
|
|
.args(&["build-bpf", "--release"])
|
|
.status();
|
|
|
|
match status {
|
|
Ok(status) if status.success() => {
|
|
// eBPF build succeeded
|
|
}
|
|
Ok(_) => {
|
|
// eBPF build failed, but continue without it
|
|
println!("cargo:warning=Failed to build eBPF program, continuing without it");
|
|
}
|
|
Err(_) => {
|
|
// cargo-build-bpf not installed, skip eBPF build
|
|
println!("cargo:warning=cargo-build-bpf not installed, skipping eBPF build");
|
|
}
|
|
}
|
|
}
|