From 93b43ad7a902eb4f43503d55a81b09bc23f233d3 Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Mon, 14 Aug 2023 14:29:05 +0800 Subject: [PATCH] os/mac/mach: fix rpath deletion of fat machos Fixes #15859. --- Library/Homebrew/os/mac/mach.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/os/mac/mach.rb b/Library/Homebrew/os/mac/mach.rb index 58f73ae058..fea21898e8 100644 --- a/Library/Homebrew/os/mac/mach.rb +++ b/Library/Homebrew/os/mac/mach.rb @@ -60,12 +60,12 @@ module MachOShim # TODO: See if the `#write!` call can be delayed until # we know we're not making any changes to the rpaths. def delete_rpath(rpath, **options) - candidates = macho.command(:LC_RPATH).select do |r| - resolve_variable_name(r.path.to_s) == resolve_variable_name(rpath) + candidates = rpaths(resolve_variable_references: false).select do |r| + resolve_variable_name(r) == resolve_variable_name(rpath) end # Delete the last instance to avoid changing the order in which rpaths are searched. - rpath_to_delete = candidates.last.path.to_s + rpath_to_delete = candidates.last options[:last] = true macho.delete_rpath(rpath_to_delete, options)