From b97e34358be5df05a3db9f5f3ef1502eaa94b1c0 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 6 May 2026 02:48:36 +0900 Subject: 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. --- crates/mozart/src/main.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'crates/mozart/src/main.rs') 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(()) => {} -- cgit v1.3.1