@@ -5,44 +5,40 @@ ARG --global default_container_registry = "docker.io"
55
66build-gcc :
77 ARG --required gcc_version
8+ # GCC provides a GCC container, based on Debian
89 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
1411
1512build-clang :
1613 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
1716 FROM $default_container_registry/ubuntu:24.04
1817 DO +INIT
1918 # Required for the LLVM installer:
2019 RUN __install lsb-release software-properties-common gnupg
20+ # Install the major version using the automated LLVM installer:
2121 RUN curl -Ls https://apt.llvm.org/llvm.sh -o llvm.sh && \
2222 bash llvm.sh "$clang_version_major"
23+ # Declare our preferred compiler version using CC and CXX env vars
2324 ENV CC= clang-$clang_version_major
2425 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
3027
3128build-alpine :
3229 ARG alpine_version= 3.20
3330 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
3932
4033build-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
4642
4743build-rl :
4844 FROM $default_container_registry/rockylinux:8
8884# Miscellaneous system init
8985INIT :
9086 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
9393 ARG uv_version = "0.8.15"
9494 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 - \
9898 && ln -s /opt/uv/uv /usr/local/bin/uv \
9999 && uv --version
100100 END
@@ -113,28 +113,47 @@ BOOTSTRAP_BUILD_INSTALL_EXPORT:
113113BOOTSTRAP_DEPS :
114114 FUNCTION
115115 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?
120117 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
130135 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
135154 # Required when bootstrapping vcpkg on Alpine:
136155 ENV VCPKG_FORCE_SYSTEM_BINARIES= 1
137- # Bootstrap dependencies
156+ # Bootstrap dependencies, warming the user-local binary cache
138157 LET src_tmp= /s-tmp
139158 WORKDIR $src_tmp
140159 COPY --dir vcpkg*.json $src_tmp
0 commit comments