@@ -5,44 +5,40 @@ ARG --global default_container_registry = "docker.io"
5
5
6
6
build-gcc :
7
7
ARG --required gcc_version
8
+ # GCC provides a GCC container, based on Debian
8
9
FROM $default_container_registry/gcc:$gcc_version
9
- ARG warnings_as_errors= true
10
- DO --pass-args +BOOTSTRAP_BUILD_INSTALL_EXPORT \
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"
10
+ DO --pass-args +BOOTSTRAP_BUILD_INSTALL_EXPORT
14
11
15
12
build-clang :
16
13
ARG --required clang_version_major
14
+ # LLVM doesn't provide a container, so we just use Ubuntu and the automated
15
+ # LLVM installser script to get the appropriate major version
17
16
FROM $default_container_registry/ubuntu:24.04
18
17
DO +INIT
19
18
# Required for the LLVM installer:
20
19
RUN __install lsb-release software-properties-common gnupg
20
+ # Install the major version using the automated LLVM installer:
21
21
RUN curl -Ls https://apt.llvm.org/llvm.sh -o llvm.sh && \
22
22
bash llvm.sh "$clang_version_major"
23
+ # Declare our preferred compiler version using CC and CXX env vars
23
24
ENV CC= clang-$clang_version_major
24
25
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"
26
+ DO --pass-args +BOOTSTRAP_BUILD_INSTALL_EXPORT
30
27
31
28
build-alpine :
32
29
ARG alpine_version= 3.20
33
30
FROM $default_container_registry/alpine:$alpine_version
34
- ARG warnings_as_errors= true
35
- DO --pass-args +BOOTSTRAP_BUILD_INSTALL_EXPORT \
36
- --build_deps "build-base git cmake gcc g++ ninja make ccache python3" \
37
- --vcpkg_bs_deps "pkgconfig linux-headers perl bash tar zip unzip curl" \
38
- --third_deps "fmt-dev boost-dev openssl-dev"
31
+ DO --pass-args +BOOTSTRAP_BUILD_INSTALL_EXPORT
39
32
40
33
build-debian :
41
- FROM $default_container_registry/debian:12
42
- DO --pass-args +BOOTSTRAP_BUILD_INSTALL_EXPORT \
43
- --build_deps "build-essential cmake git ninja-build python3 ccache" \
44
- --vcpkg_bs_deps "perl pkg-config linux-libc-dev curl zip unzip" \
45
- --third_deps "libfmt-dev libboost-url1.81-dev libboost-container1.81-dev libssl-dev"
34
+ ARG debian_version= 12.11
35
+ FROM $default_container_registry/debian:$debian_version
36
+ DO --pass-args +BOOTSTRAP_BUILD_INSTALL_EXPORT
37
+
38
+ build-ubuntu :
39
+ ARG ubuntu_version= 24.04
40
+ FROM $default_container_registry/ubuntu:$ubuntu_version
41
+ DO --pass-args +BOOTSTRAP_BUILD_INSTALL_EXPORT
46
42
47
43
build-rl :
48
44
FROM $default_container_registry/rockylinux:8
88
84
# Miscellaneous system init
89
85
INIT :
90
86
FUNCTION
91
- COPY --chmod = 755 tools/__install tools/__bool tools/__boolstr /usr/local/bin/
92
- RUN __install curl
87
+ COPY --chmod = 755 tools/__tool /usr/local/bin/__tool
88
+ RUN __tool __init
89
+ # Basic requirements to even function:
90
+ RUN __install lsb-release curl
91
+
92
+ # Obtain uv
93
93
ARG uv_version = "0.8.15"
94
94
ARG uv_install_sh_url = "https://astral.sh/uv/$uv_version/install.sh"
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 - \
95
+ IF ! test -f /usr/local/bin/uv
96
+ RUN curl -LsSf "$uv_install_sh_url" \
97
+ | env UV_UNMANAGED_INSTALL= /opt/uv sh - \
98
98
&& ln -s /opt/uv/uv /usr/local/bin/uv \
99
99
&& uv --version
100
100
END
@@ -113,28 +113,47 @@ BOOTSTRAP_BUILD_INSTALL_EXPORT:
113
113
BOOTSTRAP_DEPS :
114
114
FUNCTION
115
115
DO +INIT
116
- # Dependencies that are required for the build. Always installed
117
- ARG build_deps
118
- RUN __install $build_deps
119
- # Switch behavior based on whether we use vcpkg
116
+ # Do we want to use vcpkg?
120
117
ARG use_vcpkg= true
121
- IF ! __bool $use_vcpkg
122
- # No vcpkg. Install system dependencies
123
- ARG third_deps
124
- RUN __install $third_deps
125
- # Install system deps for testing, if needed
126
- ARG test_deps
127
- ARG test= true
128
- IF $test
129
- RUN __install $test_deps
118
+ # Are we installing test-only dependencies?
119
+ ARG test= true
120
+
121
+ IF __bool $test
122
+ # We use Git to obtain certain test artifacts.
123
+ RUN __install git
124
+ END
125
+
126
+ IF __distro_is "Alpine-*"
127
+ # Basic Alpine requirements:
128
+ RUN __install build-base
129
+ IF __bool $use_vcpkg
130
+ # Requirements for vcpkg to install our dependencies:
131
+ RUN __install pkgconfig linux-headers perl bash tar zip unzip git
132
+ ELSE
133
+ # Our dependencies, obtained from the system package manager:
134
+ RUN __install fmt-dev boost-dev openssl-dev
130
135
END
131
- ELSE
132
- # vcpkg may have dependencies that need to be installed to bootstrap
133
- ARG vcpkg_bs_deps
134
- RUN __install $vcpkg_bs_deps
136
+ ELSE IF __distro_is "Debian-*" "Ubuntu-*"
137
+ RUN __install build-essential
138
+ IF __bool $use_vcpkg
139
+ RUN __install zip unzip pkg-config
140
+ ELSE
141
+ RUN __install libfmt-dev libssl-dev
142
+ IF apt-cache show libboost-url-dev 2> &1 > /dev/null
143
+ # Install the default version, if available
144
+ RUN __install libboost-url-dev libboost-container-dev
145
+ ELSE
146
+ # Older debian requires qualified versions
147
+ RUN __install libboost-url1.81-dev libboost-container1.81-dev
148
+ END
149
+ END
150
+ END
151
+
152
+ # Do some additional setup for vcpkg
153
+ IF __bool $use_vcpkg
135
154
# Required when bootstrapping vcpkg on Alpine:
136
155
ENV VCPKG_FORCE_SYSTEM_BINARIES= 1
137
- # Bootstrap dependencies
156
+ # Bootstrap dependencies, warming the user-local binary cache
138
157
LET src_tmp= /s-tmp
139
158
WORKDIR $src_tmp
140
159
COPY --dir vcpkg*.json $src_tmp
0 commit comments