development_tools: allow Symbol
s to be locate
d
Fixes error seen in Homebrew/homebrew-core#138452. `DevelopmentTools.default_compiler` can return a `Symbol` like `:clang`. Make sure its result can be fed to `DevelopmentTools.locate`. Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
This commit is contained in:
parent
a2b49440e7
commit
99607e8ec4
@ -6,7 +6,7 @@ require "version"
|
||||
# @private
|
||||
class DevelopmentTools
|
||||
class << self
|
||||
sig { params(tool: String).returns(T.nilable(Pathname)) }
|
||||
sig { params(tool: T.any(String, Symbol)).returns(T.nilable(Pathname)) }
|
||||
def locate(tool)
|
||||
# Don't call tools (cc, make, strip, etc.) directly!
|
||||
# Give the name of the binary you look for as a string to this method
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
class DevelopmentTools
|
||||
class << self
|
||||
sig { params(tool: String).returns(T.nilable(Pathname)) }
|
||||
sig { params(tool: T.any(String, Symbol)).returns(T.nilable(Pathname)) }
|
||||
def locate(tool)
|
||||
(@locate ||= {}).fetch(tool) do |key|
|
||||
@locate[key] = if needs_build_formulae? &&
|
||||
|
@ -10,7 +10,7 @@ class DevelopmentTools
|
||||
undef installed?, default_compiler, curl_handles_most_https_certificates?,
|
||||
subversion_handles_most_https_certificates?
|
||||
|
||||
sig { params(tool: String).returns(T.nilable(Pathname)) }
|
||||
sig { params(tool: T.any(String, Symbol)).returns(T.nilable(Pathname)) }
|
||||
def locate(tool)
|
||||
(@locate ||= {}).fetch(tool) do |key|
|
||||
@locate[key] = if (located_tool = generic_locate(tool))
|
||||
|
Loading…
x
Reference in New Issue
Block a user