From a09d3049d0ea615a8f575019a28b33fcfa5f9ba6 Mon Sep 17 00:00:00 2001 From: Yaraslau Tamashevich Date: Fri, 2 Aug 2024 13:37:50 +0300 Subject: [PATCH] update docker script to llvm build --- .github/DockerClang | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/.github/DockerClang b/.github/DockerClang index eb66f7d..9bf1f43 100644 --- a/.github/DockerClang +++ b/.github/DockerClang @@ -1,31 +1,34 @@ # docker buildx build --tag clang-p2996 --progress=plain -f .github/DockerClang --load . # docker tag clang-p2996 yaraslaut/clang-p2996 # docker push yaraslaut/clang-p2996 -FROM ubuntu:latest +FROM ubuntu:latest AS builder -#git clone -b p2996 https://github.com/bloomberg/clang-p2996.git && \ +#git clone -b p2996 https://github.com/Yaraslaut/clang-p2996.git && \ WORKDIR / RUN apt-get update -RUN bash -c "\ - set -ex && \ - apt-get install -y cmake python3 ninja-build git lsb-release software-properties-common wget binutils gcc g++ && \ - wget https://apt.llvm.org/llvm.sh && \ - chmod +x llvm.sh && \ - ./llvm.sh 18 && \ - git clone -b p2996 https://github.com/Yaraslaut/clang-p2996.git && \ - cmake -S /clang-p2996/llvm \ +RUN apt-get install -y cmake python3 ninja-build git lsb-release software-properties-common wget binutils gcc g++ +RUN wget https://apt.llvm.org/llvm.sh +RUN chmod +x llvm.sh +RUN ./llvm.sh 19 +RUN git clone -b p2996 https://github.com/bloomberg/clang-p2996.git +RUN cmake -S /clang-p2996/llvm \ -B build \ -G Ninja \ - -D CMAKE_CXX_COMPILER=clang++-18 \ - -D CMAKE_C_COMPILER=clang-18 \ + -D CMAKE_CXX_COMPILER=clang++-19 \ + -D CMAKE_C_COMPILER=clang-19 \ -D CMAKE_BUILD_TYPE=Release \ - -D CMAKE_INSTALL_PREFIX=\/usr \ -D LLVM_ENABLE_RUNTIMES='libcxx;libcxxabi;libunwind'\ -D LLVM_ENABLE_PROJECTS=clang\ - -D LLVM_TARGETS_TO_BUILD=X86 && \ - cmake --build build --parallel && \ - cmake --build build --target install && \ - echo "/usr/lib/x86_64-unknown-linux-gnu" >> /etc/ld.so.conf.d/x86_64-linux-gnu.conf && \ - ldconfig && \ - rm -rf /build && \ - rm -rf /clang-p2996" + -D LLVM_TARGETS_TO_BUILD=X86 +RUN cmake --build build --parallel +RUN cmake --install build --prefix /tmp/clang-install + +FROM ubuntu:latest +# Install packages for minimal useful image. +RUN apt-get update && \ + apt-get install -y --no-install-recommends build-essential ca-certificates libcurl4-openssl-dev cmake make wget python3 sudo curl ninja-build git binutils && \ + rm -rf /var/lib/apt/lists/* +# Copy build results of stage 1 to /usr/local. +COPY --from=builder /tmp/clang-install/ /usr/local/ +RUN P=`/usr/local/bin/clang++ -v 2>&1 | grep Target | cut -d' ' -f2-`; echo /usr/local/lib/$P > /etc/ld.so.conf.d/$P.conf +RUN ldconfig