From 0c09ed71d4797db42266380b9859b148aa8a3e2b Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 25 Jul 2025 17:25:41 +0100 Subject: [PATCH] formula_installer: fix fetch deps and local pour for download queue. --- Library/Homebrew/formula_installer.rb | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index cf37d3eab4..f2b51c4125 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -320,6 +320,8 @@ class FormulaInstaller # Needs to be done before expand_dependencies for compute_dependencies fetch_bottle_tab if pour_bottle? + fetch_fetch_deps unless ignore_deps? + @ran_prelude_fetch = true end @@ -346,7 +348,9 @@ class FormulaInstaller forbidden_formula_check check_install_sanity - install_fetch_deps unless ignore_deps? + + # with the download queue: these should have already been installed + install_fetch_deps if !ignore_deps? && download_queue.nil? end sig { void } @@ -475,6 +479,18 @@ class FormulaInstaller sig { params(_formula: Formula).returns(T.nilable(T::Boolean)) } def fresh_install?(_formula) = false + sig { void } + def fetch_fetch_deps + return if @compute_dependencies.blank? + + compute_dependencies(use_cache: false) if @compute_dependencies.any? do |dep,| + next false unless dep.implicit? + + fetch_dependencies + true + end + end + sig { void } def install_fetch_deps return if @compute_dependencies.blank? @@ -1455,8 +1471,6 @@ on_request: installed_on_request?, options:) # We also skip bottle installs from local bottle paths, as these are done in CI # as part of the build lifecycle before attestations are produced. if check_attestation && - # TODO: support this for download queues at some point - download_queue.nil? && Homebrew::Attestation.enabled? && formula.tap&.core_tap? && formula.name != "gh" @@ -1545,7 +1559,7 @@ on_request: installed_on_request?, options:) # download queue has already done the actual staging but we'll lie about # pouring now for nicer output ohai "Pouring #{downloadable.downloader.basename}" - downloadable.downloader.stage unless download_queue + downloadable.downloader.stage if download_queue.nil? || !formula.prefix.exist? end Tab.clear_cache