Skip to content

Commit

Permalink
Get gcc version from API to avoid downloading gcc bottles on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
xxyzz committed Mar 30, 2022
1 parent 193d6d3 commit 990b612
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Library/Homebrew/extend/os/linux/keg_relocate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 990b612

Please sign in to comment.