diff --git a/Library/Homebrew/extend/os/mac/keg_relocate.rb b/Library/Homebrew/extend/os/mac/keg_relocate.rb index 31494e2dd2..69cd8a2d9e 100644 --- a/Library/Homebrew/extend/os/mac/keg_relocate.rb +++ b/Library/Homebrew/extend/os/mac/keg_relocate.rb @@ -141,6 +141,9 @@ module OS end def dylib_id_for(file) + # Swift dylib IDs should be /usr/lib/swift + return file.dylib_id if file.dylib_id.start_with?("/usr/lib/swift/libswift") + # 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)