From 82501a36a0fa6725d656742da42c860e75a89b89 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 2 May 2026 11:57:12 +0900 Subject: feat(resolver): real constraint intersection and replace-aware same-name conflicts `Pool::what_provides` previously accepted any provide/replace candidate because `constraints_intersect` returned true unconditionally; the same-name conflict pass also looked only at canonical names, so a package replacing another at v1.0.0 was treated as a valid provider for a v2.0.0 require and could coexist with the replaced package. Implement interval-based `VersionConstraint::intersects` and index packages by their `replace` targets (matching Composer's `getNames(false)`) when generating same-name conflict rules. Greens 3 installer fixtures: conflict_against_replaced_by_dep_package_problem, provider_conflicts3, replaced_packages_should_not_be_installed. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/mozart/tests/installer.rs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'crates/mozart/tests') diff --git a/crates/mozart/tests/installer.rs b/crates/mozart/tests/installer.rs index beeb8de..e1bc7a5 100644 --- a/crates/mozart/tests/installer.rs +++ b/crates/mozart/tests/installer.rs @@ -113,10 +113,7 @@ installer_fixture!( installer_fixture!(circular_dependency_errors); installer_fixture!(conflict_against_provided_by_dep_package_works); installer_fixture!(conflict_against_provided_package_works); -installer_fixture!( - conflict_against_replaced_by_dep_package_problem, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(conflict_against_replaced_by_dep_package_problem); installer_fixture!( conflict_against_replaced_package_problem, ignore = "mozart binary cannot yet run this fixture" @@ -254,10 +251,7 @@ installer_fixture!( ignore = "mozart binary cannot yet run this fixture" ); installer_fixture!(provider_conflicts2); -installer_fixture!( - provider_conflicts3, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(provider_conflicts3); installer_fixture!( provider_dev_require_can_satisfy_require, ignore = "mozart binary cannot yet run this fixture" @@ -287,10 +281,7 @@ installer_fixture!( installer_fixture!(replace_priorities); installer_fixture!(replace_range_require_single_version); installer_fixture!(replace_root_require); -installer_fixture!( - replaced_packages_should_not_be_installed, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(replaced_packages_should_not_be_installed); installer_fixture!( replaced_packages_should_not_be_installed_when_installing_from_lock, ignore = "mozart binary cannot yet run this fixture" -- cgit v1.3.1