Skip to content

Commit 0282cd5

Browse files
committed
Skip Clang install for GCC target setups
1 parent 3905061 commit 0282cd5

File tree

2 files changed

+138
-13
lines changed

2 files changed

+138
-13
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
config:
15-
- {name: "Ubuntu Clang 17", os: ubuntu-24.04, toolchain: "clang-17-toolchain.cmake", clang_version: 17, installed_clang_version: 17, cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "}
16-
- {name: "Ubuntu Clang 18", os: ubuntu-24.04, toolchain: "clang-18-toolchain.cmake", clang_version: 18, installed_clang_version: 17, cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "}
15+
- {name: "Ubuntu Clang 17", os: ubuntu-24.04, toolchain: "clang-17", clang_version: 17, installed_clang_version: 17, cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "}
16+
- {name: "Ubuntu Clang 18", os: ubuntu-24.04, toolchain: "clang-18", clang_version: 18, installed_clang_version: 17, cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "}
1717
# Note: clang-19 + Asan setup causes errors on some platforms. Temporary skip some checks via .asan_options.
18-
- {name: "Ubuntu Clang 19", os: ubuntu-24.04, toolchain: "clang-19-toolchain.cmake", clang_version: 19, installed_clang_version: 17, cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" ", asan_options: "new_delete_type_mismatch=0"}
19-
- {name: "Ubuntu GCC 13", os: ubuntu-24.04, toolchain: "gcc-13-toolchain.cmake", clang_version: 17, installed_clang_version: 17, cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "}
20-
- {name: "Ubuntu GCC 14", os: ubuntu-24.04, toolchain: "gcc-14-toolchain.cmake", clang_version: 17, installed_clang_version: 17, cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "}
18+
- {name: "Ubuntu Clang 19", os: ubuntu-24.04, toolchain: "clang-19", clang_version: 19, installed_clang_version: 17, cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" ", asan_options: "new_delete_type_mismatch=0"}
19+
- {name: "Ubuntu GCC 13", os: ubuntu-24.04, toolchain: "gcc-13", cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "}
20+
- {name: "Ubuntu GCC 14", os: ubuntu-24.04, toolchain: "gcc-14", cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "}
2121
steps:
2222
- uses: actions/checkout@v3
2323
with:
@@ -26,10 +26,11 @@ jobs:
2626
- name: Activate verbose shell
2727
run: set -x
2828
- name: Install LLVM+Clang
29-
if: startsWith(matrix.config.os, 'ubuntu-')
29+
if: startsWith(matrix.config.name, 'Ubuntu Clang')
3030
run: |
3131
set -x
3232
cat /etc/lsb-release
33+
# Remove existing Clang installations.
3334
sudo apt-get remove clang-${{matrix.config.installed_clang_version}} \
3435
lldb-${{matrix.config.installed_clang_version}} \
3536
lld-${{matrix.config.installed_clang_version}} \
@@ -48,30 +49,40 @@ jobs:
4849
libclang-${{matrix.config.installed_clang_version}}-dev \
4950
libclang-cpp${{matrix.config.installed_clang_version}}-dev \
5051
libunwind-${{matrix.config.installed_clang_version}}-dev
52+
# Install LLVM+Clang.
5153
wget https://apt.llvm.org/llvm.sh
5254
chmod +x llvm.sh
5355
sudo ./llvm.sh ${{matrix.config.clang_version}} all
5456
sudo apt-get install libc++-dev libc++1 libc++abi-dev libc++abi1
55-
- name: Install GCC 14
56-
if: matrix.config.name == 'Ubuntu GCC 14'
57+
find /usr/lib -name libc++.so*
58+
${{matrix.config.toolchain}} --version
59+
- name: Install GCC
60+
if: startsWith(matrix.config.name, 'Ubuntu GCC')
5761
run: |
5862
set -x
63+
# Remove existing GCC installations.
64+
sudo apt-get remove gcc-13 g++-13 gcc-14 g++-14 gcc g++
5965
sudo apt update
60-
sudo apt-get install g++-14
61-
- name: Configure
66+
# Install GCC.
67+
GCC_VERSION=$(echo ${{matrix.config.toolchain}} | cut -d '-' -f2)
68+
echo "GCC_VERSION=$GCC_VERSION"
69+
sudo apt-get install g++-${GCC_VERSION} gcc-${GCC_VERSION}
70+
find /usr/lib -name libstdc++.so*
71+
${{matrix.config.toolchain}} --version
72+
- name: CMake Configure
6273
run: |
6374
set -x
6475
rm -rf .build
6576
mkdir -p .build
6677
cd .build
6778
echo ${{ matrix.config.cmake_args }}
6879
echo ${{ matrix.config.toolchain }}
69-
cmake ${{ matrix.config.cmake_args }} -DCMAKE_TOOLCHAIN_FILE=etc/${{ matrix.config.toolchain }} -B . -S ..
70-
- name: Build
80+
cmake ${{ matrix.config.cmake_args }} -DCMAKE_TOOLCHAIN_FILE="etc/${{ matrix.config.toolchain }}-toolchain.cmake" -B . -S ..
81+
- name: CMake Build
7182
run: |
7283
set -x
7384
cmake --build .build --config Asan --target all -- -k 0
74-
- name: Test
85+
- name: CTest
7586
run: |
7687
set -x
7788
cd .build

Ubuntu-24.04.Dockerfile

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
FROM ubuntu:24.04
2+
3+
ARG TARGETPLATFORM
4+
ARG RUNNER_VERSION
5+
ARG RUNNER_CONTAINER_HOOKS_VERSION
6+
# Docker and Docker Compose arguments
7+
ARG CHANNEL=stable
8+
ARG DOCKER_VERSION=24.0.7
9+
ARG DOCKER_COMPOSE_VERSION=v2.23.0
10+
ARG DUMB_INIT_VERSION=1.2.5
11+
ARG RUNNER_USER_UID=1001
12+
ARG DOCKER_GROUP_GID=121
13+
14+
ENV DEBIAN_FRONTEND=noninteractive
15+
RUN apt-get update -y \
16+
&& apt-get install -y software-properties-common \
17+
&& add-apt-repository -y ppa:git-core/ppa \
18+
&& apt-get update -y \
19+
&& apt-get install -y --no-install-recommends \
20+
curl \
21+
ca-certificates \
22+
git \
23+
jq \
24+
sudo \
25+
unzip \
26+
zip \
27+
&& rm -rf /var/lib/apt/lists/*
28+
29+
# Download latest git-lfs version
30+
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
31+
apt-get install -y --no-install-recommends git-lfs
32+
33+
RUN adduser --disabled-password --gecos "" --uid $RUNNER_USER_UID runner \
34+
&& groupadd docker --gid $DOCKER_GROUP_GID \
35+
&& usermod -aG sudo runner \
36+
&& usermod -aG docker runner \
37+
&& echo "%sudo ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers \
38+
&& echo "Defaults env_keep += \"DEBIAN_FRONTEND\"" >> /etc/sudoers
39+
40+
ENV HOME=/home/runner
41+
42+
RUN export ARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) \
43+
&& if [ "$ARCH" = "arm64" ]; then export ARCH=aarch64 ; fi \
44+
&& if [ "$ARCH" = "amd64" ] || [ "$ARCH" = "i386" ]; then export ARCH=x86_64 ; fi \
45+
&& curl -fLo /usr/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v${DUMB_INIT_VERSION}/dumb-init_${DUMB_INIT_VERSION}_${ARCH} \
46+
&& chmod +x /usr/bin/dumb-init
47+
48+
ENV RUNNER_ASSETS_DIR=/runnertmp
49+
RUN export ARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) \
50+
&& if [ "$ARCH" = "amd64" ] || [ "$ARCH" = "x86_64" ] || [ "$ARCH" = "i386" ]; then export ARCH=x64 ; fi \
51+
&& mkdir -p "$RUNNER_ASSETS_DIR" \
52+
&& cd "$RUNNER_ASSETS_DIR" \
53+
&& curl -fLo runner.tar.gz https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-${ARCH}-${RUNNER_VERSION}.tar.gz \
54+
&& tar xzf ./runner.tar.gz \
55+
&& rm runner.tar.gz \
56+
&& ./bin/installdependencies.sh \
57+
&& mv ./externals ./externalstmp \
58+
# libyaml-dev is required for ruby/setup-ruby action.
59+
# It is installed after installdependencies.sh and before removing /var/lib/apt/lists
60+
# to avoid rerunning apt-update on its own.
61+
&& apt-get install -y libyaml-dev \
62+
&& rm -rf /var/lib/apt/lists/*
63+
64+
ENV RUNNER_TOOL_CACHE=/opt/hostedtoolcache
65+
RUN mkdir /opt/hostedtoolcache \
66+
&& chgrp docker /opt/hostedtoolcache \
67+
&& chmod g+rwx /opt/hostedtoolcache
68+
69+
RUN cd "$RUNNER_ASSETS_DIR" \
70+
&& curl -fLo runner-container-hooks.zip https://github.com/actions/runner-container-hooks/releases/download/v${RUNNER_CONTAINER_HOOKS_VERSION}/actions-runner-hooks-k8s-${RUNNER_CONTAINER_HOOKS_VERSION}.zip \
71+
&& unzip ./runner-container-hooks.zip -d ./k8s \
72+
&& rm -f runner-container-hooks.zip
73+
74+
RUN set -vx; \
75+
export ARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) \
76+
&& if [ "$ARCH" = "arm64" ]; then export ARCH=aarch64 ; fi \
77+
&& if [ "$ARCH" = "amd64" ] || [ "$ARCH" = "i386" ]; then export ARCH=x86_64 ; fi \
78+
&& curl -fLo docker.tgz https://download.docker.com/linux/static/${CHANNEL}/${ARCH}/docker-${DOCKER_VERSION}.tgz \
79+
&& tar zxvf docker.tgz \
80+
&& install -o root -g root -m 755 docker/docker /usr/bin/docker \
81+
&& rm -rf docker docker.tgz
82+
83+
RUN export ARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) \
84+
&& if [ "$ARCH" = "arm64" ]; then export ARCH=aarch64 ; fi \
85+
&& if [ "$ARCH" = "amd64" ] || [ "$ARCH" = "i386" ]; then export ARCH=x86_64 ; fi \
86+
&& mkdir -p /usr/libexec/docker/cli-plugins \
87+
&& curl -fLo /usr/libexec/docker/cli-plugins/docker-compose https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-linux-${ARCH} \
88+
&& chmod +x /usr/libexec/docker/cli-plugins/docker-compose \
89+
&& ln -s /usr/libexec/docker/cli-plugins/docker-compose /usr/bin/docker-compose \
90+
&& which docker-compose \
91+
&& docker compose version
92+
93+
# We place the scripts in `/usr/bin` so that users who extend this image can
94+
# override them with scripts of the same name placed in `/usr/local/bin`.
95+
COPY entrypoint.sh startup.sh logger.sh graceful-stop.sh update-status /usr/bin/
96+
97+
# Copy the docker shim which propagates the docker MTU to underlying networks
98+
# to replace the docker binary in the PATH.
99+
COPY docker-shim.sh /usr/local/bin/docker
100+
101+
# Configure hooks folder structure.
102+
COPY hooks /etc/arc/hooks/
103+
104+
# Add the Python "User Script Directory" to the PATH
105+
ENV PATH="${PATH}:${HOME}/.local/bin/"
106+
ENV ImageOS=ubuntu24
107+
108+
RUN echo "PATH=${PATH}" > /etc/environment \
109+
&& echo "ImageOS=${ImageOS}" >> /etc/environment
110+
111+
USER runner
112+
113+
ENTRYPOINT ["/bin/bash", "-c"]
114+
CMD ["entrypoint.sh"]

0 commit comments

Comments
 (0)