Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpath deletion fails with duplicate rpaths #356

Closed
carlocab opened this issue May 14, 2021 · 0 comments · Fixed by #357
Closed

rpath deletion fails with duplicate rpaths #356

carlocab opened this issue May 14, 2021 · 0 comments · Fixed by #357
Labels

Comments

@carlocab
Copy link
Member

pdnsrec in Homebrew/core ships a binary with duplicate rpaths:

❯ otool -l pdns_recursor | rg -A2 LC_RPATH
          cmd LC_RPATH
      cmdsize 40
         path /usr/local/opt/boost/lib (offset 12)
--
          cmd LC_RPATH
      cmdsize 40
         path /usr/local/opt/boost/lib (offset 12)
--
          cmd LC_RPATH
      cmdsize 40
         path /usr/local/opt/boost/lib (offset 12)

Trying to delete this rpath fails with the following error:

[5] brew(main)> MachO::Tools.delete_rpath("pdns_recursor", "/usr/local/opt/boost/lib")
MachO::LoadCommandError: Unrecognized Mach-O load command: 0x00
from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-macho-2.5.0/lib/macho/macho_file.rb:530:in `block in populate_load_commands'

This is causing a bottling failure in Homebrew/core at Homebrew/homebrew-core#77263.

carlocab added a commit to carlocab/ruby-macho that referenced this issue May 14, 2021
Deferring field population to the end seems to break rpath deletion of
duplicated rpaths.

Closes Homebrew#356.
carlocab added a commit to carlocab/ruby-macho that referenced this issue May 14, 2021
Deferring field population to the end seems to break rpath deletion of
duplicated rpaths.

Closes Homebrew#356.
carlocab added a commit to carlocab/ruby-macho that referenced this issue May 15, 2021
Deferring field population to the end seems to break rpath deletion of
duplicated rpaths.

Closes Homebrew#356.
woodruffw pushed a commit that referenced this issue May 15, 2021
* Fix deletion of duplicate rpaths

Deferring field population to the end seems to break rpath deletion of
duplicated rpaths.

Closes #356.

* Add test for deleting duplicate rpaths
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant