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/plugin/plugin_manager.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'crates/shirabe/src/plugin') diff --git a/crates/shirabe/src/plugin/plugin_manager.rs b/crates/shirabe/src/plugin/plugin_manager.rs index 1d8e6192..75852348 100644 --- a/crates/shirabe/src/plugin/plugin_manager.rs +++ b/crates/shirabe/src/plugin/plugin_manager.rs @@ -405,7 +405,12 @@ impl PluginManager { // The plugin code runs in the PHP worker: load the Composer PHP runtime (contracts like // PluginInterface) and the reverse-RPC autoloader before touching plugin classes there. - EventDispatcher::ensure_composer_php_runtime()?; + let cache_dir = composer + .borrow() + .get_config() + .borrow() + .get_str("cache-dir")?; + EventDispatcher::ensure_composer_php_runtime(std::path::Path::new(&cache_dir))?; EventDispatcher::ensure_script_autoloader()?; if let Some(files) = map.get("files").and_then(|v| v.as_array()) { -- cgit v1.3.1-4-g156e