diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-02 22:46:44 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-02 22:46:44 +0900 |
| commit | 3c61a7e1e557e3b90128d2ec29227f166b17c05b (patch) | |
| tree | e68f5a03ac3ca5ba3a1ab29de755b18e0f3228e5 /crates/mozart | |
| parent | 8da98493daf5013585e07ec98ca6960a42924edf (diff) | |
| download | php-mozart-3c61a7e1e557e3b90128d2ec29227f166b17c05b.tar.gz php-mozart-3c61a7e1e557e3b90128d2ec29227f166b17c05b.tar.zst php-mozart-3c61a7e1e557e3b90128d2ec29227f166b17c05b.zip | |
feat(resolver): support inline #ref pin and default-branch alias
Adds the missing pieces for installer fixtures that pin a dev package
via `dev-foo#hex` or rely on Composer's `default-branch: true` synthetic
`9999999-dev` alias.
Mirrors Composer at four layers:
1. `mozart_semver::parse_single` strips `dev-...#hex` / `....x-dev#hex`
suffixes from constraints (Composer's `parseConstraint` regex).
2. `PackagistVersion` carries `default_branch`. When set on a `dev-`
package with no numeric prefix, `packagist_to_pool_inputs` emits
the synthetic `9999999-dev` alias — but skips it when an explicit
`extra.branch-alias` already covers the version (matches
`ArrayLoader::getBranchAlias`).
3. `RuleSetGenerator::generate` picks up `addRulesForRootAliases`:
any pool alias whose target was added gets its own alias↔target
rules so the SAT solver pulls them in together.
4. `lockfile::generate_lock_file` extracts root `#hex` overrides from
`require`/`require-dev` and rewrites source/dist references (and
github/gitlab/bitbucket archive URLs) on the matched package, the
`setSourceDistReferences` ladder Composer runs in `PoolBuilder`.
Resolver also infers `Stability::Dev` from a `dev-foo` style
single-atom constraint when no explicit `@flag` is given, mirroring
the second loop of `RootPackageLoader::extractStabilityFlags` so the
package isn't filtered out under default `stable` minimum-stability.
Newly green: install_branch_alias_composer_repo, install_reference,
conflict_with_alias_prevents_update_if_not_required,
unbounded_conflict_matches_default_branch.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart')
| -rw-r--r-- | crates/mozart/tests/installer.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/mozart/tests/installer.rs b/crates/mozart/tests/installer.rs index d674485..fcb29c1 100644 --- a/crates/mozart/tests/installer.rs +++ b/crates/mozart/tests/installer.rs @@ -244,7 +244,7 @@ installer_fixture!( ); installer_fixture!(conflict_with_alias_in_lock_does_prevents_install, ignore); installer_fixture!(conflict_with_alias_prevents_update, ignore); -installer_fixture!(conflict_with_alias_prevents_update_if_not_required, ignore); +installer_fixture!(conflict_with_alias_prevents_update_if_not_required); installer_fixture!(conflict_with_all_dependencies_option_dont_recommend_to_use_it); installer_fixture!(deduplicate_solver_problems); installer_fixture!(disjunctive_multi_constraints); @@ -276,7 +276,7 @@ installer_fixture!(install_missing_alias_from_lock, ignore); installer_fixture!(install_overridden_platform_packages, ignore); installer_fixture!(install_package_and_its_provider_skips_original); installer_fixture!(install_prefers_repos_over_package_versions, ignore); -installer_fixture!(install_reference, ignore); +installer_fixture!(install_reference); installer_fixture!(install_security_advisory_matching_dependency); installer_fixture!(install_self_from_root); installer_fixture!(install_simple); @@ -361,7 +361,7 @@ installer_fixture!(suggest_replaced); installer_fixture!(suggest_uninstalled); installer_fixture!(unbounded_conflict_does_not_match_default_branch_with_branch_alias); installer_fixture!(unbounded_conflict_does_not_match_default_branch_with_numeric_branch); -installer_fixture!(unbounded_conflict_matches_default_branch, ignore); +installer_fixture!(unbounded_conflict_matches_default_branch); installer_fixture!( update_abandoned_package_required_but_blocked_via_audit_config, ignore |
