From 49dfd5c436c73361870918e616abf126f1ca1b79 Mon Sep 17 00:00:00 2001 From: Alex Sitnikov Date: Sat, 20 Apr 2024 16:08:33 +0000 Subject: [PATCH] fixed Ubuntu build --- .github/workflows/build-ubuntu.yml | 4 ++-- Docker/Test-Build-Ubuntu-20.04.docker | 34 +++++++++++++++++++++++++++ Docker/Test-Build-Ubuntu-20.10.docker | 19 --------------- 3 files changed, 36 insertions(+), 21 deletions(-) create mode 100644 Docker/Test-Build-Ubuntu-20.04.docker delete mode 100644 Docker/Test-Build-Ubuntu-20.10.docker diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index 19edc1e..bfcfd13 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -11,6 +11,6 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 - - name: Build Ubuntu-20.10 + - name: Build Ubuntu-20.04 run: | - docker build -f Docker/Test-Build-Ubuntu-20.10.docker . + docker build -f Docker/Test-Build-Ubuntu-20.04.docker . \ No newline at end of file diff --git a/Docker/Test-Build-Ubuntu-20.04.docker b/Docker/Test-Build-Ubuntu-20.04.docker new file mode 100644 index 0000000..676a4f1 --- /dev/null +++ b/Docker/Test-Build-Ubuntu-20.04.docker @@ -0,0 +1,34 @@ +FROM ubuntu:20.04 +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt update -y + +# Apparently wget is not installed by default +RUN apt-get install -y wget + +# Add llvm pub key +RUN wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc + +# Install add-apt-repository +RUN apt-get install -y software-properties-common + +# Add llvm 18 repository with sources +RUN add-apt-repository -s -y "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-18 main" + +RUN echo apt-get update && apt-get install -y llvm-18 clang-18 libclang-18-dev libclang-cpp18-dev python3-pip + +# Easiest way to get sufficiently new cmake appears to be using pip - Ubuntu 20.10 version is too old +RUN pip3 install --upgrade cmake + +# Copy the source into the Docker container +RUN mkdir -p /c2ffi +COPY / /c2ffi +WORKDIR /c2ffi + +# Build c2ffi +RUN cd /c2ffi && \ + rm -rf build && mkdir -p build && cd build && \ + cmake -DBUILD_CONFIG=Release .. && make + +# As a sanity check, make sure the binary we built can be executed +RUN /c2ffi/build/bin/c2ffi --help \ No newline at end of file diff --git a/Docker/Test-Build-Ubuntu-20.10.docker b/Docker/Test-Build-Ubuntu-20.10.docker deleted file mode 100644 index 7ea4aee..0000000 --- a/Docker/Test-Build-Ubuntu-20.10.docker +++ /dev/null @@ -1,19 +0,0 @@ -FROM ubuntu:20.10 -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get install -y llvm-11 clang-11 libclang-11-dev libclang-cpp11-dev python3-pip - -# Easiest way to get sufficiently new cmake appears to be using pip - Ubuntu 20.10 version is too old -RUN pip3 install --upgrade cmake - -# Copy the source into the Docker container -RUN mkdir -p /c2ffi -COPY / /c2ffi -WORKDIR /c2ffi - -# Build c2ffi -RUN cd /c2ffi && \ - rm -rf build && mkdir -p build && cd build && \ - cmake -DBUILD_CONFIG=Release .. && make - -# As a sanity check, make sure the binary we built can be executed -RUN /c2ffi/build/bin/c2ffi --help