diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-03 12:36:34 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-03 12:36:34 +0900 |
| commit | c53dfc52f6449c8d5ca0b160a2a25f99790711f2 (patch) | |
| tree | 0d40dbf3a337f42982d3ee65f54a1c9824ee2b5f /crates/mozart/src/commands/require.rs | |
| parent | 2af684c6397001944c9d9aac20ca59677d6a9650 (diff) | |
| download | php-mozart-c53dfc52f6449c8d5ca0b160a2a25f99790711f2.tar.gz php-mozart-c53dfc52f6449c8d5ca0b160a2a25f99790711f2.tar.zst php-mozart-c53dfc52f6449c8d5ca0b160a2a25f99790711f2.zip | |
fix(resolver): carry root composer.json conflicts onto the in-pool root entry
The root pool entry now seeded from composer.json carried provides and
replaces but no conflicts, so a root-level conflict like
\`{"some/dep": ">=1.3"}\` was silently dropped. Composer keeps these on
the RootPackage (which lives in the pool via RootPackageRepository), and
the SAT generator turns them into rules that forbid any candidate matching
the constraint — including a branch alias that would resolve to a
matching version. Without that, Mozart cheerfully installs both the
required dev branch and its conflicting alias.
Plumb composer.json's \`conflict\` map through ResolveRequest as
root_conflict and project it onto the root pool entry as PoolLink
conflicts; all callers updated.
Unblocks conflict_on_root_with_alias_prevents_update_if_not_required and
conflict_with_alias_prevents_update installer fixtures.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/src/commands/require.rs')
| -rw-r--r-- | crates/mozart/src/commands/require.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/mozart/src/commands/require.rs b/crates/mozart/src/commands/require.rs index cac0dad..97d6b02 100644 --- a/crates/mozart/src/commands/require.rs +++ b/crates/mozart/src/commands/require.rs @@ -657,6 +657,11 @@ pub async fn execute( .iter() .map(|(k, v)| (k.clone(), v.clone())) .collect(), + root_conflict: raw + .conflict + .iter() + .map(|(k, v)| (k.clone(), v.clone())) + .collect(), }; // Print header messages @@ -1055,6 +1060,7 @@ mod tests { raw_repositories: vec![], root_provide: IndexMap::new(), root_replace: IndexMap::new(), + root_conflict: IndexMap::new(), }; let resolved = resolver::resolve(&request) @@ -1126,6 +1132,7 @@ mod tests { raw_repositories: vec![], root_provide: IndexMap::new(), root_replace: IndexMap::new(), + root_conflict: IndexMap::new(), }; let resolved = resolver::resolve(&request) |
