From c55a5e30ddf13c3a2fbd08a3d8ce1dc8710ea59f Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 29 Apr 2024 17:30:27 +0100 Subject: [PATCH] startup/bootsnap: raise repeated `LoadError`. If `HOMEBREW_BOOTSNAP_RETRY` was set then we should raise the `LoadError` the second time so that the failures are user visible for debugging. --- Library/Homebrew/startup/bootsnap.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Library/Homebrew/startup/bootsnap.rb b/Library/Homebrew/startup/bootsnap.rb index f082307efd..da1bcc9dcb 100644 --- a/Library/Homebrew/startup/bootsnap.rb +++ b/Library/Homebrew/startup/bootsnap.rb @@ -13,13 +13,13 @@ end if homebrew_bootsnap_enabled begin require "bootsnap" - rescue LoadError - unless ENV["HOMEBREW_BOOTSNAP_RETRY"] - Homebrew.install_bundler_gems!(groups: ["bootsnap"], only_warn_on_failure: true) + rescue LoadError => e + raise e if ENV["HOMEBREW_BOOTSNAP_RETRY"] - ENV["HOMEBREW_BOOTSNAP_RETRY"] = "1" - exec ENV.fetch("HOMEBREW_BREW_FILE"), *ARGV - end + Homebrew.install_bundler_gems!(groups: ["bootsnap"], only_warn_on_failure: true) + + ENV["HOMEBREW_BOOTSNAP_RETRY"] = "1" + exec ENV.fetch("HOMEBREW_BREW_FILE"), *ARGV end ENV.delete("HOMEBREW_BOOTSNAP_RETRY")