From 177b894d7d77a5297bee3b2487ef18a0cae7a596 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 3 May 2026 21:50:54 +0900 Subject: fix(resolver): expand root branch-alias and self.version replace links Two related parity gaps surfaced by the `circular-dependency` fixture: 1. The root's `extra.branch-alias` entry was never materialized in the pool, and root-level `replace`/`provide`/`conflict` constraints written as `self.version` were forwarded verbatim. Mirror Composer's `RootAliasPackage`: resolve `self.version` against the root's declared version for the base entry, then add an extra alias entry (carrying the base links plus a duplicate link per `self.version` original retagged at the alias's version) when the root's version matches an `extra.branch-alias` key. 2. `Pool::matches_package` returned on the first link to a target name even when its constraint did not match the query, hiding any later link to the same target. With the alias above, that masked the second `replace` link tagged at the alias version. Keep iterating when target matches but constraint does not, so a later link can still satisfy. --- crates/mozart/src/commands/require.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'crates/mozart/src/commands/require.rs') diff --git a/crates/mozart/src/commands/require.rs b/crates/mozart/src/commands/require.rs index 110bd1a..0816d13 100644 --- a/crates/mozart/src/commands/require.rs +++ b/crates/mozart/src/commands/require.rs @@ -665,6 +665,7 @@ pub async fn execute( locked_package_names: indexmap::IndexSet::new(), locked_packages: Vec::new(), block_abandoned: false, + root_branch_alias: None, }; // Print header messages @@ -1075,6 +1076,7 @@ mod tests { locked_package_names: IndexSet::new(), locked_packages: Vec::new(), block_abandoned: false, + root_branch_alias: None, }; let resolved = resolver::resolve(&request) @@ -1152,6 +1154,7 @@ mod tests { locked_package_names: IndexSet::new(), locked_packages: Vec::new(), block_abandoned: false, + root_branch_alias: None, }; let resolved = resolver::resolve(&request) -- cgit v1.3.1