diff --git a/Library/Homebrew/dependency_collector.rb b/Library/Homebrew/dependency_collector.rb index ae039e887a..aee6fb15ab 100644 --- a/Library/Homebrew/dependency_collector.rb +++ b/Library/Homebrew/dependency_collector.rb @@ -45,7 +45,7 @@ class DependencyCollector end def cache_key(spec) - if spec.is_a?(Resource) && spec.download_strategy == CurlDownloadStrategy + if spec.is_a?(Resource) && spec.download_strategy <= CurlDownloadStrategy File.extname(spec.url) else spec @@ -148,7 +148,7 @@ class DependencyCollector strategy = spec.download_strategy if strategy <= HomebrewCurlDownloadStrategy - brewed_curl_dep_if_needed(tags) + @deps << brewed_curl_dep_if_needed(tags) parse_url_spec(spec.url, tags) elsif strategy <= CurlDownloadStrategy parse_url_spec(spec.url, tags) diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index ffdeed7af5..451f779b37 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -215,6 +215,7 @@ class FormulaInstaller forbidden_license_check check_install_sanity + install_fetch_deps unless ignore_deps? end sig { void } @@ -343,6 +344,19 @@ class FormulaInstaller "#{formula.full_name} requires the latest version of pinned dependencies" end + sig { void } + def install_fetch_deps + return if @compute_dependencies.blank? + + compute_dependencies(use_cache: false) if @compute_dependencies.any? do |dep, options| + next false unless dep.tags == [:build, :test] + + fetch_dependencies + install_dependency(dep, options) + true + end + end + def build_bottle_preinstall @etc_var_dirs ||= [HOMEBREW_PREFIX/"etc", HOMEBREW_PREFIX/"var"] @etc_var_preinstall = Find.find(*@etc_var_dirs.select(&:directory?)).to_a