From 49cbb1366f18ce58da0443b833084a3af8394cc4 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Thu, 27 Jul 2023 22:03:57 -0400 Subject: [PATCH] integration-test: rerun-if-changed=integration-ebpf See code commentary for details. --- test/integration-test/build.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/integration-test/build.rs b/test/integration-test/build.rs index cf01869b..8ce23465 100644 --- a/test/integration-test/build.rs +++ b/test/integration-test/build.rs @@ -135,13 +135,21 @@ fn main() { let Package { manifest_path, .. } = integration_ebpf_package; let integration_ebpf_dir = manifest_path.parent().unwrap(); + // We have a build-dependency on `integration-ebpf`, so cargo will automatically rebuild us + // if `integration-ebpf`'s *library* target or any of its dependencies change. Since we + // depend on `integration-ebpf`'s *binary* targets, that only gets us half of the way. This + // stanza ensures cargo will rebuild us on changes to the binaries too, which gets us the + // rest of the way. + println!("cargo:rerun-if-changed={}", integration_ebpf_dir.as_str()); + let mut cmd = Command::new("cargo"); cmd.args([ "build", "-Z", "build-std=core", - "--release", + "--bins", "--message-format=json", + "--release", "--target", &target, ]);