diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-02 17:21:29 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-02 17:21:29 +0900 |
| commit | 43efd895d24b7ccd2853fa5bcf08ad0e621f33ce (patch) | |
| tree | 6caa14192cb2c753b9699bc3c5d62fe334920718 /crates/mozart/src/commands/install.rs | |
| parent | 5b767cdd832d39816ee4c2dbf94274c0130dd572 (diff) | |
| download | php-mozart-43efd895d24b7ccd2853fa5bcf08ad0e621f33ce.tar.gz php-mozart-43efd895d24b7ccd2853fa5bcf08ad0e621f33ce.tar.zst php-mozart-43efd895d24b7ccd2853fa5bcf08ad0e621f33ce.zip | |
refactor(registry): plumb RepositorySet and executor through callers
ResolveRequest and LockFileGenerationRequest now take Arc<RepositorySet>
instead of a raw Cache. install_from_lock now accepts &mut dyn
InstallerExecutor instead of constructing FilesystemExecutor internally.
Both changes expose the DI injection points needed by the upcoming
in-process test harness, where Packagist must be replaced with an empty
RepositorySet (Composer's `'packagist' => false` test config) and
filesystem install execution must be replaced with a tracing recorder
(Composer's InstallationManagerMock).
The eager VCS scan and inline-package preload still happen inside
resolve(), so the RawRepository array is kept on ResolveRequest as
raw_repositories - migrating those through RepositorySet remains a
follow-up. RepositorySet gains with_packagist and empty constructors so
production callers and future tests have a uniform construction shape.
All 136 enabled installer fixtures + 114 mozart-registry tests + 541
mozart lib tests still green; clippy clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/src/commands/install.rs')
| -rw-r--r-- | crates/mozart/src/commands/install.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/mozart/src/commands/install.rs b/crates/mozart/src/commands/install.rs index b303ade..5053783 100644 --- a/crates/mozart/src/commands/install.rs +++ b/crates/mozart/src/commands/install.rs @@ -422,10 +422,8 @@ pub async fn install_from_lock( vendor_dir: &Path, config: &InstallConfig, console: &mozart_core::console::Console, + executor: &mut dyn InstallerExecutor, ) -> anyhow::Result<()> { - let cache_config = mozart_registry::cache::build_cache_config(config.no_cache); - let files_cache = mozart_registry::cache::Cache::files(&cache_config); - let dev_mode = config.dev_mode; // Step 1: Determine which packages to install @@ -506,7 +504,6 @@ pub async fn install_from_lock( console.info(&console_format!(" - Would remove <info>{}</info>", name)); } } else { - let mut executor = FilesystemExecutor::new(files_cache); let exec_ctx = ExecuteContext { vendor_dir: vendor_dir.to_path_buf(), no_progress: config.no_progress, @@ -761,6 +758,9 @@ pub async fn execute( let vendor_dir = working_dir.join("vendor"); // Step 7: Delegate to shared install_from_lock() + let cache_config = mozart_registry::cache::build_cache_config(cli.no_cache); + let files_cache = mozart_registry::cache::Cache::files(&cache_config); + let mut executor = FilesystemExecutor::new(files_cache); install_from_lock( &lock, &working_dir, @@ -781,6 +781,7 @@ pub async fn execute( no_cache: cli.no_cache, }, console, + &mut executor, ) .await } |
