From 7057b2332cbad8934c3bfcded70566ce8dc16963 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 3 May 2026 19:46:20 +0900 Subject: fix(install): honour config.allow-missing-requirements Composer's Installer::doInstall prints the missing-requirement warnings and continues when config.allow-missing-requirements is true, rather than bailing with ERROR_LOCK_FILE_INVALID. Mozart was always bailing, diverging on the install-from-incomplete-lock-with-ignore fixture. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/mozart/src/commands/install.rs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'crates/mozart/src/commands') diff --git a/crates/mozart/src/commands/install.rs b/crates/mozart/src/commands/install.rs index 62a7d21..7a5ebe9 100644 --- a/crates/mozart/src/commands/install.rs +++ b/crates/mozart/src/commands/install.rs @@ -1204,9 +1204,21 @@ pub async fn run( for line in &missing { console.info(line); } - return Err(mozart_core::exit_code::bail_silent( - mozart_core::exit_code::LOCK_FILE_INVALID, - )); + // Mirrors `Composer\Installer::doInstall()` lines 749-756: when + // `config.allow-missing-requirements` is true, print the warnings + // but proceed with what the lock already covers instead of + // bailing with ERROR_LOCK_FILE_INVALID. + let allow_missing = root_pkg + .extra_fields + .get("config") + .and_then(|v| v.get("allow-missing-requirements")) + .and_then(|v| v.as_bool()) + .unwrap_or(false); + if !allow_missing { + return Err(mozart_core::exit_code::bail_silent( + mozart_core::exit_code::LOCK_FILE_INVALID, + )); + } } let platform_problems = collect_install_platform_problems( -- cgit v1.3.1