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: fix pruning of test deps also marked as build #7633

Merged
merged 1 commit into from May 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions Library/Homebrew/formula_installer.rb
Expand Up @@ -456,7 +456,7 @@ def expand_requirements
keep_build_test = false
keep_build_test ||= runtime_requirements.include?(req)
keep_build_test ||= req.test? && include_test? && dependent == f
keep_build_test ||= req.build? && !install_bottle_for_dependent
keep_build_test ||= req.build? && !install_bottle_for_dependent && !dependent.latest_version_installed?

if req.prune_from_option?(build)
Requirement.prune
Expand Down Expand Up @@ -491,14 +491,12 @@ def expand_dependencies(deps)

keep_build_test = false
keep_build_test ||= dep.test? && include_test? && Homebrew.args.include_formula_test_deps?(dependent)
keep_build_test ||= dep.build? && !install_bottle_for?(dependent, build)
keep_build_test ||= dep.build? && !install_bottle_for?(dependent, build) && !dependent.latest_version_installed?

if dep.prune_from_option?(build)
Dependency.prune
elsif (dep.build? || dep.test?) && !keep_build_test
Dependency.prune
elsif dep.prune_if_build_and_not_dependent?(dependent)
Dependency.prune
elsif dep.satisfied?(inherited_options[dep.name])
Dependency.skip
else
Expand Down