2121 # the cache.
2222 #
2323 # This file has a few major sections:
24- # - Setup COMMANDs
25- # - Utility COMMANDs
24+ # - Setup FUNCTIONs
25+ # - Utility FUNCTIONs
2626 # - Environment targets
2727 # - Build/test/CI targets
2828 #
3333 # and can be used i.e. "earthly +build --env=u22"
3434 #
3535 # The following environment are defined in this file:
36+ # • u24 - Ubuntu 24.04
3637 # • u22 - Ubuntu 22.04
37- # • u20 - Ubuntu 20.04
38- # • u18 - Ubuntu 18.04
39- # • u16 - Ubuntu 16.04
40- # • u14 - Ubuntu 14.04
41- # • rl8 - RockyLinux 8 - Stand-in for RHEL 8
42- # • c7 - CentOS 7 - Stand-in for RHEL 7
43- # • c6 - CentOS 6 - Stand-in for RHEL 6
44- # • amzn1 - AmazonLinux (2018.03)
45- # • amzn2 - AmazonLinux 2
46- # • deb9 - Debian 9.2
47- # • deb10 - Debian 10.0
38+ # • c10 - CentOS Stream 10 - Stand-in for RHEL 10
39+ # • c9 - CentOS Stream 9 - Stand-in for RHEL 9
40+ # • alma8 - AlmaLinux 8 - Stand-in for RHEL 8
41+ # • amzn2023 - AmazonLinux 2023
4842 # • deb11 - Debian 11.0
4943 # • deb12 - Debian 12.0
5044 # • deb13 - Debian 13
51- # • sles15 - OpenSUSE Leap 15.0
52- # • alpine - Alpine Linux 3.18
45+ # • alpine - Alpine Linux 3.23
5346 #
5447 # When adding new environments, prefer an unqualified image ID with a version:
5548 # • DO NOT: "ubuntu"
5952 # Use of an unqualified image ID may enable separate registry in CI and local development.
6053# ###
6154
62- VERSION --use-cache-command 0.6
63- FROM alpine:3.16
55+ VERSION 0.8
56+ FROM alpine:3.23
6457WORKDIR /s
6558
6659init :
@@ -82,128 +75,75 @@ init:
8275
8376DEBIAN_SETUP :
8477 # Setup for a debian-like build environment. Used for both Debian and Ubuntu
85- COMMAND
78+ FUNCTION
8679 RUN __install build-essential g++ libssl-dev curl unzip python3 pkg-config \
8780 git ccache findutils ca-certificates
8881
8982REDHAT_SETUP :
90- # Setup for a redhat-like build environment. Used for CentOS and RockyLinux .
91- COMMAND
83+ # Setup for a redhat-like build environment. Used for CentOS Stream and AlmaLinux .
84+ FUNCTION
9285 RUN __install epel-release && \
9386 __install gcc-c++ make openssl-devel curl unzip git ccache findutils \
9487 patch
9588
96- CENTOS6_SETUP :
97- # Special setup for CentOS6: The packages have been moved to the vault, so
98- # we need to enable the vault repos before we perform any __installs
99- COMMAND
100- RUN rm /etc/yum.repos.d/*.repo
101- COPY etc/c6-vault.repo /etc/yum.repos.d/CentOS-Base.repo
102- DO +REDHAT_SETUP
103-
10489AMZ_SETUP :
10590 # Setup for Amazon Linux.
106- COMMAND
107- # amzn1 has "python38", but amzn2 has "python3." Try both
108- RUN __install python3 || __install python38
91+ FUNCTION
10992 RUN __install gcc-c++ make openssl-devel curl unzip tar gzip \
11093 openssh-clients patch git
11194
112- SLES_SETUP :
113- # Setup for a SLES/SUSE build environment
114- COMMAND
115- RUN __install gcc-c++ make libopenssl-devel curl unzip tar gzip python3 \
116- patch git xz which
117-
11895ALPINE_SETUP :
11996 # Setup for an Alpine Linux build environment
120- COMMAND
97+ FUNCTION
12198 RUN __install make bash gcc g++ unzip curl tar gzip git musl-dev \
12299 linux-headers openssl-dev python3
123100
124101# Environment targets are defined below. These do not have build outputs, but
125102# are rather themselves the "outputs" to be used as the environment for subsequent
126103# tasks
127104
128- env.c6 :
129- # A CentOS 6 environment.
130- FROM +init --base = centos:6
131- DO +CENTOS6_SETUP
105+ env.c9 :
106+ # Use CentOS Stream 9 as a stand-in for RHEL 9
107+ FROM +init --base = quay.io/ centos/centos:stream9
108+ DO +REDHAT_SETUP
132109
133- env.c7 :
134- # A CentOS 7 environment.
135- FROM +init --base = centos:7
110+ env.c10 :
111+ # Use CentOS Stream 10 as a stand-in for RHEL 10
112+ FROM +init --base = quay.io/ centos/centos:stream10
136113 DO +REDHAT_SETUP
137114
138- env.rl8 :
139- # CentOS 8 is cancelled. Use RockyLinux 8 for our RHEL 8 environment.
140- FROM +init --base = rockylinux :8
115+ env.alma8 :
116+ # Use AlmaLinux 8 as a stand-in for RHEL 8
117+ FROM +init --base = almalinux :8
141118 DO +REDHAT_SETUP
142119
143120# Utility command for Ubuntu environments
144121ENV_UBUNTU :
145- COMMAND
122+ FUNCTION
146123 ARG --required version
147124 FROM +init --base = ubuntu:$version
148125 DO +DEBIAN_SETUP
149126
150- env.u14 :
151- # An Ubuntu 14.04 environment
152- DO +ENV_UBUNTU --version 14.04
153-
154- env.u16 :
155- # An Ubuntu 16.04 environment
156- DO +ENV_UBUNTU --version 16.04
157-
158- env.u18 :
159- # An Ubuntu 18.04 environment
160- DO +ENV_UBUNTU --version 18.04
161-
162- env.u20 :
163- # An Ubuntu 20.04 environment
164- DO +ENV_UBUNTU --version 20.04
165-
166127env.u22 :
167128 # An Ubuntu 22.04 environment
168129 DO +ENV_UBUNTU --version 22.04
169130
170- env.amzn1 :
171- # An Amazon "1" environment. (AmazonLinux 2018)
172- FROM +init --base = amazonlinux:2018.03
173- DO +AMZ_SETUP
131+ env.u24 :
132+ # An Ubuntu 24.04 environment
133+ DO +ENV_UBUNTU --version 24.04
174134
175- env.amzn2 :
176- # An AmazonLinux 2 environment
177- FROM +init --base = amazonlinux:2
135+ env.amzn2023 :
136+ # An Amazon "2023" environment. (AmazonLinux 2023)
137+ FROM +init --base = amazonlinux:2023
178138 DO +AMZ_SETUP
179139
180140# Utility command for Debian setup
181141ENV_DEBIAN :
182- COMMAND
142+ FUNCTION
183143 ARG --required version
184144 FROM +init --base = debian:$version
185- IF [ $version = "9.2" ]
186- # Update source list for archived Debian stretch packages.
187- # Refer: https://unix.stackexchange.com/a/743865/260858
188- RUN echo "deb http://archive.debian.org/debian stretch main" > /etc/apt/sources.list
189- # Trust newer Debian signing keys to avoid "unauthenticated packages" error:
190- COPY +get-deb-signing-keys/keys/deb10-archive-signing-key.gpg /etc/apt/trusted.gpg.d
191- COPY +get-deb-signing-keys/keys/deb11-archive-signing-key.gpg /etc/apt/trusted.gpg.d
192- END
193- IF [ $version = "10.0" ]
194- # Update source list for archived Debian buster packages.
195- RUN echo "deb http://archive.debian.org/debian buster main" > /etc/apt/sources.list
196- END
197145 DO +DEBIAN_SETUP
198146
199- env.deb9 :
200- # A Debian 9.2 environment
201- DO +ENV_DEBIAN --version 9.2
202-
203- env.deb10 :
204- # A Debian 10.0 environment
205- DO +ENV_DEBIAN --version 10.0
206-
207147env.deb-unstable :
208148 DO +ENV_DEBIAN --version = unstable
209149
@@ -219,19 +159,14 @@ env.deb13:
219159 # A Debian 13 environment
220160 DO +ENV_DEBIAN --version 13.0
221161
222- env.sles15 :
223- # An OpenSUSE Leap 15.0 environment.
224- FROM +init --base = opensuse/leap:15.0
225- DO +SLES_SETUP
226-
227162env.alpine :
228- FROM +init --base = alpine:3.18
163+ FROM +init --base = alpine:3.23
229164 DO +ALPINE_SETUP
230165
231166# Utility: Warm-up obtaining CMake and Ninja for the build. This is usually
232167# very quick, but on some platforms we need to compile them from source.
233168CACHE_WARMUP :
234- COMMAND
169+ FUNCTION
235170 # Copy only the scripts that are strictly necessary for the operation, to
236171 # avoid cache invalidation later on.
237172 COPY .evergreen/setup-env.sh \
@@ -246,7 +181,7 @@ CACHE_WARMUP:
246181 bash /T/ensure-ninja.sh
247182
248183COPY_SOURCE :
249- COMMAND
184+ FUNCTION
250185 COPY --dir \
251186 .git/ \
252187 cmake/ \
@@ -263,7 +198,7 @@ COPY_SOURCE:
263198 COPY --dir bindings/cs/ "/s/libmongocrypt/bindings/"
264199
265200BUILD_EXAMPLE_STATE_MACHINE :
266- COMMAND
201+ FUNCTION
267202 COPY test/example-state-machine.c /s/
268203 RUN pkg-config --exists libmongocrypt --print-errors && \
269204 gcc /s/example-state-machine.c \
@@ -379,19 +314,6 @@ check-format:
379314 COPY --dir .clang-format src test /X/
380315 RUN /X/etc/format-all.sh --dry-run -Werror --verbose
381316
382- get-deb-signing-keys :
383- FROM +env.deb12
384- RUN __install gpg
385- # Get "Debian 10/buster archive signing key"
386- RUN gpg --keyserver keyserver.ubuntu.com --recv-keys 80D15823B7FD1561F9F7BCDDDC30D7C23CBBABEE
387- RUN gpg --export 80D15823B7FD1561F9F7BCDDDC30D7C23CBBABEE > deb10-archive-signing-key.gpg
388- SAVE ARTIFACT deb10-archive-signing-key.gpg /keys/
389-
390- # Import "Debian 11/bullseye archive signing key"
391- RUN gpg --keyserver keyserver.ubuntu.com --recv-keys 1F89983E0081FDE018F3CC9673A4F27B8DD47936
392- RUN gpg --export 1F89983E0081FDE018F3CC9673A4F27B8DD47936 > deb11-archive-signing-key.gpg
393- SAVE ARTIFACT deb11-archive-signing-key.gpg /keys/
394-
395317# The main "build" target. Options:
396318# • --env=[...] (default "u22")
397319# · Set the environment for the build. Any name of and "env.<name>" targets
0 commit comments