From 431cb6e77f647b3f8b270753e3e38d0c80fbd5bf Mon Sep 17 00:00:00 2001 From: damocles Date: Fri, 6 Nov 2026 03:36:46 +0100 Subject: [PATCH] hive-bash-mcp: find env on PATH where /usr/bin/env is missing, so the runner tests run in the nix sandbox --- hive-bash-mcp/src/runner.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hive-bash-mcp/src/runner.rs b/hive-bash-mcp/src/runner.rs index 48b15012..95bc833c 100644 --- a/hive-bash-mcp/src/runner.rs +++ b/hive-bash-mcp/src/runner.rs @@ -762,7 +762,15 @@ async fn exec_cmd( // `kill` and the timeout would have nothing left to act on. let stdout_file = std::fs::File::create(out_path)?; let stderr_file = std::fs::File::create(err_path)?; - let mut cmd_builder = Command::new("/usr/bin/env"); + // + // Where `/usr/bin/env` does not exist (the nix build sandbox, which the + // tests run in, has only `/bin/sh`), `env` is looked up on PATH instead. + let env = if Path::new("/usr/bin/env").exists() { + "/usr/bin/env" + } else { + "env" + }; + let mut cmd_builder = Command::new(env); cmd_builder .arg("bash") .arg("-c")