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.
This commit is contained in:
Mike McQuaid 2024-04-29 17:30:27 +01:00
parent c076a46c19
commit c55a5e30dd
No known key found for this signature in database

View File

@ -13,13 +13,13 @@ end
if homebrew_bootsnap_enabled if homebrew_bootsnap_enabled
begin begin
require "bootsnap" require "bootsnap"
rescue LoadError rescue LoadError => e
unless ENV["HOMEBREW_BOOTSNAP_RETRY"] raise e if ENV["HOMEBREW_BOOTSNAP_RETRY"]
Homebrew.install_bundler_gems!(groups: ["bootsnap"], only_warn_on_failure: true)
ENV["HOMEBREW_BOOTSNAP_RETRY"] = "1" Homebrew.install_bundler_gems!(groups: ["bootsnap"], only_warn_on_failure: true)
exec ENV.fetch("HOMEBREW_BREW_FILE"), *ARGV
end ENV["HOMEBREW_BOOTSNAP_RETRY"] = "1"
exec ENV.fetch("HOMEBREW_BREW_FILE"), *ARGV
end end
ENV.delete("HOMEBREW_BOOTSNAP_RETRY") ENV.delete("HOMEBREW_BOOTSNAP_RETRY")