aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/commands/create_project.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-03 22:07:34 +0900
committernsfisis <nsfisis@gmail.com>2026-05-03 22:07:34 +0900
commit38706a6f0ceb773d473c4f5ddebf49e8e5ae46dc (patch)
treea38de4fbf27e6834eae3944bbd86ce53b13236cb /crates/mozart/src/commands/create_project.rs
parent64f8bb0c1aa16d78c5edc3f3de5dd3ff6e5861de (diff)
downloadphp-mozart-38706a6f0ceb773d473c4f5ddebf49e8e5ae46dc.tar.gz
php-mozart-38706a6f0ceb773d473c4f5ddebf49e8e5ae46dc.tar.zst
php-mozart-38706a6f0ceb773d473c4f5ddebf49e8e5ae46dc.zip
fix(update): apply --minimal-changes via policy preferred versions
The previous implementation pinned every resolved package back to its locked version after the resolve, which discarded the new versions the solver had to pick when a root constraint moved off the lock (e.g. a require bumped from `1.*` to `2.*`). The lock effectively never moved, so transitive cascades from a forced root-level update were lost. Mirror Composer's `Installer::createPolicy(forUpdate=true, minimalUpdate=true)` instead: thread the lock's `name → normalized version` map through the policy as `preferred_versions`. The solver now picks the locked version as a tiebreaker when it still satisfies the active constraints, but moves freely when a constraint forces a different version. Drop the post-process hook entirely.
Diffstat (limited to 'crates/mozart/src/commands/create_project.rs')
-rw-r--r--crates/mozart/src/commands/create_project.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/crates/mozart/src/commands/create_project.rs b/crates/mozart/src/commands/create_project.rs
index 89b3e4f..a7964ae 100644
--- a/crates/mozart/src/commands/create_project.rs
+++ b/crates/mozart/src/commands/create_project.rs
@@ -444,6 +444,7 @@ pub async fn execute(
locked_packages: Vec::new(),
block_abandoned: false,
root_branch_alias: None,
+ preferred_versions: indexmap::IndexMap::new(),
};
console.info("Resolving dependencies...");