From 419f9c668655593b2fe3f33a183c18b5aad150f4 Mon Sep 17 00:00:00 2001 From: Austin Schuh Date: Wed, 8 Jan 2025 11:59:03 -0800 Subject: [PATCH] Add support for extracting zst LLVM distributions zstd is a lot faster than xz at decompressing. Unfortunately, llvm/clang aren't distributed with zstd, so this still takes action to create a binary package, and then add it to _llvm_distributions. Signed-off-by: Austin Schuh --- toolchain/internal/llvm_distributions.bzl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/toolchain/internal/llvm_distributions.bzl b/toolchain/internal/llvm_distributions.bzl index 47b879ef..1ce15061 100644 --- a/toolchain/internal/llvm_distributions.bzl +++ b/toolchain/internal/llvm_distributions.bzl @@ -697,7 +697,12 @@ def _distribution_urls(rctx): sha256 = _llvm_distributions[basename] - strip_prefix = basename[:(len(basename) - len(".tar.xz"))] + if basename.endswith(".tar.xz"): + strip_prefix = basename[:(len(basename) - len(".tar.xz"))] + elif basename.endswith(".tar.zst"): + strip_prefix = basename[:(len(basename) - len(".tar.zst"))] + else: + fail("Unknown URL file extension {url}", url = basename) strip_prefix = strip_prefix.rstrip("-rhel86")