Skip to content

Commit c97ac92

Browse files
More build configs for RHEL testing
1 parent 9073f33 commit c97ac92

File tree

2 files changed

+51
-52
lines changed

2 files changed

+51
-52
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ jobs:
5757
vcpkg_arg: &vcpkg_arg
5858
- use_vcpkg=false
5959
- use_vcpkg=true
60+
include:
61+
# Add Almalinux (RHEL) targets, alwasy using vcpkg
62+
- { from: almalinux:latest, vcpkg_arg: use_vcpkg=true }
63+
- { from: almalinux:10, vcpkg_arg: use_vcpkg=true }
64+
# RHEL 9 requires a newer GCC, using the GCC toolset:
65+
- { from: almalinux:9 --gts_version=12, vcpkg_arg: use_vcpkg=true }
66+
- { from: almalinux:9 --gts_version=13, vcpkg_arg: use_vcpkg=true }
67+
- { from: almalinux:9 --gts_version=14, vcpkg_arg: use_vcpkg=true }
6068
steps:
6169
- *checkout
6270
- name: Build

Earthfile

Lines changed: 43 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,36 @@ VERSION 0.8
33
# Tweak the default container registry used for pulling system images.
44
ARG --global default_container_registry = "docker.io"
55

6-
build:
6+
init:
77
ARG --required from
8+
# Toggle the building of test programs
9+
ARG test = true
10+
# Toggle whether we use vcpkg to obtain dependencies
11+
ARG use_vcpkg = true
812
FROM --pass-args $from
9-
DO --pass-args +BOOTSTRAP_BUILD_INSTALL_EXPORT
13+
DO --pass-args +INSTALL_DEPS
14+
15+
build:
16+
ARG warnings_as_errors = true
17+
ARG configs = Debug
18+
ARG test = true
19+
ARG use_vcpkg = true
20+
FROM --pass-args +init
21+
DO --pass-args +BUILD_INSTALL_EXPORT
1022

1123
test:
1224
FROM --pass-args +build
1325
RUN uv run --group=build \
1426
make ctest-run TEST_CONFIG=Debug JUNIT_OUTPUT=/results.xml || :
1527
SAVE ARTIFACT /results.xml
1628

29+
# Target used to install LLVM for a build. Not used outside this file
1730
env.llvm:
1831
ARG --required llvm_major_version
1932
# LLVM doesn't provide a container, so we just use Ubuntu and the automated
2033
# LLVM installser script to get the appropriate major version
2134
FROM $default_container_registry/ubuntu:24.04
22-
DO +INIT
35+
DO +BASE
2336
# Required for the LLVM installer:
2437
RUN __install lsb-release software-properties-common gnupg
2538
# Install the major version using the automated LLVM installer:
@@ -29,28 +42,6 @@ env.llvm:
2942
ENV CC=clang-$llvm_major_version
3043
ENV CXX=clang++-$llvm_major_version
3144

