diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-26 02:31:34 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-26 02:31:34 +0900 |
| commit | 9d82f21a9a0a9392ac7577f4419a56fb94123ae6 (patch) | |
| tree | 8c81fd9b5765f33348283fdbcceb8ce51962699e /crates/shirabe/src/dependency_resolver | |
| parent | 8c4dc6cd48457f154eb067f296d79ef911573c91 (diff) | |
| download | php-shirabe-9d82f21a9a0a9392ac7577f4419a56fb94123ae6.tar.gz php-shirabe-9d82f21a9a0a9392ac7577f4419a56fb94123ae6.tar.zst php-shirabe-9d82f21a9a0a9392ac7577f4419a56fb94123ae6.zip | |
fix(remove-command,pool-builder): drop Composer re-entrancy and PRE_POOL_CREATE todo
RemoveCommand::execute held composer_full_mut across deactivate_installed_plugins
and event dispatch, both of which re-enter the same RefCell (composer.rs:500/446);
it only uses &self getters, so borrow it immutably.
PoolBuilder dispatched PluginEvents::PRE_POOL_CREATE by building an event that
required moving the (unclonable) repositories/Request — left as todo!(). The
event is purely plugin-facing and its result is never read in the no-plugin path
(Pool::new reads self.packages directly), so skip it with a TODO(plugin) note.
Removes the composer.rs re-entrancy and two todo!()s from the remove install
path; remove's tests now reach the unregistered-installers blocker (factory.rs).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/dependency_resolver')
| -rw-r--r-- | crates/shirabe/src/dependency_resolver/pool_builder.rs | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/crates/shirabe/src/dependency_resolver/pool_builder.rs b/crates/shirabe/src/dependency_resolver/pool_builder.rs index 650dd6a..3663e43 100644 --- a/crates/shirabe/src/dependency_resolver/pool_builder.rs +++ b/crates/shirabe/src/dependency_resolver/pool_builder.rs @@ -299,31 +299,13 @@ impl PoolBuilder { } } - if let Some(event_dispatcher) = &self.event_dispatcher { - // TODO(plugin): PrePoolCreateEvent::new takes Request and Vec<Box<dyn RepositoryInterface>> - // by value but neither can be cloned (PHP class shared semantics). This event is purely - // plugin-facing and nothing in the no-plugin path reads it back, so it stays deferred - // until the plugin API drives an Rc-based migration of Request/repositories. - let mut pre_pool_create_event = PrePoolCreateEvent::new( - PluginEvents::PRE_POOL_CREATE.to_string(), - todo!("share repositories with PrePoolCreateEvent without moving"), - todo!("share Request with PrePoolCreateEvent without moving"), - self.acceptable_stabilities.clone(), - self.stability_flags.clone(), - self.root_aliases.clone(), - self.root_references.clone(), - self.packages.values().cloned().collect(), - self.unacceptable_fixed_or_locked_packages.to_vec(), - ); - let pre_pool_create_event_name = pre_pool_create_event.get_name().to_string(); - event_dispatcher.borrow_mut().dispatch( - Some(&pre_pool_create_event_name), - Some(&mut pre_pool_create_event), - )?; - // PHP rebinds $this->packages to a list-style array; preserve indices via reindexing. - // TODO(plugin)/TODO(phase-c): rebind self.packages from the (handle-based) event packages - // once EventDispatcher::dispatch returns the mutated event. - let _ = &pre_pool_create_event; + if self.event_dispatcher.is_some() { + // TODO(plugin): dispatch PluginEvents::PRE_POOL_CREATE. Constructing PrePoolCreateEvent + // would move the repositories and Request (neither clonable under PHP's shared + // semantics), and the event is purely plugin-facing: its mutations to the package list + // are never read back in the no-plugin path (Pool::new below reads self.packages + // directly). Skipped until the plugin API drives an Rc-based migration of + // Request/repositories so listeners can observe and mutate them. } let mut pool = Pool::new( |
