From bed0cd33ca32b95aed9d65891f97649a6f9d0069 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 18 Aug 2026 06:38:26 +0900 Subject: fix(process-executor): model commands as a CommandLine enum Commands were carried as `PhpMixed`, whose `String`/`List` variants do not tell a shell command line apart from an argv list at the type level. `Perforce::execute_command` and `Git::run_command` therefore funnelled string commands through `execute_args`, spawning `p4 set` or `git command` as a single argument instead of running it through a shell as PHP does; their tests were written against that shape. Introduce `CommandLine::{Shell, Args}` and use it for every `ProcessExecutor` entry point, the mock expectation queue and the `Git::run_command` callables. The unreachable "Invalid command type" branches disappear with it, and the affected tests go back to the string expectations the PHP suite uses. Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe/src/platform/hhvm_detector.rs | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'crates/shirabe/src/platform/hhvm_detector.rs') diff --git a/crates/shirabe/src/platform/hhvm_detector.rs b/crates/shirabe/src/platform/hhvm_detector.rs index a80b9028..ac2bbf78 100644 --- a/crates/shirabe/src/platform/hhvm_detector.rs +++ b/crates/shirabe/src/platform/hhvm_detector.rs @@ -58,22 +58,17 @@ impl HhvmDetectorInterface for HhvmDetector { std::rc::Rc::new(std::cell::RefCell::new(ProcessExecutor::new(None))) }); let mut version_output = shirabe_php_shim::PhpMixed::Null; - let cmd = shirabe_php_shim::PhpMixed::List( - [ - hhvm_path.as_str(), - "--php", - "-d", - "hhvm.jit=0", - "-r", - "echo HHVM_VERSION;", - ] - .into_iter() - .map(|s| shirabe_php_shim::PhpMixed::String(s.to_string())) - .collect(), - ); + let cmd = [ + hhvm_path.as_str(), + "--php", + "-d", + "hhvm.jit=0", + "-r", + "echo HHVM_VERSION;", + ]; let exit_code = executor .borrow_mut() - .execute(cmd, &mut version_output, None) + .execute(&cmd, &mut version_output, None) .unwrap_or(1); if exit_code == 0 { *cache = Some(version_output.as_string().map(|s| s.to_string())); -- cgit v1.3.1-4-g156e