From c5172def752e82162a2bdf5c9c600cb3965391ee Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Thu, 28 Nov 2024 10:20:15 -0500 Subject: [PATCH] Avoid reading env needlessly --- test/integration-test/build.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/integration-test/build.rs b/test/integration-test/build.rs index f4578509..a65ecd78 100644 --- a/test/integration-test/build.rs +++ b/test/integration-test/build.rs @@ -56,15 +56,6 @@ fn main() { let out_dir = env::var_os("OUT_DIR").unwrap(); let out_dir = PathBuf::from(out_dir); - let endian = env::var_os("CARGO_CFG_TARGET_ENDIAN").unwrap(); - let target = if endian == "big" { - "bpfeb" - } else if endian == "little" { - "bpfel" - } else { - panic!("unsupported endian={:?}", endian) - }; - const C_BPF: &[(&str, bool)] = &[ ("ext.bpf.c", false), ("iter.bpf.c", true), @@ -76,6 +67,15 @@ fn main() { ]; if build_integration_bpf { + let endian = env::var_os("CARGO_CFG_TARGET_ENDIAN").unwrap(); + let target = if endian == "big" { + "bpfeb" + } else if endian == "little" { + "bpfel" + } else { + panic!("unsupported endian={:?}", endian) + }; + let libbpf_dir = manifest_dir .parent() .unwrap()