From 30b5f12eef0ba9374fe5fc230fcbcc0bcfb21f89 Mon Sep 17 00:00:00 2001 From: Martin Vogel Date: Sun, 19 Jul 2026 06:50:47 +0200 Subject: [PATCH] fix(cli): install --dry-run always reports dry-run, even on a plan check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A dry-run mutates nothing (every install mutation is guarded by !dry_run), but on Windows the activation plan's PATH/agent-config probe can return non-OK, and the caller then returned early WITHOUT the dry-run summary - so `install --dry-run` neither indicated dry-run mode nor exited success (smoke Phase 6a). For a dry-run, emit the "(dry-run — no files were modified)" indicator and return CLI_OK on that path (the plan simply noted something), and log the underlying status to stderr for triage. POSIX is unaffected (its dry-run activation returns OK, so the branch is never taken). Signed-off-by: Martin Vogel --- src/cli/cli.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/cli/cli.c b/src/cli/cli.c index 7641a1228..f4f382a9a 100644 --- a/src/cli/cli.c +++ b/src/cli/cli.c @@ -10269,6 +10269,17 @@ int cbm_cmd_install(int argc, char **argv) { (void)cbm_rmdir(prepared_dir); } if (activation_rc != CLI_OK) { + /* A dry-run mutates nothing (every mutation is guarded by !dry_run), + * so a non-OK here is a plan-side check (agent-config / PATH probe) + * and must still report that it was a dry-run - on Windows it was + * silently skipping the summary and reading as a hard failure. Emit + * the dry-run indicator, and name the underlying status for triage. */ + if (dry_run) { + (void)fprintf(stderr, "note: install --dry-run plan check returned %d\n", + activation_rc); + printf("\n(dry-run — no files were modified)\n"); + return CLI_OK; + } return CLI_TRUE; }