diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-06 02:48:36 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-06 02:48:36 +0900 |
| commit | b97e34358be5df05a3db9f5f3ef1502eaa94b1c0 (patch) | |
| tree | e0058b1ad79b60a3751f64ae6d07186cfddf1ee7 /crates/mozart/src/main.rs | |
| parent | 5254a9e9b698c3618229f4f802b39a82baf9169a (diff) | |
| download | php-mozart-b97e34358be5df05a3db9f5f3ef1502eaa94b1c0.tar.gz php-mozart-b97e34358be5df05a3db9f5f3ef1502eaa94b1c0.tar.zst php-mozart-b97e34358be5df05a3db9f5f3ef1502eaa94b1c0.zip | |
fix(cache): mirror Composer no-cache and cache-files-maxsize handling
--no-cache redirects COMPOSER_CACHE_DIR to /dev/null (mirrors Application::doRun).
cache_files_maxsize is now u64 with a "300MiB"-style string deserializer.
Cache::new() takes readonly instead of enabled; is_usable() detects null devices.
Diffstat (limited to 'crates/mozart/src/main.rs')
| -rw-r--r-- | crates/mozart/src/main.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/crates/mozart/src/main.rs b/crates/mozart/src/main.rs index 35f8485..701f3ef 100644 --- a/crates/mozart/src/main.rs +++ b/crates/mozart/src/main.rs @@ -76,6 +76,19 @@ async fn main() { return; }; + if cli.no_cache { + println!("Disabling cache usage"); + // SAFETY: single-threaded at this point; no other threads have started yet. + #[cfg(windows)] + unsafe { + std::env::set_var("COMPOSER_CACHE_DIR", "nul"); + } + #[cfg(not(windows))] + unsafe { + std::env::set_var("COMPOSER_CACHE_DIR", "/dev/null"); + } + } + init_tracing(cli.profile, cli.verbose, cli.quiet); match commands::execute(&cli).await { Ok(()) => {} |
