diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-06 03:47:55 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-06 03:47:55 +0900 |
| commit | 8c5dba294fae26c8a46a308a46676e0afff217d6 (patch) | |
| tree | 4b5d51a82acc41ed4e49e42269dcf27b982b472a /crates/shirabe/src/dependency_resolver | |
| parent | 0abd0141380aa491ad6e65c58979e2fa371e3df0 (diff) | |
| download | php-shirabe-8c5dba294fae26c8a46a308a46676e0afff217d6.tar.gz php-shirabe-8c5dba294fae26c8a46a308a46676e0afff217d6.tar.zst php-shirabe-8c5dba294fae26c8a46a308a46676e0afff217d6.zip | |
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<String, Link>, dropping the lossy re-key-by-target in the
AliasPackage/RootAliasPackage constructors.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/dependency_resolver')
| -rw-r--r-- | crates/shirabe/src/dependency_resolver/pool.rs | 3 |
1 files changed, 0 insertions, 3 deletions
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 |
