aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-07-04 03:20:13 +0900
committernsfisis <nsfisis@gmail.com>2026-07-04 16:58:29 +0900
commitf7b0eee15f17a4fa5db717cda5ddc387f884afd0 (patch)
tree387b157c31e9c5c85127ab3a5d78821d4e556212
parentd94e3ec276cb2fd344b6243cdbe5a5c9f3c3613a (diff)
downloadphp-shirabe-f7b0eee15f17a4fa5db717cda5ddc387f884afd0.tar.gz
php-shirabe-f7b0eee15f17a4fa5db717cda5ddc387f884afd0.tar.zst
php-shirabe-f7b0eee15f17a4fa5db717cda5ddc387f884afd0.zip
fix(installer): preserve fixedRootPackage identity for solver pool
PHP's createRepositorySet does `$this->fixedRootPackage = clone $this->package;` once and then passes that same object both to `new RootPackageRepository($this->fixedRootPackage)` and, later, to createRequest($this->fixedRootPackage) — object identity matters because the solver assigns a pool id by mutating the package object itself. The port instead called RootPackageInterfaceHandle::dup() a second time when registering the RootPackageRepository, producing a second object that never went through the pool and so never got an id. create_request's `request.fix_package(root_package_handle)` then referenced a package with id -1, which add_rules_for_request treats as a real bug: "Fixed package ... was not added to solver pool." This surfaced whenever a create-project run reached the second-stage install (i.e. every dist-installed project with real dependencies). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
-rw-r--r--crates/shirabe/src/installer.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/shirabe/src/installer.rs b/crates/shirabe/src/installer.rs
index 1e72a94..068b85c 100644
--- a/crates/shirabe/src/installer.rs
+++ b/crates/shirabe/src/installer.rs
@@ -1446,7 +1446,7 @@ impl Installer {
temporary_constraints,
);
repository_set.add_repository(crate::repository::RepositoryInterfaceHandle::new(
- RootPackageRepository::new(RootPackageInterfaceHandle::dup(&self.fixed_root_package)),
+ RootPackageRepository::new(self.fixed_root_package.clone()),
))?;
repository_set.add_repository(platform_repo.clone().into())?;
if let Some(ref additional_fixed_repository) = self.additional_fixed_repository {