Skip to content

Commit ef6f089

Browse files
unusualinsightspestophagous
authored andcommitted
Get clang-format-10 directly from Ubuntu, not LLVM
tools/ci/provision.sh runs tools/ci/get_llvm_clang-format.sh, which was adding a llvm.org repository to sources.list: the list of places Ubuntu will look to find packages to install. This resulted in a conflict where Ubuntu's apt program refuses to install clang-format-10 when the command to do so in tools/ci/provision.sh is run. Simply not adding the llvm.org repository to sources.list seems to resolve the issue, allowing clang-format-10 to be installed successfully on Ubuntu 18.04, at least. According to https://apt.llvm.org/, the packages llvm.org provides via its sources are "extremely similar to the one shipping in Debian & Ubuntu." It seems one key reason we might install packages directly from llvm.org sources is to get access to later versions of llvm tools than Ubuntu provides in its own repositories. However, Ubuntu 18.04, at least, provides clang-format-10 directly via apt, so there may be no need to add llvm.org repositories to sources.list.
1 parent 0f961c6 commit ef6f089

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

tools/ci/get_llvm_clang-format.sh

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,6 @@ set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo
44

55
# When we end up here from the cookiecutterize job, we cannot rely on git
66
#CUR_GIT_ROOT=$(git rev-parse --show-toplevel)
7-
## BEGIN: clang-format from LLVM
8-
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
9-
# Fingerprint: 6084 F3CF 814B 57C1 CF12 EFD5 15CF 4D18 AF4F 7421
10-
11-
echo '' | sudo tee -a /etc/apt/sources.list
12-
13-
if [[ $(lsb_release -rs) == "20.04" ]]; then
14-
echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-10 main' | sudo tee -a /etc/apt/sources.list
15-
echo 'deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-10 main' | sudo tee -a /etc/apt/sources.list
16-
else
17-
echo 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main' | sudo tee -a /etc/apt/sources.list
18-
echo 'deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main' | sudo tee -a /etc/apt/sources.list
19-
fi
207

218
sudo apt-get update
229
sudo apt-get --assume-yes install clang-format-10
23-
24-
## END: clang-format from LLVM

0 commit comments

Comments
 (0)