From 0ed32246ab8450452fc624f8455aded8bfca0e8d Mon Sep 17 00:00:00 2001 From: Sebastien Tardif Date: Sat, 13 Jun 2026 17:43:29 -0700 Subject: [PATCH] bootstrap: fix inverted success check in PowerShell download fallback When curl fails on Windows and bootstrap falls back to PowerShell for downloads, the success/failure check is inverted. The code returns early when PowerShell fails (`is_failure()`) and prints "spurious failure, trying again" when PowerShell succeeds, then exits with code 1 after three successful downloads. This was introduced in PR 141909 (bae39b8f10b, 2025-06-07) during the ExecutionContext refactoring. The original code used `if self.try_run(...) { return; }` which returned a bool where `true` meant success. The refactoring changed the return type to `CommandOutput` but used `is_failure()` for the early return, inverting the logic. The fix changes the check from `is_failure()` to `is_success()`, restoring the original behavior: return early when the download succeeds, retry when it fails. --- src/bootstrap/src/core/download.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/src/core/download.rs b/src/bootstrap/src/core/download.rs index 3b3044484f39d..2ed7d55b00da6 100644 --- a/src/bootstrap/src/core/download.rs +++ b/src/bootstrap/src/core/download.rs @@ -1093,7 +1093,7 @@ fn download_http_with_retries( ), ]).run_capture_stdout(exec_ctx); - if powershell.is_failure() { + if powershell.is_success() { return; }