diff --git a/Library/Homebrew/dependency.rb b/Library/Homebrew/dependency.rb index aa5375112afe8..2b3f9b2013885 100644 --- a/Library/Homebrew/dependency.rb +++ b/Library/Homebrew/dependency.rb @@ -112,6 +112,8 @@ def expand(dependent, deps = dependent.deps, cache_key: nil, ignore_missing: fal deps.each do |dep| next if dependent.name == dep.name + # avoid downloading build dependency bottles + next if dep.build? && dependent.pour_bottle? && Homebrew::EnvConfig.install_from_api? case action(dependent, dep, ignore_missing: ignore_missing, &block) when :prune diff --git a/Library/Homebrew/extend/os/linux/keg_relocate.rb b/Library/Homebrew/extend/os/linux/keg_relocate.rb index 4fafbbd6fafd5..d7a92f6acf689 100644 --- a/Library/Homebrew/extend/os/linux/keg_relocate.rb +++ b/Library/Homebrew/extend/os/linux/keg_relocate.rb @@ -84,9 +84,16 @@ def elf_files def self.bottle_dependencies @bottle_dependencies ||= begin formulae = relocation_formulae - gcc = Formulary.factory(CompilerSelector.preferred_gcc) + if Homebrew::EnvConfig.install_from_api? + gcc_hash = Homebrew::API::Formula.fetch(CompilerSelector.preferred_gcc) + preferred_gcc_version = Version.new gcc_hash["versions"]["stable"] + else + gcc = Formulary.factory(CompilerSelector.preferred_gcc) + preferred_gcc_version = gcc.version + end if !Homebrew::EnvConfig.simulate_macos_on_linux? && - DevelopmentTools.non_apple_gcc_version("gcc") < gcc.version.to_i + DevelopmentTools.non_apple_gcc_version("gcc") < preferred_gcc_version + gcc = Formulary.factory(CompilerSelector.preferred_gcc) if Homebrew::EnvConfig.install_from_api? formulae += gcc.recursive_dependencies.map(&:name) formulae << gcc.name end