aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/installer/plugin_installer.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-27 21:12:20 +0900
committernsfisis <nsfisis@gmail.com>2026-06-27 21:12:20 +0900
commit0020a39197a53a14c130ee12759e8cb9002636ef (patch)
treefc4419caf8c24d8ab22a4999faaf255005515d4a /crates/shirabe/src/installer/plugin_installer.rs
parent9759168c0c9b8120980b06734c0c029712bc7861 (diff)
downloadphp-shirabe-0020a39197a53a14c130ee12759e8cb9002636ef.tar.gz
php-shirabe-0020a39197a53a14c130ee12759e8cb9002636ef.tar.zst
php-shirabe-0020a39197a53a14c130ee12759e8cb9002636ef.zip
feat(installer): register default installers after Composer Rc is built
LibraryInstaller and PluginInstaller upgrade the Composer back-reference in their constructors, so they could not be built inside Rc::new_cyclic where the weak handle is not yet upgradeable. Defer create_default_ installers until after the cyclic Rc is established, where the weak handle resolves, and implement it to register Library -> Plugin -> Metapackage with a single shared BinaryInstaller. To share one BinaryInstaller (as Composer does), LibraryInstaller's binary_installer becomes Rc<RefCell<dyn BinaryInstallerInterface>> instead of an owned Box; PluginInstaller and the __set_binary_installer test seam follow. This clears "Unknown installer type: metapackage". Un-ignores the six remove tests that now pass; the remaining install/remove tests are re-labeled for the next blocker (InstallationManager::execute_batch still leaves the install/cleanup/repo.write promise chain as a todo!() stub, so package operations do not actually execute). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/installer/plugin_installer.rs')
-rw-r--r--crates/shirabe/src/installer/plugin_installer.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/shirabe/src/installer/plugin_installer.rs b/crates/shirabe/src/installer/plugin_installer.rs
index cd4de0a..28e4e0d 100644
--- a/crates/shirabe/src/installer/plugin_installer.rs
+++ b/crates/shirabe/src/installer/plugin_installer.rs
@@ -1,7 +1,6 @@
//! ref: composer/src/Composer/Installer/PluginInstaller.php
use crate::composer::PartialComposerWeakHandle;
-use crate::installer::BinaryInstaller;
use crate::installer::BinaryPresenceInterface;
use crate::installer::InstallerInterface;
use crate::installer::LibraryInstaller;
@@ -25,7 +24,9 @@ impl PluginInstaller {
io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
composer: PartialComposerWeakHandle,
fs: Option<std::rc::Rc<std::cell::RefCell<Filesystem>>>,
- binary_installer: Option<BinaryInstaller>,
+ binary_installer: Option<
+ std::rc::Rc<std::cell::RefCell<dyn crate::installer::BinaryInstallerInterface>>,
+ >,
) -> Self {
Self {
inner: LibraryInstaller::new(