Skip to content

Commit

Permalink
Merge pull request #15761 from carlocab/macho-todo
Browse files Browse the repository at this point in the history
Implement ruby-macho TODOs
  • Loading branch information
carlocab authored Jul 26, 2023
2 parents 3dfa8bc + 6b728bf commit 302e68e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions Library/Homebrew/extend/os/mac/keg_relocate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ def fix_dynamic_linkage
new_name = opt_name_for(bad_name)
loader_name = loader_name_for(file, new_name)
next if loader_name == bad_name
# TODO: Remove the line below on the next release of ruby-macho. See Homebrew/ruby-macho@e9eaa75.
next if file.rpaths(resolve_variable_references: false).include?(loader_name)

change_rpath(bad_name, loader_name, file)
end
Expand Down
10 changes: 5 additions & 5 deletions Library/Homebrew/os/mac/mach.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ def delete_rpath(rpath, **options)
resolve_variable_name(r.path.to_s) == resolve_variable_name(rpath)
end

# TODO: Add `last: true` to `options` and replace `delete_command` with `delete_rpath`
# when the PR linked below is merged and release for ruby-macho.
# https://github.com/Homebrew/ruby-macho/pull/555
command_to_delete = candidates.last # .path.to_s (when switching to `MachOFile#delete_rpath`)
macho.delete_command(command_to_delete, options)
# Delete the last instance to avoid changing the order in which rpaths are searched.
rpath_to_delete = candidates.last.path.to_s
options[:last] = true

macho.delete_rpath(rpath_to_delete, options)
macho.write!
end

Expand Down

0 comments on commit 302e68e

Please sign in to comment.