From dd25679d0affa56887388132bd6e9f420c751c89 Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Mon, 2 Sep 2024 22:42:08 -0400 Subject: [PATCH] linkage_checker: skip broken linkage in Julia --- Library/Homebrew/linkage_checker.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/linkage_checker.rb b/Library/Homebrew/linkage_checker.rb index ba81d62872ebe..1f3bb08cc36bc 100644 --- a/Library/Homebrew/linkage_checker.rb +++ b/Library/Homebrew/linkage_checker.rb @@ -92,6 +92,13 @@ def dylib_to_dep(dylib) Regexp.last_match(2) end + sig { params(file: String).returns(T::Boolean) } + def broken_dylibs_allowed?(file) + return false if formula.name != "julia" + + file.start_with?("#{formula.prefix.realpath}/share/julia/compiled/") + end + def check_dylibs(rebuild_cache:) keg_files_dylibs = nil @@ -128,7 +135,7 @@ def check_dylibs(rebuild_cache:) if !file_has_any_rpath_dylibs && (dylib.start_with? "@rpath/") file_has_any_rpath_dylibs = true pathname = Pathname(file) - @files_missing_rpaths << file if pathname.rpaths.empty? + @files_missing_rpaths << file if pathname.rpaths.empty? && !broken_dylibs_allowed?(file.to_s) end next if checked_dylibs.include? dylib @@ -156,7 +163,7 @@ def check_dylibs(rebuild_cache:) # If we cannot associate the dylib with a dependency, then it may be a system library. # If dlopen finds the dylib, then the linkage is not broken. @system_dylibs << dylib - elsif !system_framework?(dylib) + elsif !system_framework?(dylib) && !broken_dylibs_allowed?(file.to_s) @broken_dylibs << dylib end else