From 8c5dba294fae26c8a46a308a46676e0afff217d6 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 6 Jun 2026 03:47:55 +0900 Subject: fix(dependency-resolver): preserve PHP array keying for alias links Mirror PHP's array_merge semantics in AliasPackage so self.version provide/replace/conflict links are appended under numeric keys ("0", "1", ...) instead of collapsing onto the target-name key. This keeps both the original and alias-version links and makes Pool::match's contains_key("0") check (= PHP isset($x[0])) work as intended. replace_self_version_dependencies now takes and returns IndexMap, dropping the lossy re-key-by-target in the AliasPackage/RootAliasPackage constructors. Co-Authored-By: Claude Opus 4.8 --- crates/shirabe/src/dependency_resolver/pool.rs | 3 --- 1 file changed, 3 deletions(-) (limited to 'crates/shirabe/src/dependency_resolver') diff --git a/crates/shirabe/src/dependency_resolver/pool.rs b/crates/shirabe/src/dependency_resolver/pool.rs index 708930c..91c3e31 100644 --- a/crates/shirabe/src/dependency_resolver/pool.rs +++ b/crates/shirabe/src/dependency_resolver/pool.rs @@ -336,9 +336,6 @@ impl Pool { let replaces = candidate.get_replaces(); // aliases create multiple replaces/provides for one target so they can not use the shortcut below - // TODO(phase-b): PHP uses isset($replaces[0])/isset($provides[0]) to detect numeric-indexed - // lists; the Rust IndexMap is string-keyed, so this branch checks the "0" key. Confirm - // semantics during Phase B review. if replaces.contains_key("0") || provides.contains_key("0") { for link in provides.values() { if link.get_target() == name -- cgit v1.3.1