extend/os/linux/development_tools: consider keg-only glibc & binutils
This commit is contained in:
parent
ae3c6a6574
commit
a372ca6100
@ -8,10 +8,15 @@ class DevelopmentTools
|
|||||||
sig { params(tool: String).returns(T.nilable(Pathname)) }
|
sig { params(tool: String).returns(T.nilable(Pathname)) }
|
||||||
def locate(tool)
|
def locate(tool)
|
||||||
(@locate ||= {}).fetch(tool) do |key|
|
(@locate ||= {}).fetch(tool) do |key|
|
||||||
@locate[key] = if (path = HOMEBREW_PREFIX/"bin/#{tool}").executable?
|
@locate[key] = if build_system_too_old? &&
|
||||||
path
|
(binutils_path = HOMEBREW_PREFIX/"opt/binutils/bin/#{tool}").executable?
|
||||||
elsif File.executable?(path = "/usr/bin/#{tool}")
|
binutils_path
|
||||||
Pathname.new path
|
elsif build_system_too_old? && (glibc_path = HOMEBREW_PREFIX/"opt/glibc/bin/#{tool}").executable?
|
||||||
|
glibc_path
|
||||||
|
elsif (homebrew_path = HOMEBREW_PREFIX/"bin/#{tool}").executable?
|
||||||
|
homebrew_path
|
||||||
|
elsif File.executable?(system_path = "/usr/bin/#{tool}")
|
||||||
|
Pathname.new system_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -30,7 +35,7 @@ class DevelopmentTools
|
|||||||
|
|
||||||
sig { returns(T::Boolean) }
|
sig { returns(T::Boolean) }
|
||||||
def system_gcc_too_old?
|
def system_gcc_too_old?
|
||||||
gcc_version("gcc") < OS::LINUX_GCC_CI_VERSION
|
gcc_version("/usr/bin/gcc") < OS::LINUX_GCC_CI_VERSION
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { returns(T::Hash[String, T.nilable(String)]) }
|
sig { returns(T::Hash[String, T.nilable(String)]) }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user