Skip to content

Commit af3742c

Browse files
committed
setup-build-env: fixup LLVM installation script for recent Debians
TL;DR Don't use llvm.sh on Debian. There are a couple of issues with using official llvm.sh installation script on recent debians. The first one is this: 61.12 W: OpenPGP signature verification failed: https://apt.llvm.org/unstable llvm-toolchain-21 InRelease: Sub-process /usr/bin/sqv returned an error code (1), error message is: Signing key on 6084F3CF814B57C1CF12EFD515CF4D18AF4F7421 is not bound: No binding signature at time 2025-12-21T23:13:57Z because: Policy rejected non-revocation signature (PositiveCertification) requiring second pre-image resistance because: SHA1 is not considered secure since 2026-02-01T00:00:00Z Which requires updates on LLVM distribution side. The second is that debian removed software-properties-common package due to a bug [1]. All this is unimportant on Debian though, because LLVM 21 is available in default debian PPAs. So simply install llvm packages directly, if we are on Debian. [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1038747
1 parent 6980cb9 commit af3742c

File tree

1 file changed

+38
-6
lines changed

1 file changed

+38
-6
lines changed

setup-build-env/install_clang.sh

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,44 @@ source "${THISDIR}"/../helpers.sh
66

77
foldable start install_clang "Install LLVM ${LLVM_VERSION}"
88

9-
sudo apt-get update -y
10-
sudo -E apt-get install --no-install-recommends -y \
11-
gnupg lsb-release software-properties-common wget
9+
source /etc/os-release
1210

13-
curl -O https://apt.llvm.org/llvm.sh
14-
chmod +x llvm.sh
15-
sudo ./llvm.sh ${LLVM_VERSION} all
11+
if [[ "${ID}" == "ubuntu" ]]; then
12+
# Use official installation script for Ubuntu
13+
sudo apt-get update -y
14+
sudo -E apt-get install --no-install-recommends -y \
15+
curl gnupg lsb-release software-properties-common wget
16+
curl -O https://apt.llvm.org/llvm.sh
17+
chmod +x llvm.sh
18+
sudo ./llvm.sh ${LLVM_VERSION} all
19+
elif [[ "${ID}" == "debian" ]]; then
20+
# For Debian, install packages directly from repos
21+
# Recent debian considers SHA1 insecure, and llvm.sh hasn't been fixed yet
22+
# Install packages direcctly from repos, assuming LLVM_VERSION is available
23+
sudo apt-get update -y
24+
sudo -E apt-get install --no-install-recommends -y \
25+
clang-${LLVM_VERSION} \
26+
lldb-${LLVM_VERSION} \
27+
lld-${LLVM_VERSION} \
28+
clangd-${LLVM_VERSION} \
29+
clang-tidy-${LLVM_VERSION} \
30+
clang-format-${LLVM_VERSION} \
31+
clang-tools-${LLVM_VERSION} \
32+
llvm-${LLVM_VERSION}-dev \
33+
llvm-${LLVM_VERSION}-tools \
34+
libomp-${LLVM_VERSION}-dev \
35+
libc++-${LLVM_VERSION}-dev \
36+
libc++abi-${LLVM_VERSION}-dev \
37+
libclang-common-${LLVM_VERSION}-dev \
38+
libclang-${LLVM_VERSION}-dev \
39+
libclang-cpp${LLVM_VERSION}-dev \
40+
liblldb-${LLVM_VERSION}-dev \
41+
libunwind-${LLVM_VERSION}-dev \
42+
libclang-rt-${LLVM_VERSION}-dev \
43+
libpolly-${LLVM_VERSION}-dev
44+
else
45+
echo "$(basename "$0") unexpected distro: ${ID}" >&2
46+
exit 1
47+
fi
1648

1749
foldable end install_clang

0 commit comments

Comments
 (0)