From bc040187207bcf83b490d3c3fe1715106649dba3 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 9 Jun 2017 11:02:05 -0400 Subject: [PATCH] keg_relocate: Don't relocate duplicated Rust dylibs. See https://github.com/rust-lang/rust/issues/39870. --- Library/Homebrew/extend/os/mac/keg_relocate.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Library/Homebrew/extend/os/mac/keg_relocate.rb b/Library/Homebrew/extend/os/mac/keg_relocate.rb index 707710be61661..2a4bb1547571a 100644 --- a/Library/Homebrew/extend/os/mac/keg_relocate.rb +++ b/Library/Homebrew/extend/os/mac/keg_relocate.rb @@ -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)