From 65731faf1d5ca5d5745423b7e8437adb0b3c2d8f Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Sun, 29 Sep 2024 13:40:10 +0800 Subject: [PATCH] os/linux/ld: handle nonexistent `ld.so.conf` more gracefully Fixes #18458 --- Library/Homebrew/os/linux/ld.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Library/Homebrew/os/linux/ld.rb b/Library/Homebrew/os/linux/ld.rb index 9227792b29920..b4a033b96244f 100644 --- a/Library/Homebrew/os/linux/ld.rb +++ b/Library/Homebrew/os/linux/ld.rb @@ -48,6 +48,8 @@ def self.system_dirs sig { params(conf_path: T.any(Pathname, String)).returns(T::Array[String]) } def self.library_paths(conf_path = Pathname(sysconfdir)/"ld.so.conf") conf_file = Pathname(conf_path) + return [] unless conf_file.exist? + paths = Set.new directory = conf_file.realpath.dirname