build-unit-test-docker: use LLVM APT repos
The latest version of clang-18 from ubuntu's apt is 18.1.3,
but the latest stable release is 18.1.8. These two versions have
different output on some repositories when using clang-format. Switch
to using the apt.llvm.org packages so we get the latest stable versions.
The LLVM apt install tool needed a few additional packages to be
installed, so add those to the base apt-get.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I139cb040b95793ef8e7034d49296a2a5ea3bbac3
diff --git a/scripts/build-unit-test-docker b/scripts/build-unit-test-docker
index f871fdd..a07a9f5 100755
--- a/scripts/build-unit-test-docker
+++ b/scripts/build-unit-test-docker
@@ -763,10 +763,6 @@
autoconf \
autoconf-archive \
bison \
- clang-18 \
- clang-format-18 \
- clang-tidy-18 \
- clang-tools-18 \
cmake \
curl \
dbus \
@@ -775,6 +771,7 @@
g++-13 \
gcc-13 \
git \
+ gnupg \
iproute2 \
iputils-ping \
libaudit-dev \
@@ -804,6 +801,7 @@
liburing-dev \
libxml2-utils \
libxml-simple-perl \
+ lsb-release \
ninja-build \
npm \
pkg-config \
@@ -820,6 +818,7 @@
rsync \
shellcheck \
socat \
+ software-properties-common \
sudo \
systemd \
valgrind \
@@ -835,6 +834,15 @@
RUN update-alternatives --remove cpp /usr/bin/cpp && \
update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-13 13
+# Set up LLVM apt repository.
+RUN bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" 18
+
+# Install extra clang tools
+RUN apt-get install \
+ clang-18 \
+ clang-format-18 \
+ clang-tidy-18
+
RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 1000 \
--slave /usr/bin/clang++ clang++ /usr/bin/clang++-18 \
--slave /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-18 \