Consider on-disk state when computing dependencies
Fixes Homebrew/homebrew#28754. Fixes Homebrew/homebrew#29846. Fixes Homebrew/homebrew#30920.
This commit is contained in:
parent
b0c1e5f7d6
commit
8aabba670f
@ -79,9 +79,16 @@ class Build
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def effective_build_options_for(dependent)
|
||||||
|
args = dependent.build.used_options
|
||||||
|
args |= Tab.for_formula(dependent).used_options
|
||||||
|
BuildOptions.new(args, dependent.options)
|
||||||
|
end
|
||||||
|
|
||||||
def expand_reqs
|
def expand_reqs
|
||||||
f.recursive_requirements do |dependent, req|
|
f.recursive_requirements do |dependent, req|
|
||||||
if (req.optional? || req.recommended?) && dependent.build.without?(req)
|
build = effective_build_options_for(dependent)
|
||||||
|
if (req.optional? || req.recommended?) && build.without?(req)
|
||||||
Requirement.prune
|
Requirement.prune
|
||||||
elsif req.build? && dependent != f
|
elsif req.build? && dependent != f
|
||||||
Requirement.prune
|
Requirement.prune
|
||||||
@ -94,7 +101,8 @@ class Build
|
|||||||
|
|
||||||
def expand_deps
|
def expand_deps
|
||||||
f.recursive_dependencies do |dependent, dep|
|
f.recursive_dependencies do |dependent, dep|
|
||||||
if (dep.optional? || dep.recommended?) && dependent.build.without?(dep)
|
build = effective_build_options_for(dependent)
|
||||||
|
if (dep.optional? || dep.recommended?) && build.without?(dep)
|
||||||
Dependency.prune
|
Dependency.prune
|
||||||
elsif dep.build? && dependent != f
|
elsif dep.build? && dependent != f
|
||||||
Dependency.prune
|
Dependency.prune
|
||||||
|
|||||||
@ -301,6 +301,7 @@ class FormulaInstaller
|
|||||||
def effective_build_options_for(dependent, inherited_options=[])
|
def effective_build_options_for(dependent, inherited_options=[])
|
||||||
args = dependent.build.used_options
|
args = dependent.build.used_options
|
||||||
args |= dependent == f ? options : inherited_options
|
args |= dependent == f ? options : inherited_options
|
||||||
|
args |= Tab.for_formula(dependent).used_options
|
||||||
BuildOptions.new(args, dependent.options)
|
BuildOptions.new(args, dependent.options)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user