Merge pull request #18333 from Homebrew/ld-so-diagnostics-typeerror
This commit is contained in:
commit
04a2c994e5
@ -7,13 +7,18 @@ module OS
|
||||
module Ld
|
||||
sig { returns(String) }
|
||||
def self.brewed_ld_so_diagnostics
|
||||
@brewed_ld_so_diagnostics ||= T.let({}, T.nilable(T::Hash[Pathname, String]))
|
||||
|
||||
brewed_ld_so = HOMEBREW_PREFIX/"lib/ld.so"
|
||||
return "" unless brewed_ld_so.exist?
|
||||
|
||||
ld_so_output = Utils.popen_read(brewed_ld_so, "--list-diagnostics")
|
||||
return "" unless $CHILD_STATUS.success?
|
||||
brewed_ld_so_target = brewed_ld_so.readlink
|
||||
@brewed_ld_so_diagnostics[brewed_ld_so_target] ||= begin
|
||||
ld_so_output = Utils.popen_read(brewed_ld_so, "--list-diagnostics")
|
||||
ld_so_output if $CHILD_STATUS.success?
|
||||
end
|
||||
|
||||
ld_so_output
|
||||
@brewed_ld_so_diagnostics[brewed_ld_so_target].to_s
|
||||
end
|
||||
|
||||
sig { returns(String) }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user