From 62c206032a09f6b19777c1b3bc6f4ca3da71cdc3 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 22 Aug 2026 18:05:06 +0900 Subject: fix(event-dispatcher): run COMPOSER_BINARY without a PHP interpreter `@composer ` and a bare `composer ` script both re-enter the binary running the script, taken from COMPOSER_BINARY. That path used to be prefixed with the PHP interpreter command, which produced `php install` and could not run: Shirabe ships as a native executable, not a phar. Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe/src/event_dispatcher/event_dispatcher.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'crates/shirabe/src') diff --git a/crates/shirabe/src/event_dispatcher/event_dispatcher.rs b/crates/shirabe/src/event_dispatcher/event_dispatcher.rs index ece83533..fb3ad5f4 100644 --- a/crates/shirabe/src/event_dispatcher/event_dispatcher.rs +++ b/crates/shirabe/src/event_dispatcher/event_dispatcher.rs @@ -563,9 +563,10 @@ impl EventDispatcher { ); } if strpos(callable_str, "@composer ") == Some(0) { + // COMPOSER_BINARY is a native executable, so it is run directly instead + // of being passed to a PHP interpreter. let exec = format!( - "{} {} {}", - self.get_php_exec_command()?, + "{} {}", ProcessExecutor::escape( &Platform::get_env("COMPOSER_BINARY").unwrap_or_default() ), @@ -1012,9 +1013,10 @@ try {{ // resolution, even if bin-dir contains composer too because the project requires composer/composer // see https://github.com/composer/composer/issues/8748 if strpos(&exec, "composer ") == Some(0) { + // COMPOSER_BINARY is a native executable, so it is run directly instead + // of being passed to a PHP interpreter. exec = format!( - "{} {}{}", - self.get_php_exec_command()?, + "{}{}", ProcessExecutor::escape( &Platform::get_env("COMPOSER_BINARY").unwrap_or_default() ), -- cgit v1.3.1-4-g156e