11VERSION 0.8
22
3+ # Tweak the default container registry used for pulling system images.
34ARG --global default_container_registry = "docker.io"
45
56build-gcc :
67 ARG --required gcc_version
78 FROM $default_container_registry/gcc:$gcc_version
9+ ARG warnings_as_errors= true
810 DO --pass-args +BOOTSTRAP_BUILD_INSTALL_EXPORT \
9- --build_deps "perl pkg-config linux-libc-dev curl zip unzip ccache" \
10- --third_deps "libfmt-dev libboost-url1.81-dev libboost-container1.81-dev libssl-dev"
11+ --warnings_as_errors = $warnings_as_errors \
12+ --build_deps "ccache" \
13+ --vcpkg_bs_deps "build-essential perl git pkg-config linux-libc-dev curl zip unzip"
14+
15+ build-clang :
16+ ARG --required clang_version_major
17+ FROM $default_container_registry/ubuntu:24.04
18+ DO +INIT
19+ # Required for the LLVM installer:
20+ RUN __install lsb-release software-properties-common gnupg
21+ RUN curl -Ls https://apt.llvm.org/llvm.sh -o llvm.sh && \
22+ bash llvm.sh "$clang_version_major"
23+ ENV CC= clang-$clang_version_major
24+ ENV CXX= clang++-$clang_version_major
25+ ARG warnings_as_errors= true
26+ DO --pass-args +BOOTSTRAP_BUILD_INSTALL_EXPORT \
27+ --warnings_as_errors = $warnings_as_errors \
28+ --build_deps "ccache" \
29+ --vcpkg_bs_deps "build-essential perl git pkg-config linux-libc-dev curl zip unzip"
1130
1231build-alpine :
13- FROM $default_container_registry/alpine:3.20
32+ ARG alpine_version= 3.20
33+ FROM $default_container_registry/alpine:$alpine_version
34+ ARG warnings_as_errors= true
1435 DO --pass-args +BOOTSTRAP_BUILD_INSTALL_EXPORT \
1536 --build_deps "build-base git cmake gcc g++ ninja make ccache python3" \
1637 --vcpkg_bs_deps "pkgconfig linux-headers perl bash tar zip unzip curl" \
@@ -19,8 +40,6 @@ build-alpine:
1940build-debian :
2041 FROM $default_container_registry/debian:12
2142 DO --pass-args +BOOTSTRAP_BUILD_INSTALL_EXPORT \
22- # Spec test generation requires a Python newer than what is on Debian 12
23- --BUILD_SPEC_TESTS = FALSE \
2443 --build_deps "build-essential cmake git ninja-build python3 ccache" \
2544 --vcpkg_bs_deps "perl pkg-config linux-libc-dev curl zip unzip" \
2645 --third_deps "libfmt-dev libboost-url1.81-dev libboost-container1.81-dev libssl-dev"
6988# Miscellaneous system init
7089INIT :
7190 FUNCTION
72- COPY --chmod = 755 tools/__install / usr/local/bin/__install
91+ COPY --chmod = 755 tools/__install tools/__bool tools/__boolstr / usr/local/bin/
7392 RUN __install curl
7493 ARG uv_version = "0.8.15"
7594 ARG uv_install_sh_url = "https://astral.sh/uv/$uv_version/install.sh"
76- RUN (curl -LsSf "$uv_install_sh_url" || wget -qO- "$uv_install_sh_url" ) \
77- | env UV_UNMANAGED_INSTALL= /opt/uv sh - \
78- && ln -s /opt/uv/uv /usr/local/bin/uv \
79- && uv --version
95+ IF ! uv --version
96+ RUN (curl -LsSf "$uv_install_sh_url" || wget -qO- "$uv_install_sh_url" ) \
97+ | env UV_UNMANAGED_INSTALL= /opt/uv sh - \
98+ && ln -s /opt/uv/uv /usr/local/bin/uv \
99+ && uv --version
100+ END
80101
81102BOOTSTRAP_BUILD_INSTALL_EXPORT :
82103 FUNCTION
@@ -97,10 +118,10 @@ BOOTSTRAP_DEPS:
97118 RUN __install $build_deps
98119 # Switch behavior based on whether we use vcpkg
99120 ARG use_vcpkg= true
100- IF ! $use_vcpkg
121+ IF ! __bool $use_vcpkg
101122 # No vcpkg. Install system dependencies
102- ARG third_deps
103- RUN __install $third_deps
123+ COPY tools/ci/install-third-deps.sh /
124+ RUN bash /install-third-deps.sh
104125 # Install system deps for testing, if needed
105126 ARG test_deps
106127 ARG test= true
@@ -126,7 +147,7 @@ BOOTSTRAP_DEPS:
126147 # Running CMake now will prepare our dependencies without configuring the rest of the project
127148 CACHE ~/.cache/vcpkg
128149 ARG launcher
129- RUN $launcher uv run --with = cmake~= 3.20 --with = ninja cmake -S $src_tmp -B $src_tmp /_build/vcpkg-bootstrapping
150+ RUN $launcher uv run --with = cmake~= 3.20 --with = ninja cmake -G Ninja - S $src_tmp -B $src_tmp /_build/vcpkg-bootstrapping
130151 END
131152
132153COPY_SRC :
@@ -144,19 +165,21 @@ BUILD:
144165 CACHE ~/.cache/ccache
145166 # Toggle testing
146167 ARG test= true
147- LET __test = $(echo $test | tr [:lower:] [:upper:])
148- ARG BUILD_SPEC_TESTS = TRUE
168+ # Enable -Werror
169+ ARG warnings_as_errors = false
149170 # Toggle PMM in the build
150171 ARG use_vcpkg= true
151- LET __use_vcpkg= $(echo "$use_vcpkg" | tr "[:lower:]" "[:upper:]" )
172+ # The configurations to build (semicolon-separated list)
173+ ARG configs= Debug
152174 # Configure
153175 RUN $launcher make test \
154176 LAUNCHER= 'uv run --group=build' \
155- CONFIGS= "Debug " \
177+ CONFIGS= "$configs " \
156178 TEST_CONFIG= "Debug" \
157- USE_PMM= $__use_vcpkg \
158179 INSTALL_PREFIX= $install_prefix \
159- BUILD_TESTING= $__test
180+ USE_PMM= $(__boolstr $use_vcpkg ) \
181+ WARNINGS_AS_ERRORS= $(__boolstr $warnings_as_errors ) \
182+ BUILD_TESTING= $(__boolstr $test )
160183 IF test "$install_prefix" != ""
161184 FOR conf IN Debug # Release RelWithDebInfo
162185 RUN $launcher make install-fast LAUNCHER= 'uv run --group=build' INSTALL_PREFIX= $install_prefix INSTALL_CONFIG= $conf
0 commit comments