From b1f74fd83663d26e14f92300f452a3c997d93d62 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 15 Aug 2026 08:56:04 +0900 Subject: fix(php-rpc): unpack the runtime bundle under the cache dir A worker whose PHP cannot read the bundle out of the executable gets it from an unpacked copy, which went to a directory derived from XDG_CACHE_HOME alone. That ignored COMPOSER_CACHE_DIR, COMPOSER_HOME and the cache-dir setting, and put the files outside the directory clear-cache and the platform conventions cover. The callers now pass Composer's configured cache directory down to base_path(). Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe/src/console/application.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'crates/shirabe/src/console') diff --git a/crates/shirabe/src/console/application.rs b/crates/shirabe/src/console/application.rs index 56947243..1c0f0560 100644 --- a/crates/shirabe/src/console/application.rs +++ b/crates/shirabe/src/console/application.rs @@ -2439,7 +2439,19 @@ impl ApplicationHandle { && crate::plugin::find_file_in_registered_loaders(&dummy_str) .is_some() && { - EventDispatcher::ensure_composer_php_runtime()?; + let cache_dir = match composer_opt { + Some(ref composer_handle) => { + crate::composer::composer_full(composer_handle) + .get_config() + .borrow() + .get_str("cache-dir")? + } + None => Factory::create_config(Some(io.clone()), None)? + .get_str("cache-dir")?, + }; + EventDispatcher::ensure_composer_php_runtime( + std::path::Path::new(&cache_dir), + )?; crate::plugin::php_class_query( "class_exists", vec![shirabe_php_rpc::PluginValue::string( -- cgit v1.3.1-4-g156e