From 0373fd7d10fb5b23c86ebec2e932ea8f059f5b71 Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Fri, 25 Mar 2022 23:07:40 +0000 Subject: Clearly separate between LLVM, a bitcode compiler, and sanitizer compiler All three can be different but also provided by the same package. By separating the different use-cases, it allows to set them independently. --- scripts/build/p-clang-linux-ubuntu.inc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'scripts/build/p-clang-linux-ubuntu.inc') diff --git a/scripts/build/p-clang-linux-ubuntu.inc b/scripts/build/p-clang-linux-ubuntu.inc index 736cc097..9dac1352 100644 --- a/scripts/build/p-clang-linux-ubuntu.inc +++ b/scripts/build/p-clang-linux-ubuntu.inc @@ -16,18 +16,21 @@ install_binary_artifact_clang() { lsb-release gnupg ) - with_sudo apt -y --no-install-recommends install "${dependencies[@]}" - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key| with_sudo apt-key add - - # Add repository + # Add LLVM upstream repository if available codename="$(lsb_release --codename --short)" - apt_entry="deb http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}${version} main" - if [[ ! $(grep -rq "${apt_entry}" /etc/apt) ]]; then - echo "${apt_entry}" | with_sudo tee -a /etc/apt/sources.list - with_sudo apt update -y + if wget -q "https://apt.llvm.org/${codename}/dists/llvm-toolchain-${codename}${version}/"; then + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key| with_sudo apt-key add - + + apt_entry="deb http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}${version} main" + if ! grep -rq "${apt_entry}" /etc/apt; then + echo "${apt_entry}" | with_sudo tee -a /etc/apt/sources.list + with_sudo apt update -y + fi fi + with_sudo apt update -y dependencies=( "llvm${version}" -- cgit 1.4.1