Skip to content

Commit 9ef0f31

Browse files
committed
diag(cli): name which private-staging sub-step made the pair unrunnable
cli_windows_prepare_install_pair folded launcher staging, payload staging, the payload fingerprint match, and the staged-launcher --version probe into one bool, so the caller could only report "launcher/payload source pair did not remain runnable after private staging" without saying which sub-step failed. Windows cbm_exec_no_shell does not inherit the child's stderr, so the launcher's own refusal reason never reaches the log either. Split the checks so each failing sub-step prints a distinct error, turning the opaque Phase 8 smoke failure into a precise signal on the next run. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 6a6229b commit 9ef0f31

1 file changed

Lines changed: 30 additions & 8 deletions

File tree

‎src/cli/cli.c‎

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9537,14 +9537,36 @@ static bool cli_windows_prepare_install_pair(const wchar_t *launcher_source,
95379537
payload_length > 0 && (size_t)payload_length < sizeof(payload_target);
95389538
char launcher_fingerprint[CBM_DAEMON_BUILD_FINGERPRINT_SIZE];
95399539
char payload_fingerprint[CBM_DAEMON_BUILD_FINGERPRINT_SIZE];
9540-
ready =
9541-
ready &&
9542-
cli_windows_stage_private_file(launcher_source_utf8, launcher_target,
9543-
launcher_fingerprint) &&
9544-
cli_windows_stage_private_file(payload_source_utf8, payload_target, payload_fingerprint) &&
9545-
strcmp(payload_fingerprint, expected_payload_sha256) == 0;
9546-
const char *version_argv[] = {launcher_target, "--version", NULL};
9547-
ready = ready && cbm_exec_no_shell(version_argv) == CLI_OK;
9540+
/* Each sub-step is checked separately so a staging failure is
9541+
* distinguishable from a fingerprint mismatch or an unrunnable staged
9542+
* launcher: the caller's single "did not remain runnable" message hides
9543+
* which one failed, and cbm_exec_no_shell does not inherit the child's
9544+
* stderr, so the launcher's own refusal reason never reaches the log. */
9545+
if (ready && !cli_windows_stage_private_file(launcher_source_utf8, launcher_target,
9546+
launcher_fingerprint)) {
9547+
(void)fprintf(stderr, "error: private staging failed for the launcher (%s)\n",
9548+
launcher_target);
9549+
ready = false;
9550+
}
9551+
if (ready && !cli_windows_stage_private_file(payload_source_utf8, payload_target,
9552+
payload_fingerprint)) {
9553+
(void)fprintf(stderr, "error: private staging failed for the payload (%s)\n",
9554+
payload_target);
9555+
ready = false;
9556+
}
9557+
if (ready && strcmp(payload_fingerprint, expected_payload_sha256) != 0) {
9558+
(void)fprintf(stderr,
9559+
"error: staged payload build fingerprint did not match the expected payload\n");
9560+
ready = false;
9561+
}
9562+
if (ready) {
9563+
const char *version_argv[] = {launcher_target, "--version", NULL};
9564+
if (cbm_exec_no_shell(version_argv) != CLI_OK) {
9565+
(void)fprintf(stderr,
9566+
"error: the staged launcher did not run (--version probe failed)\n");
9567+
ready = false;
9568+
}
9569+
}
95489570
wchar_t *launcher_wide = ready ? cbm_utf8_to_wide(launcher_target) : NULL;
95499571
wchar_t *payload_wide = ready ? cbm_utf8_to_wide(payload_target) : NULL;
95509572
if (ready && launcher_wide && payload_wide) {

0 commit comments

Comments
 (0)