Skip to content

Commit

Permalink
Merge pull request #13065 from xxyzz/skip_build_deps
Browse files Browse the repository at this point in the history
Skip build deps to avoid downloading bottles
  • Loading branch information
Bo98 authored Apr 22, 2022
2 parents c1a9ce6 + 990b612 commit b2a896e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Library/Homebrew/dependency.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
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 b2a896e

Please sign in to comment.