32-
build-rl:
33-
FROM $default_container_registry/rockylinux:8
34-
RUN dnf -y install epel-release unzip
35-
LET cmake_url = "https://github.com/Kitware/CMake/releases/download/v3.30.3/cmake-3.30.3-linux-x86_64.sh"
36-
RUN curl "$cmake_url" -Lo cmake.sh && \
37-
sh cmake.sh --exclude-subdir --prefix=/usr/local/ --skip-license
38-
LET ninja_url = "https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux.zip"
39-
RUN curl -L "$ninja_url" -o ninja.zip && \
40-
unzip ninja.zip -d /usr/local/bin/
41-
CACHE ~/.ccache # Epel Ccache still uses the old cache location
42-
DO --pass-args +BOOTSTRAP_BUILD_INSTALL_EXPORT \
43-
--launcher "scl run gcc-toolset-12 --" \
44-
--build_deps "gcc-toolset-12 python3.12 ccache" \
45-
--vcpkg_bs_deps "zip unzip git perl"
46-
47-
build-fedora:
48-
FROM $default_container_registry/fedora:41
49-
DO --pass-args +BOOTSTRAP_BUILD_INSTALL_EXPORT \
50-
--build_deps "cmake ninja-build git gcc gcc-c++ python3.12 ccache" \
51-
--vcpkg_bs_deps "zip unzip perl" \
52-
--third_deps "boost-devel boost-url fmt-devel openssl-devel"
53-
5445
build-multi:
5546
FROM $default_container_registry/alpine
5647
# COPY +build-rl/ out/rl/ ## XXX: Redhat build is broken: Investigate GCC linker issues
@@ -59,24 +50,23 @@ build-multi:
5950
COPY (+build-fedora/ --use_vcpkg=false) out/fedora/
6051
SAVE ARTIFACT out/* /
6152

62-
matrix:
63-
BUILD +run \
64-
--target +build-debian --target +build-alpine --target +build-fedora \
65-
--use_vcpkg=true --use_vcpkg=false \
66-
--test=false --test=true
67-
6853
run:
6954
LOCALLY
7055
ARG --required target
7156
BUILD --pass-args $target
7257

7358
# Miscellaneous system init
74-
INIT:
59+
BASE:
7560
FUNCTION
7661
COPY --chmod=755 tools/__tool /usr/local/bin/__tool
7762
RUN __tool __init
7863
# Basic requirements to even function:
79-
RUN __install lsb-release curl
64+
IF test -f /etc/redhat-release && ! test -f /etc/fedora-release
65+
# Install EPEL on RHEL-based platforms
66+
RUN __install epel-release
67+
END
68+
RUN __install lsb-release && \
69+
(curl --version || __install curl)
8070

8171
# Obtain uv
8272
ARG uv_version = "0.8.15"
@@ -88,20 +78,18 @@ INIT:
8878
&& uv --version
8979
END
9080

91-
BOOTSTRAP_BUILD_INSTALL_EXPORT:
81+
BUILD_INSTALL_EXPORT:
9282
FUNCTION
93-
# Bootstrap
94-
DO --pass-args +BOOTSTRAP_DEPS
9583
# Build and install
9684
DO --pass-args +BUILD --install_prefix=/opt/amongoc --cpack_out=/tmp/pkg
9785
# Export
9886
SAVE ARTIFACT /tmp/pkg/* /pkg/
9987
SAVE ARTIFACT /opt/amongoc/* /install/
10088

10189
# Install dependencies, possibly warming up the user-local vcpkg cache if vcpkg is used
102-
BOOTSTRAP_DEPS:
90+
INSTALL_DEPS:
10391
FUNCTION
104-
DO +INIT
92+
DO +BASE
10593
# Do we want to use vcpkg?
10694
ARG use_vcpkg=true
10795
# Are we installing test-only dependencies?
@@ -138,6 +126,15 @@ BOOTSTRAP_DEPS:
138126
END
139127
ELSE IF test -f /etc/redhat-release
140128
RUN __install python3.12 ccache gcc gcc-c++
129+
# Specify a version of the GCC toolset to be installed, available in
130+
# RHEL-based systems ≤9.x
131+
ARG gts_version
132+
IF test "$gts_version" != ''
133+
RUN __install scl-utils gcc-toolset-$gts_version
134+
ENV LAUNCHER = "scl run gcc-toolset-$gts_version -- "
135+
ELSE
136+
RUN __install gcc gcc-c++
137+
END
141138
IF __bool $use_vcpkg
142139
RUN __install zip unzip perl git
143140
ELSE
@@ -165,8 +162,7 @@ BOOTSTRAP_DEPS:
165162
" > $src_tmp/CMakeLists.txt
166163
# Running CMake now will prepare our dependencies without configuring the rest of the project
167164
CACHE ~/.cache/vcpkg
168-
ARG launcher
169-
RUN $launcher uv run --with=cmake~=3.20 --with=ninja cmake -G Ninja -S $src_tmp -B $src_tmp/_build/vcpkg-bootstrapping
165+
RUN $LAUNCHER uv run --with=cmake~=3.20 --with=ninja cmake -G Ninja -S $src_tmp -B $src_tmp/_build/vcpkg-bootstrapping
170166
END
171167

172168
COPY_SRC:
@@ -179,18 +175,13 @@ BUILD:
179175
FUNCTION
180176
ARG install_prefix
181177
ARG cpack_out
182-
ARG launcher
183178
DO +COPY_SRC
184-
# Toggle testing
185-
ARG test=true
186-
# Enable -Werror
187-
ARG warnings_as_errors=true
188-
# Toggle PMM in the build
189-
ARG use_vcpkg=true
190-
# The configurations to build (semicolon-separated list)
191-
ARG configs=Debug
179+
ARG --required test
180+
ARG --required warnings_as_errors
181+
ARG --required use_vcpkg
182+
ARG --required configs
192183
# Configure
193-
RUN $launcher uv run --group=build \
184+
RUN $LAUNCHER uv run --group=build \
194185
make build \
195186
CONFIGS="$configs" \
196187
INSTALL_PREFIX=$install_prefix \
@@ -199,12 +190,12 @@ BUILD:
199190
BUILD_TESTING=$(__boolstr $test)
200191
IF test "$install_prefix" != ""
201192
FOR conf IN Debug # Release RelWithDebInfo
202-
RUN $launcher uv run --group=build \
193+
RUN $LAUNCHER uv run --group=build \
203194
make install-fast INSTALL_PREFIX=$install_prefix INSTALL_CONFIG=$conf
204195
END
205196
END
206197
IF test "$cpack_out" != ""
207-
RUN $launcher uv run --group=build \
198+
RUN $LAUNCHER uv run --group=build \
208199
make package-fast \
209200
CPACK_OUT="$cpack_out" \
210201
PACKAGE_CONFIGS="$configs"

0 commit comments

Comments
 (0)