extend/ENV/super: avoid adding llvm to HOMEBREW_LIBRARY_PATHS

This leads to undesired linkage with LLVM's `libunwind` (because it
shadows the system's `libunwind`).

See, for example, Homebrew/homebrew-core#169354.
This commit is contained in:
Carlo Cabrera 2024-04-18 23:15:47 +08:00
parent 929995c810
commit 4f31a3e8df
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0

View File

@ -229,7 +229,9 @@ module Superenv
end
end
paths << keg_only_deps.map(&:opt_lib)
# Don't add `llvm` to library paths; this leads to undesired linkage to LLVM's `libunwind`
paths << keg_only_deps.reject { |dep| dep.name.match?(/^llvm(@\d+)?$/) }
.map(&:opt_lib)
paths << (HOMEBREW_PREFIX/"lib")
paths += homebrew_extra_library_paths