Skip to content

Commit cd138e1

Browse files
authored
Add LLVM 19 (#392)
The filenames changed significantly, so I had to add new logic. On the other hand, the file names are much easier to construct now, especially on Linux where there are no longer distro-specific variants as non-hermetic dynamic library dependencies like [`libtinfo5` have been removed](llvm/llvm-project#93889).
1 parent 1cd9e36 commit cd138e1

File tree

2 files changed

+32
-6
lines changed

2 files changed

+32
-6
lines changed

toolchain/internal/llvm_distributions.bzl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,12 @@ _llvm_distributions = {
514514
"clang+llvm-18.1.8-powerpc64le-linux-rhel-8.8.tar.xz": "b3df0c1607bfb04fe268c2e80542aba6e63ef0766a0bc4100ccf6a1ea99a0a1b",
515515
"clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04.tar.xz": "54ec30358afcc9fb8aa74307db3046f5187f9fb89fb37064cdde906e062ebf36",
516516
"clang+llvm-18.1.8-x86_64-pc-windows-msvc.tar.xz": "22c5907db053026cc2a8ff96d21c0f642a90d24d66c23c6d28ee7b1d572b82e8",
517+
518+
# 19.1.0
519+
"LLVM-19.1.0-Linux-X64.tar.xz": "cee77d641690466a193d9b88c89705de1c02bbad46bde6a3b126793c0a0f2923",
520+
"LLVM-19.1.0-macOS-ARM64.tar.xz": "9da86f64a99f5ce9b679caf54e938736ca269c5e069d0c94ad08b995c5f25c16",
521+
"LLVM-19.1.0-macOS-X64.tar.xz": "264f2f1e8b67f066749349ae8b4943d346cd44e099464164ef21b42a57663540",
522+
"LLVM-19.1.0-Windows-X64.tar.xz": "a132377865d72bc7452343d59d05da63266ffc928b4072d63fb854fd42097dc4",
517523
}
518524

519525
# Note: Unlike the user-specified llvm_mirror attribute, the URL prefixes in
@@ -572,6 +578,7 @@ _llvm_distributions_base_url = {
572578
"18.1.6": "https://github.com/llvm/llvm-project/releases/download/llvmorg-",
573579
"18.1.7": "https://github.com/llvm/llvm-project/releases/download/llvmorg-",
574580
"18.1.8": "https://github.com/llvm/llvm-project/releases/download/llvmorg-",
581+
"19.1.0": "https://github.com/llvm/llvm-project/releases/download/llvmorg-",
575582
}
576583

577584
def _get_auth(ctx, urls):

toolchain/internal/release_name.bzl

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
load(
22
"//toolchain/internal:common.bzl",
3+
_arch = "arch",
4+
_os = "os",
35
_os_version_arch = "os_version_arch",
46
)
57

@@ -205,10 +207,27 @@ def _resolve_version_for_suse(major_llvm_version, llvm_version):
205207
return os_name
206208

207209
def llvm_release_name(rctx, llvm_version):
208-
(os, version, arch) = _os_version_arch(rctx)
209-
if os == "darwin":
210-
return _darwin(llvm_version, arch)
211-
elif os == "windows":
212-
return _windows(llvm_version, arch)
210+
major_llvm_version = _major_llvm_version(llvm_version)
211+
if major_llvm_version >= 19:
212+
arch = {
213+
"aarch64": "ARM64",
214+
"x86_64": "X64",
215+
}[_arch(rctx)]
216+
os = {
217+
"darwin": "macOS",
218+
"linux": "Linux",
219+
"windows": "Windows",
220+
}[_os(rctx)]
221+
return "LLVM-{llvm_version}-{os}-{arch}.tar.xz".format(
222+
llvm_version = llvm_version,
223+
arch = arch,
224+
os = os,
225+
)
213226
else:
214-
return _linux(llvm_version, os, version, arch)
227+
(os, version, arch) = _os_version_arch(rctx)
228+
if os == "darwin":
229+
return _darwin(llvm_version, arch)
230+
elif os == "windows":
231+
return _windows(llvm_version, arch)
232+
else:
233+
return _linux(llvm_version, os, version, arch)

0 commit comments

Comments
 (0)