From c239e7c259a2af4987a4f754cee228f1f4bdcc97 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Tue, 4 Oct 2022 11:17:36 -0400 Subject: ci: add include-what-you-use to Fedora base image --- .gitlab/ci/docker/fedora36/Dockerfile | 9 ++++++ .gitlab/ci/docker/fedora36/install_iwyu.sh | 44 ++++++++++++++++++++++++++++++ .gitlab/os-linux.yml | 2 +- 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100755 .gitlab/ci/docker/fedora36/install_iwyu.sh diff --git a/.gitlab/ci/docker/fedora36/Dockerfile b/.gitlab/ci/docker/fedora36/Dockerfile index 299d48a..ea42561 100644 --- a/.gitlab/ci/docker/fedora36/Dockerfile +++ b/.gitlab/ci/docker/fedora36/Dockerfile @@ -10,6 +10,12 @@ MAINTAINER Kyle Edwards COPY install_clang_tidy_headers.sh /root/install_clang_tidy_headers.sh RUN sh /root/install_clang_tidy_headers.sh +FROM fedora:36 AS iwyu +MAINTAINER Kyle Edwards + +COPY install_iwyu.sh /root/install_iwyu.sh +RUN sh /root/install_iwyu.sh + FROM fedora:36 MAINTAINER Ben Boeckel @@ -22,3 +28,6 @@ RUN tar -C /usr/local -xf /root/rvm.tar \ COPY --from=clang-tidy-headers /root/clang-tidy-headers.tar /root/clang-tidy-headers.tar RUN tar -C /usr/include -xf /root/clang-tidy-headers.tar \ && rm /root/clang-tidy-headers.tar +COPY --from=iwyu /root/iwyu.tar /root/iwyu.tar +RUN tar -C / -xf /root/iwyu.tar \ + && rm /root/iwyu.tar diff --git a/.gitlab/ci/docker/fedora36/install_iwyu.sh b/.gitlab/ci/docker/fedora36/install_iwyu.sh new file mode 100755 index 0000000..714bcc0 --- /dev/null +++ b/.gitlab/ci/docker/fedora36/install_iwyu.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +set -e + +# Install development tools. +dnf install --setopt=install_weak_deps=False -y \ + clang-devel \ + llvm-devel \ + zlib-devel \ + g++ \ + cmake \ + ninja-build \ + git + +cd /root +git clone "https://github.com/include-what-you-use/include-what-you-use.git" +cd include-what-you-use +readonly llvm_full_version="$( clang --version | head -n1 | cut -d' ' -f3 )" +readonly llvm_version="$( echo "$llvm_full_version" | cut -d. -f-1 )" +git checkout "clang_$llvm_version" +git apply <