Skip to content

Commit 2ac7baa

Browse files
authored
Merge pull request Homebrew#206385 from Homebrew/rust-llvm-symlink
rust: restore `libLLVM` symlink
2 parents 42cd7ca + 5785169 commit 2ac7baa

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

Formula/r/rust.rb

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ class Rust < Formula
1515
end
1616

1717
bottle do
18-
sha256 cellar: :any, arm64_sequoia: "3be74ccb1e700e136eb713215476c460b919d2957fdd7db954336d1fba52bcf4"
19-
sha256 cellar: :any, arm64_sonoma: "5499513d6c7a9720c7cd07db366ba111718f59055f0b73878126fa445aadcbed"
20-
sha256 cellar: :any, arm64_ventura: "69206c249d7e239770b937f8b268b797d313536c216ff273b2f21580043c07c8"
21-
sha256 cellar: :any, sonoma: "1c7f7b839fe9c8f4b20c50cc859701de89f321a01f719754b7e4d104a9e7bac9"
22-
sha256 cellar: :any, ventura: "ad2e170996114397fae7b825bba23396562814b18ed649078efa45ef3cf45891"
23-
sha256 cellar: :any_skip_relocation, x86_64_linux: "663d92b354d414ac97848a59741b257df5e0306774ecc074958f7457700876b1"
18+
rebuild 1
19+
sha256 cellar: :any, arm64_sequoia: "6fe0e14f08adae82662551b478fdfaeb87f516be7762c60d28203e830c5caa91"
20+
sha256 cellar: :any, arm64_sonoma: "ded9d66d7a87295fe9570cec1ce54814068aa3fc000d26a5d9e509e6cdf6be62"
21+
sha256 cellar: :any, arm64_ventura: "3a96ac743681822906e48f4bb8f481c78cc7823ebff3db20c41cdc35cb8fab91"
22+
sha256 cellar: :any, sonoma: "7af190ff67405820a8e48e3a00613414d5918944305c6b760584322a21b8d740"
23+
sha256 cellar: :any, ventura: "ca6593daae0d01d89d6f57762311bac3313aa8182ade7d79549b0d8d84c97809"
24+
sha256 cellar: :any_skip_relocation, x86_64_linux: "14875a6dce2f6ae3d1e2e8d0d1a27bb3e24990e3feef0776c4eb33e6497a0a9a"
2425
end
2526

2627
head do
@@ -122,6 +123,10 @@ class Rust < Formula
122123
end
123124
end
124125

126+
def llvm
127+
Formula["llvm"]
128+
end
129+
125130
def install
126131
# Ensure that the `openssl` crate picks up the intended library.
127132
# https://docs.rs/openssl/latest/openssl/#manual
@@ -169,7 +174,7 @@ def install
169174
--prefix=#{prefix}
170175
--sysconfdir=#{etc}
171176
--tools=#{tools.join(",")}
172-
--llvm-root=#{Formula["llvm"].opt_prefix}
177+
--llvm-root=#{llvm.opt_prefix}
173178
--enable-llvm-link-shared
174179
--enable-profiler
175180
--enable-vendor
@@ -207,6 +212,14 @@ def post_install
207212
MachO.codesign!(dylib) if Hardware::CPU.arm?
208213
chmod 0444, dylib
209214
end
215+
return unless OS.mac?
216+
217+
# Symlink our LLVM here to make sure the adjacent bin/rust-lld can find it.
218+
# Needs to be done in `postinstall` to avoid having `change_dylib_id` done on it.
219+
lib.glob("rustlib/*/lib") do |dir|
220+
# Use `ln_sf` instead of `install_symlink` to avoid resolving this into a Cellar path.
221+
ln_sf llvm.opt_lib/shared_library("libLLVM"), dir
222+
end
210223
end
211224

212225
test do

0 commit comments

Comments
 (0)