Watch
0
0
Fork
You've already forked hyperhive
0

hive-bash-mcp: find env on PATH where /usr/bin/env is missing, so the runner tests run in the nix sandbox

This commit is contained in:
damocles 2026-11-06 03:36:46 +01:00 • committed by mara
commit 431cb6e77f

View file

@ -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")