We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9796af5 commit 68ab2a1Copy full SHA for 68ab2a1
1 file changed
build.rs
@@ -9,7 +9,9 @@ fn main() -> Result<()> {
9
setup_cross_compilation_libs();
10
11
// Compile eBPF programs on Linux when the feature is enabled
12
- if cfg!(target_os = "linux") && env::var("CARGO_FEATURE_EBPF").is_ok() {
+ // 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() {
15
compile_ebpf_programs();
16
}
17
0 commit comments