From e37b12d6e2d95b4d3924859732513e125fc552e0 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 3 May 2026 23:31:31 +0900 Subject: feat(registry): support type: path repositories MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a `mozart-php-serialize` crate (a byte-compatible port of PHP's `serialize()`) and a `mozart-registry::path_repository` module that expands `type: path` entries into synthetic `type: package` repositories. Each synthesized package carries the same SHA-1 dist reference Composer computes (`sha1(\$json . serialize(\$options))`) so the lockfile and trace lines match Composer byte-for-byte. Two latent bugs surfaced once the path-repo flow exercised real resolutions: - `apply_partial_update` swapped path-repo packages back to their locked version, defeating Composer's "path repos always reload" rule (`PoolBuilder` treats them as canonical, not lock-bound). Mirror the path-repo skip already used when constructing `locked_packages`. - `normalize_root_alias_atom` returned the raw input string for stable numeric atoms (e.g. `1.1.1`), so the alias matcher's `input.version \!= alias.version_normalized` check — comparing against pool inputs that carry the 4-segment normalized form — silently never matched. Run the parsed Version through Display so both sides are in the same shape. `install/update::run` gain a `path_repo_base_override: Option<&Path>` parameter for the in-process test harness: Composer's PHPUnit `InstallerTest::setUp` does `chdir(__DIR__)` so relative path-repo URLs resolve against `composer/tests/Composer/Test/`, but the Rust harness writes `composer.json` into a per-test tempdir and can't chdir safely under parallel tests. Production callers pass `None` and resolve against `working_dir`. Greens 3 ignored installer fixtures: partial_update_loads_root_aliases_for_path_repos alias_in_lock alias_in_lock2 --- Cargo.lock | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Cargo.lock') diff --git a/Cargo.lock b/Cargo.lock index 48e0f4d..697c3d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1178,6 +1178,10 @@ dependencies = [ "serde_json", ] +[[package]] +name = "mozart-php-serialize" +version = "0.1.0" + [[package]] name = "mozart-registry" version = "0.1.0" @@ -1190,6 +1194,7 @@ dependencies = [ "md5", "mozart-core", "mozart-metadata-minifier", + "mozart-php-serialize", "mozart-sat-resolver", "mozart-semver", "mozart-vcs", -- cgit v1.3.1