aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart-registry/src
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-23 01:52:22 +0900
committernsfisis <nsfisis@gmail.com>2026-02-23 01:59:22 +0900
commit612af0aaacda404b8e177d0c1a6d3bd937e8d39a (patch)
treee7a74752686e3216a533f7437d3838dc10c58328 /crates/mozart-registry/src
parentcc8f22ff7f1d9ed32e14f5b59a5498f8aa653091 (diff)
downloadphp-mozart-612af0aaacda404b8e177d0c1a6d3bd937e8d39a.tar.gz
php-mozart-612af0aaacda404b8e177d0c1a6d3bd937e8d39a.tar.zst
php-mozart-612af0aaacda404b8e177d0c1a6d3bd937e8d39a.zip
fix(update): implement --with constraints, inline shorthand, and APCu passthrough
- Parse and apply --with temporary constraints to the resolver - Support inline constraint shorthand (vendor/pkg:1.0.*) - Reject --lock combined with specific package names - Filter magic keywords (lock/nothing/mirrors) from package list - Pass APCu CLI flags through to InstallConfig instead of hardcoding Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart-registry/src')
-rw-r--r--crates/mozart-registry/src/lockfile.rs1
-rw-r--r--crates/mozart-registry/src/resolver.rs10
2 files changed, 11 insertions, 0 deletions
diff --git a/crates/mozart-registry/src/lockfile.rs b/crates/mozart-registry/src/lockfile.rs
index 682dbb1..bfae4ee 100644
--- a/crates/mozart-registry/src/lockfile.rs
+++ b/crates/mozart-registry/src/lockfile.rs
@@ -1031,6 +1031,7 @@ mod tests {
ignore_platform_reqs: false,
ignore_platform_req_list: vec![],
repo_cache: None,
+ temporary_constraints: HashMap::new(),
};
let resolved = resolve(&resolve_request)
diff --git a/crates/mozart-registry/src/resolver.rs b/crates/mozart-registry/src/resolver.rs
index 3e0936f..898a91c 100644
--- a/crates/mozart-registry/src/resolver.rs
+++ b/crates/mozart-registry/src/resolver.rs
@@ -345,6 +345,9 @@ pub struct ResolveRequest {
pub ignore_platform_req_list: Vec<String>,
/// Optional on-disk repo cache for Packagist API responses.
pub repo_cache: Option<Cache>,
+ /// Temporary version constraint overrides (from --with flag).
+ /// Maps package name (lowercase) to constraint string.
+ pub temporary_constraints: HashMap<String, String>,
}
/// A single package in the resolution output.
@@ -394,6 +397,12 @@ pub async fn resolve(request: &ResolveRequest) -> Result<Vec<ResolvedPackage>, R
}
}
+ // Apply temporary constraints (from --with flag or inline shorthand).
+ // These override existing root constraints or add new ones for transitive deps.
+ for (name, constraint) in &request.temporary_constraints {
+ root_requires.insert(name.clone(), Some(constraint.clone()));
+ }
+
// Capture data needed by spawn_blocking
let handle = tokio::runtime::Handle::current();
let repo_cache = request.repo_cache.clone();
@@ -928,6 +937,7 @@ mod tests {
ignore_platform_reqs: false,
ignore_platform_req_list: vec![],
repo_cache: None,
+ temporary_constraints: HashMap::new(),
};
let result = resolve(&request).await;