Skip to content

Commit

Permalink
Clang 16, CMake 3.26.3, BuildCache 0.28.2, Node 18 (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
pablohoch authored Apr 19, 2023
1 parent d7091bb commit c18ac98
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 29 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,34 @@ name: Unix Build

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]
release:
types:
- published

jobs:
docker:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Docker setup-buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
with:
install: true

- name: Docker Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/${{ github.repository }}
Expand All @@ -40,8 +40,9 @@ jobs:
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=edge
- name: Docker build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
push: true
context: .
Expand Down
35 changes: 14 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
FROM ubuntu:22.04 AS build-env

ENV ASAN_SYMBOLIZER_PATH="/usr/lib/llvm-14/bin/llvm-symbolizer"
ENV ASAN_SYMBOLIZER_PATH="/usr/lib/llvm-16/bin/llvm-symbolizer"
ENV ASAN_OPTIONS="alloc_dealloc_mismatch=0"
ENV UBSAN_OPTIONS="halt_on_error=1:abort_on_error=1"
ENV DEBIAN_FRONTEND="noninteractive"
ENV BUILDCACHE_COMPRESS="true"
ENV BUILDCACHE_DIRECT_MODE="true"
ENV BUILDCACHE_ACCURACY="SLOPPY"
ENV BUILDCACHE_LUA_PATH="/opt/buildcache/share/lua-examples"
ENV PATH="/opt:/opt/node-v16.14.0-linux-x64/bin:/opt/cmake-3.23.0-rc3-linux-x86_64/bin:/opt/buildcache/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
ENV PATH="/opt:/opt/node-v18.16.0-linux-x64/bin:/opt/cmake-3.26.3-linux-x86_64/bin:/opt/buildcache/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# BASE SETUP
RUN apt-get update && \
apt-get install -y --no-install-recommends apt-utils && \
apt-get install -y --no-install-recommends software-properties-common xz-utils wget gnupg2 ca-certificates software-properties-common && \
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc && \
apt-get update && \
apt-get install -y --no-install-recommends \
netbase \
Expand All @@ -25,8 +25,8 @@ RUN apt-get update && \
g++-11 gcc-11

# INSTALL CLANG
RUN add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main" && \
apt-get install -y --no-install-recommends clang-14 lldb-14 lld-14 clangd-14 clang-tidy-14 clang-format-14 clang-tools-14 llvm-14-dev llvm-14-tools libomp-14-dev libc++-14-dev libc++abi-14-dev libclang-common-14-dev libclang-14-dev libclang-cpp14-dev libunwind-14-dev
RUN add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" && \
apt-get install -y --no-install-recommends clang-16 lldb-16 lld-16 clangd-16 clang-tidy-16 clang-format-16 clang-tools-16 llvm-16-dev llvm-16-tools libomp-16-dev libc++-16-dev libc++abi-16-dev libclang-common-16-dev libclang-16-dev libclang-cpp16-dev libunwind-16-dev

# INSTALL MOLD LINKER
RUN wget https://github.com/motis-project/mold/releases/download/v1.2.0/mold-linux-amd64 && \
Expand All @@ -50,34 +50,27 @@ RUN wget https://github.com/motis-project/musl-toolchains/releases/download/0.0.
rm -rf x86_64-multilib-linux-musl.tar.xz

# INSTALL NODE JS
RUN wget https://nodejs.org/dist/v16.14.0/node-v16.14.0-linux-x64.tar.xz && \
tar xf node-v16.14.0-linux-x64.tar.xz -C /opt && \
rm -rf node-v16.14.0-linux-x64
RUN wget https://nodejs.org/dist/v18.16.0/node-v18.16.0-linux-x64.tar.xz && \
tar xf node-v18.16.0-linux-x64.tar.xz -C /opt && \
rm -rf node-v18.16.0-linux-x64.tar.xz

# INSTALL CMAKE
RUN wget https://github.com/Kitware/CMake/releases/download/v3.23.0-rc3/cmake-3.23.0-rc3-linux-x86_64.tar.gz &&\
tar xf cmake-3.23.0-rc3-linux-x86_64.tar.gz -C /opt && \
rm -rf cmake-3.23.0-rc3-linux-x86_64.tar.gz
RUN wget https://github.com/Kitware/CMake/releases/download/v3.26.3/cmake-3.26.3-linux-x86_64.tar.gz &&\
tar xf cmake-3.26.3-linux-x86_64.tar.gz -C /opt && \
rm -rf cmake-3.26.3-linux-x86_64.tar.gz

# INSTALL PKG
RUN wget https://github.com/motis-project/pkg/releases/download/v0.14/pkg-linux-amd64 -O /opt/pkg && \
chmod +x /opt/pkg

# INSTALL BUILDCACHE
RUN wget https://github.com/mbitsnbites/buildcache/releases/download/v0.27.6/buildcache-linux.tar.gz && \
RUN wget https://github.com/mbitsnbites/buildcache/releases/download/v0.28.2/buildcache-linux.tar.gz && \
tar xf buildcache-linux.tar.gz -C /opt && \
rm -rf buildcache-linux.tar.gz

# ADD BUILD DEBUG TOOLS
RUN apt-get install -y --no-install-recommends tree

# QUICKFIX FOR THIS ERROR FROM BUILDCACHE
# "libcrypto.so.1.1: cannot open shared object file: No such file or directory"
# Source: https://stackoverflow.com/a/72633324
RUN wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.16_amd64.deb && \
dpkg -i libssl1.1_1.1.1f-1ubuntu2.16_amd64.deb && \
rm -rf libssl1.1_1.1.1f-1ubuntu2.16_amd64.deb

# UBUNTU 22.04 IS MISSING BZIP IN THE BASE IMAGE
RUN apt-get install -y --no-install-recommends bzip2

Expand All @@ -94,4 +87,4 @@ RUN apt install build-essential -y --no-install-recommends && \
RUN cd /opt && \
mv elm-make elm-make-orig && \
printf "#\041/bin/bash\n\necho \"Running elm-make with sysconfcpus -n 2\"\n\n/usr/local/bin/sysconfcpus -n 2 /opt/elm-make-orig \"\$@\"" > elm-make && \
chmod +x elm-make
chmod +x elm-make

0 comments on commit c18ac98

Please sign in to comment.