use skip_deps_check?
instead of ignore_deps?
hack
We previously set `ignore_deps?` as true for DependencyInstaller to avoid duplicated dependencies resolution. (See a9fc82aea30506eeacbddeb8b53fb85de8acb9d4) However, this will cause problem when pouring bottle of a dependency is failed. In this case, it will try to build dependency from source but failed due to uninstalled build deps for this formula. Another disadvantage for using `ignore_deps?` hack is we cannot distinguish users passing `--ignore-dependencies` flag from we are in `DependencyInstaller`. So, let's differentiate these using `skip_deps_check?`
This commit is contained in:
parent
5045fc95bf
commit
7b97dca554
@ -56,6 +56,10 @@ class FormulaInstaller
|
|||||||
@pour_failed = false
|
@pour_failed = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def skip_deps_check?
|
||||||
|
ignore_deps?
|
||||||
|
end
|
||||||
|
|
||||||
# When no build tools are available and build flags are passed through ARGV,
|
# When no build tools are available and build flags are passed through ARGV,
|
||||||
# it's necessary to interrupt the user before any sort of installation
|
# it's necessary to interrupt the user before any sort of installation
|
||||||
# can proceed. Only invoked when the user has no developer tools.
|
# can proceed. Only invoked when the user has no developer tools.
|
||||||
@ -97,7 +101,7 @@ class FormulaInstaller
|
|||||||
end
|
end
|
||||||
|
|
||||||
def prelude
|
def prelude
|
||||||
verify_deps_exist unless ignore_deps?
|
verify_deps_exist unless skip_deps_check?
|
||||||
lock
|
lock
|
||||||
check_install_sanity
|
check_install_sanity
|
||||||
end
|
end
|
||||||
@ -120,7 +124,7 @@ class FormulaInstaller
|
|||||||
def check_install_sanity
|
def check_install_sanity
|
||||||
raise FormulaInstallationAlreadyAttemptedError, formula if @@attempted.include?(formula)
|
raise FormulaInstallationAlreadyAttemptedError, formula if @@attempted.include?(formula)
|
||||||
|
|
||||||
unless ignore_deps?
|
unless skip_deps_check?
|
||||||
unlinked_deps = formula.recursive_dependencies.map(&:to_formula).select do |dep|
|
unlinked_deps = formula.recursive_dependencies.map(&:to_formula).select do |dep|
|
||||||
dep.installed? && !dep.keg_only? && !dep.linked_keg.directory?
|
dep.installed? && !dep.keg_only? && !dep.linked_keg.directory?
|
||||||
end
|
end
|
||||||
@ -159,7 +163,7 @@ class FormulaInstaller
|
|||||||
raise BuildToolsError.new([formula])
|
raise BuildToolsError.new([formula])
|
||||||
end
|
end
|
||||||
|
|
||||||
unless ignore_deps?
|
unless skip_deps_check?
|
||||||
deps = compute_dependencies
|
deps = compute_dependencies
|
||||||
check_dependencies_bottled(deps) if pour_bottle? && !MacOS.has_apple_developer_tools?
|
check_dependencies_bottled(deps) if pour_bottle? && !MacOS.has_apple_developer_tools?
|
||||||
install_dependencies(deps)
|
install_dependencies(deps)
|
||||||
@ -364,15 +368,8 @@ class FormulaInstaller
|
|||||||
end
|
end
|
||||||
|
|
||||||
class DependencyInstaller < FormulaInstaller
|
class DependencyInstaller < FormulaInstaller
|
||||||
def initialize(*)
|
def skip_deps_check?
|
||||||
super
|
true
|
||||||
@ignore_deps = true
|
|
||||||
end
|
|
||||||
|
|
||||||
def sanitized_ARGV_options
|
|
||||||
args = super
|
|
||||||
args.delete "--ignore-dependencies"
|
|
||||||
args
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user