From 581d5c8f5f73b0fff553279ba8e848d407be2291 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Fri, 14 Jul 2023 18:18:57 -0400 Subject: [PATCH] integration-test: bust cache on bpf-linker This is useful when iterating on bpf-linker locally, which is otherwise an undeclared input to this build. We could use an artifact dependency[0] here, but they are unstable and bpf-linker requires gymnastics to build correctly (for now). [0] https://doc.rust-lang.org/cargo/reference/unstable.html#artifact-dependencies-dependency-declarations --- test/integration-test/Cargo.toml | 3 ++- test/integration-test/build.rs | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/test/integration-test/Cargo.toml b/test/integration-test/Cargo.toml index 8fb11bda..82ccfcdf 100644 --- a/test/integration-test/Cargo.toml +++ b/test/integration-test/Cargo.toml @@ -24,4 +24,5 @@ tokio = { version = "1.24", default-features = false, features = [ ] } [build-dependencies] -cargo_metadata = "0.15.4" +cargo_metadata = { version = "0.15.4", default-features = false } +which = { version = "4.4.0", default-features = false } diff --git a/test/integration-test/build.rs b/test/integration-test/build.rs index 7a802748..8f5596f0 100644 --- a/test/integration-test/build.rs +++ b/test/integration-test/build.rs @@ -12,6 +12,7 @@ use std::{ use cargo_metadata::{ Artifact, CompilerMessage, Dependency, Message, Metadata, MetadataCommand, Package, Target, }; +use which::which; fn main() { const AYA_BUILD_INTEGRATION_BPF: &str = "AYA_BUILD_INTEGRATION_BPF"; @@ -147,6 +148,9 @@ fn main() { } } + let bpf_linker = which("bpf-linker").unwrap(); + println!("cargo:rerun-if-changed={}", bpf_linker.to_str().unwrap()); + let mut cmd = Command::new("cargo"); cmd.args([ "build",