Merge pull request #653 from aya-rs/rebuild-on-changed

integration-test: properly rebuild bpf on change
reviewable/pr629/r24
ajwerner 1 year ago committed by GitHub
commit 28c4ad3e1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -96,6 +96,7 @@ fn main() {
for (src, dst) in c_bpf_probes {
let src = bpf_dir.join(src);
println!("cargo:rerun-if-changed={}", src.to_str().unwrap());
let mut cmd = Command::new("clang");
cmd.arg("-I")
.arg(&libbpf_headers_dir)
@ -117,6 +118,8 @@ fn main() {
}
let ebpf_dir = manifest_dir.parent().unwrap().join("integration-ebpf");
println!("cargo:rerun-if-changed={}", ebpf_dir.to_str().unwrap());
let target = format!("{target}-unknown-none");
let mut cmd = Command::new("cargo");
@ -129,6 +132,9 @@ fn main() {
"--target",
&target,
]);
// Workaround for https://github.com/rust-lang/cargo/issues/6412 where cargo flocks itself.
let ebpf_target_dir = out_dir.join("integration-ebpf");
cmd.arg("--target-dir").arg(&ebpf_target_dir);
let mut child = cmd
.stdout(Stdio::piped())
.spawn()

Loading…
Cancel
Save