From 0020a39197a53a14c130ee12759e8cb9002636ef Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 27 Jun 2026 21:12:20 +0900 Subject: 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> 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) --- crates/shirabe/tests/installer/library_installer_test.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'crates/shirabe/tests/installer/library_installer_test.rs') diff --git a/crates/shirabe/tests/installer/library_installer_test.rs b/crates/shirabe/tests/installer/library_installer_test.rs index 42730fe..f519764 100644 --- a/crates/shirabe/tests/installer/library_installer_test.rs +++ b/crates/shirabe/tests/installer/library_installer_test.rs @@ -366,9 +366,11 @@ fn test_ensure_binaries_installed() { None, None, ); - library.__set_binary_installer(Box::new(RecordingBinaryInstaller { - calls: calls.clone(), - })); + library.__set_binary_installer(std::rc::Rc::new(std::cell::RefCell::new( + RecordingBinaryInstaller { + calls: calls.clone(), + }, + ))); let package = get_package("foo/bar", "1.0.0"); let expected_path = library.get_install_path(package.clone()).unwrap(); -- cgit v1.3.1