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

keg_relocate: Don't relocate duplicated Rust dylibs. #2764

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Library/Homebrew/extend/os/mac/keg_relocate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,16 @@ def each_install_name_for(file, &block)
dylibs.each(&block)
end

# Rust ships two copies of its libraries, one in lib/ and the other in lib/rustlib/.
# We need to avoid rewriting the second copy until
# https://github.com/rust-lang/rust/issues/39870 is fixed.
def rust_duplicate?(fn)
fn =~ %r{/lib/rustlib/}
end

def dylib_id_for(file)
return file.dylib_id if rust_duplicate?(file.to_s)

# The new dylib ID should have the same basename as the old dylib ID, not
# the basename of the file itself.
basename = File.basename(file.dylib_id)
Expand Down