Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formula_installer: correctly handle build dep reqs. #4430

Merged
merged 1 commit into from
Jul 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions Library/Homebrew/formula_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,12 @@ def runtime_requirements(formula)

def expand_requirements
unsatisfied_reqs = Hash.new { |h, k| h[k] = [] }
deps = []
req_deps = []
formulae = [formula]
formula_deps_map = Dependency.expand(formula)
.each_with_object({}) do |dep, hash|
hash[dep.name] = dep
end

while f = formulae.pop
runtime_requirements = runtime_requirements(f)
Expand All @@ -453,16 +457,18 @@ def expand_requirements
next
elsif !runtime_requirements.include?(req) && install_bottle_for_dependent
Requirement.prune
elsif (dep = formula_deps_map[dependent.name]) && dep.build?
Requirement.prune
else
unsatisfied_reqs[dependent] << req
end
end
end

# Merge the repeated dependencies, which may have different tags.
deps = Dependency.merge_repeats(deps)
req_deps = Dependency.merge_repeats(req_deps)

[unsatisfied_reqs, deps]
[unsatisfied_reqs, req_deps]
end

def expand_dependencies(deps)
Expand Down