Skip to content

Commit

Permalink
os/mac/mach: fix rpath deletion of fat machos
Browse files Browse the repository at this point in the history
Fixes #15859.
  • Loading branch information
carlocab committed Aug 14, 2023
1 parent 2cfea60 commit 93b43ad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Library/Homebrew/os/mac/mach.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ def mach_data
# 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)

Check warning on line 64 in Library/Homebrew/os/mac/mach.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/os/mac/mach.rb#L63-L64

Added lines #L63 - L64 were not covered by tests
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

Check warning on line 68 in Library/Homebrew/os/mac/mach.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/os/mac/mach.rb#L68

Added line #L68 was not covered by tests
options[:last] = true

macho.delete_rpath(rpath_to_delete, options)
Expand Down

0 comments on commit 93b43ad

Please sign in to comment.