From 4de018826e9dce90fd5cb78d468641478327ec99 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 6 Aug 2026 01:50:34 +0900 Subject: feat(plugin): run plugin-provided installers through the RPC worker A plugin can now hand an InstallerInterface implementation to InstallationManager::addInstaller across the wire, and a legacy composer-installer package is loaded as one; both are backed by a PhpInstallerProxy forwarding the whole installer contract to the entity in the PHP worker. An installer returning a real promise is an explicit error until promises can cross the boundary. InstallationManager takes installers as shared handles instead of boxes, so the object identity removeInstaller and PluginManager's registeredPlugins compare against survives registration, and holds them in a RefCell: Installer::run keeps a shared borrow of the manager for the whole run, and a plugin activated inside it registers its installer from there. The type cache keys on the installer itself, like upstream, so re-entrant registration cannot leave a stale index behind. InstallerInterface::supports is fallible for the same reason getCapabilities and getCommands are: it answers over RPC. Cloning a proxy stub clones the Rust-side entity and rebinds the copy to the fresh handle. Previously only the classes declaring __clone got a throwing body, and the rest let two stubs share (and twice release) one handle. Package entities answer with AnyPackage::dup, which already carries BasePackage::__clone and the RootAliasPackage override; the others are an explicit error. The package proxy covers the whole PackageInterface surface; only the link maps and the release date still lack a wire image for their value objects. PluginManager gains a test-only seam for the reported Plugin API version, and the three PluginInstallerTest cases that need it are ported. Co-Authored-By: Claude Opus 5 (1M context) --- docs/dev/plugin-class-classification.md | 7 ------- 1 file changed, 7 deletions(-) (limited to 'docs/dev/plugin-class-classification.md') diff --git a/docs/dev/plugin-class-classification.md b/docs/dev/plugin-class-classification.md index ab91ccda..ddba364d 100644 --- a/docs/dev/plugin-class-classification.md +++ b/docs/dev/plugin-class-classification.md @@ -436,13 +436,6 @@ which can cross the wire as values. The stub needs a bespoke story (e.g. a local Table bound to a proxying `OutputInterface`); until one is designed, both members raise explicit errors. -### Proxy clone semantics - -`clone $package` is a common plugin idiom (and `NoopInstaller::install` -does `$repo->addPackage(clone $package)`), but PHP `clone` on a proxy stub -copies the handle, not the Rust entity. The stub generator needs a -`__clone` that RPCs a clone of the entity. Undecided. - ## The classifier tool ### Dependencies and layout -- cgit v1.3.1