From 7525479a9576f1ca4c2d04339d78e47ff5ae9b05 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Mon, 3 Aug 2026 07:28:10 -0400 Subject: [PATCH] ci: fix binary discovery It looks like the location of executables is changing in Cargo's test runner, so use the blessed way of discovering an executable. That is, for ripgrep, consult the `CARGO_BIN_EXE_rg` environment variable. --- tests/util.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/util.rs b/tests/util.rs index db7331c2..c0aa59cf 100644 --- a/tests/util.rs +++ b/tests/util.rs @@ -177,7 +177,11 @@ impl Dir { /// Returns the path to the ripgrep executable. pub fn bin(&self) -> process::Command { - let rg = self.root.join(format!("../rg{}", env::consts::EXE_SUFFIX)); + let rg = std::env::var_os("CARGO_BIN_EXE_rg") + .map(PathBuf::from) + .unwrap_or_else(|| { + self.root.join(format!("../rg{}", env::consts::EXE_SUFFIX)) + }); match cross_runner() { None => process::Command::new(rg), Some(runner) => {