Skip to content

Commit 68ab2a1

Browse files
committed
Fix build.rs to check TARGET instead of host for eBPF compilation
1 parent 9796af5 commit 68ab2a1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

build.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ fn main() -> Result<()> {
99
setup_cross_compilation_libs();
1010

1111
// Compile eBPF programs on Linux when the feature is enabled
12-
if cfg!(target_os = "linux") && env::var("CARGO_FEATURE_EBPF").is_ok() {
12+
// Check TARGET environment variable, not cfg!, to handle cross-compilation correctly
13+
let target = env::var("TARGET").unwrap_or_default();
14+
if target.contains("linux") && env::var("CARGO_FEATURE_EBPF").is_ok() {
1315
compile_ebpf_programs();
1416
}
1517

0 commit comments

Comments
 (0)