1
1
VERSION 0.8
2
2
3
+ # Tweak the default container registry used for pulling system images.
3
4
ARG --global default_container_registry = "docker.io"
4
5
5
6
build-gcc :
6
7
ARG --required gcc_version
7
8
FROM $default_container_registry/gcc:$gcc_version
9
+ ARG warnings_as_errors= true
8
10
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"
11
30
12
31
build-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
14
35
DO --pass-args +BOOTSTRAP_BUILD_INSTALL_EXPORT \
15
36
--build_deps "build-base git cmake gcc g++ ninja make ccache python3" \
16
37
--vcpkg_bs_deps "pkgconfig linux-headers perl bash tar zip unzip curl" \
@@ -19,8 +40,6 @@ build-alpine:
19
40
build-debian :
20
41
FROM $default_container_registry/debian:12
21
42
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 \
24
43
--build_deps "build-essential cmake git ninja-build python3 ccache" \
25
44
--vcpkg_bs_deps "perl pkg-config linux-libc-dev curl zip unzip" \
26
45
--third_deps "libfmt-dev libboost-url1.81-dev libboost-container1.81-dev libssl-dev"
69
88
# Miscellaneous system init
70
89
INIT :
71
90
FUNCTION
72
- COPY --chmod = 755 tools/__install / usr/local/bin/__install
91
+ COPY --chmod = 755 tools/__install tools/__bool tools/__boolstr / usr/local/bin/
73
92
RUN __install curl
74
93
ARG uv_version = "0.8.15"
75
94
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
80
101
81
102
BOOTSTRAP_BUILD_INSTALL_EXPORT :
82
103
FUNCTION
@@ -97,10 +118,10 @@ BOOTSTRAP_DEPS:
97
118
RUN __install $build_deps
98
119
# Switch behavior based on whether we use vcpkg
99
120
ARG use_vcpkg= true
100
- IF ! $use_vcpkg
121
+ IF ! __bool $use_vcpkg
101
122
# 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
104
125
# Install system deps for testing, if needed
105
126
ARG test_deps
106
127
ARG test= true
@@ -126,7 +147,7 @@ BOOTSTRAP_DEPS:
126
147
# Running CMake now will prepare our dependencies without configuring the rest of the project
127
148
CACHE ~/.cache/vcpkg
128
149
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
130
151
END
131
152
132
153
COPY_SRC :
@@ -144,19 +165,21 @@ BUILD:
144
165
CACHE ~/.cache/ccache
145
166
# Toggle testing
146
167
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
149
170
# Toggle PMM in the build
150
171
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
152
174
# Configure
153
175
RUN $launcher make test \
154
176
LAUNCHER= 'uv run --group=build' \
155
- CONFIGS= "Debug " \
177
+ CONFIGS= "$configs " \
156
178
TEST_CONFIG= "Debug" \
157
- USE_PMM= $__use_vcpkg \
158
179
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 )
160
183
IF test "$install_prefix" != ""
161
184
FOR conf IN Debug # Release RelWithDebInfo
162
185
RUN $launcher make install-fast LAUNCHER= 'uv run --group=build' INSTALL_PREFIX= $install_prefix INSTALL_CONFIG= $conf
0 commit comments