diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-22 18:05:06 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-22 18:05:06 +0900 |
| commit | 62c206032a09f6b19777c1b3bc6f4ca3da71cdc3 (patch) | |
| tree | 0b19ca9d377cec842fc10e6a7acb46420cd5bb61 /crates/shirabe/src | |
| parent | ec5f3292ac324789298c3a12972f8f78b688ca24 (diff) | |
| download | php-shirabe-62c206032a09f6b19777c1b3bc6f4ca3da71cdc3.tar.gz php-shirabe-62c206032a09f6b19777c1b3bc6f4ca3da71cdc3.tar.zst php-shirabe-62c206032a09f6b19777c1b3bc6f4ca3da71cdc3.zip | |
fix(event-dispatcher): run COMPOSER_BINARY without a PHP interpreter
`@composer <args>` and a bare `composer <args>` 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 <shirabe path> install` and could not run: Shirabe ships as a native
executable, not a phar.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src')
| -rw-r--r-- | crates/shirabe/src/event_dispatcher/event_dispatcher.rs | 10 |
1 files changed, 6 insertions, 4 deletions
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() ), |
