From fa6d61809e5118ecff0ba72289a1757a7f5fe03d Mon Sep 17 00:00:00 2001 From: Cornelius Riemenschneider Date: Wed, 31 Jul 2024 00:38:50 +0200 Subject: [PATCH] Fix hang for targets without ripunzip. --- misc/bazel/internal/install.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/misc/bazel/internal/install.py b/misc/bazel/internal/install.py index 6f334235599..25be722cd6d 100644 --- a/misc/bazel/internal/install.py +++ b/misc/bazel/internal/install.py @@ -90,9 +90,11 @@ class RetryException(Exception): attempts = 0 success = False -while attempts < 3 and success is False: +while attempts < 3 and not success: + attempts += 1 destdir.mkdir(parents=True, exist_ok=True) subprocess.run([script, "--destdir", destdir], check=True) + success = True if opts.zip_manifest: ripunzip = runfiles.Rlocation(opts.ripunzip) @@ -110,7 +112,6 @@ while attempts < 3 and success is False: success = ret.returncode == 0 if not success: print(f"Failed to unzip {zip} to {dest}, retrying installation...") - attempts += 1 rmdir(destdir) break