From 9eecfe303c944c80556b0b25fcd3ce6bbce3aeb8 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 3 May 2026 16:34:10 +0900 Subject: fix(install): reject locks where two packages claim the same name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mirror Composer's `RuleSetGenerator::addConflictRules` SAME_NAME pass on the locked package set: a package's `getNames(false)` is its canonical name plus the names it claims via `replace`, and any name with two providers makes the lock-verify solve unsatisfiable. Mozart's `install` skips that solve, so the conflict slipped through and both packages were installed; surface it explicitly and exit DEPENDENCY_RESOLUTION_FAILED. `provide` targets are deliberately excluded — `getNames(false)` excludes them, since multiple providers of a virtual name may co-exist. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/mozart/tests/installer.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'crates/mozart/tests/installer.rs') diff --git a/crates/mozart/tests/installer.rs b/crates/mozart/tests/installer.rs index 4c877cc..cb7f430 100644 --- a/crates/mozart/tests/installer.rs +++ b/crates/mozart/tests/installer.rs @@ -332,10 +332,7 @@ installer_fixture!(replace_priorities); installer_fixture!(replace_range_require_single_version); installer_fixture!(replace_root_require); installer_fixture!(replaced_packages_should_not_be_installed); -installer_fixture!( - replaced_packages_should_not_be_installed_when_installing_from_lock, - ignore -); +installer_fixture!(replaced_packages_should_not_be_installed_when_installing_from_lock); installer_fixture!(replacer_satisfies_its_own_requirement); installer_fixture!(repositories_priorities); installer_fixture!(repositories_priorities2); -- cgit v1.3.1