-
Notifications
You must be signed in to change notification settings - Fork 455
[CDRIVER-4644] [CDRIVER-4602] Additional Earthly platforms, functionality, and cleanup #1537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
vector-of-bool
merged 23 commits into
mongodb:master
from
vector-of-bool:cdriver-4644-consolidate-archlinux-tasks
Apr 1, 2024
Merged
[CDRIVER-4644] [CDRIVER-4602] Additional Earthly platforms, functionality, and cleanup #1537
vector-of-bool
merged 23 commits into
mongodb:master
from
vector-of-bool:cdriver-4644-consolidate-archlinux-tasks
Apr 1, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Reusable build utils in tools/build.earth - New ways of installing individual components - Cleanup of earthly.py config generation - New environment targets for Alpine 3.16, 3.17, and Ubuntu 20.04
kevinAlbs
reviewed
Feb 26, 2024
kevinAlbs
approved these changes
Mar 1, 2024
kkloberdanz
approved these changes
Mar 5, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This changeset expands the platforms and targets that are executed via Earthly in our CI environment. This is primarily to address CDRIVER-4644 and CDRIVER-4602. In particular, the following additional platforms are now running in Earthly:
Of above, only Ubuntu 18.04 is mentioned directly in CDRIVER-4602, but expanding the reach of tested platforms is trivial and ensures that the CI scripts run correctly across a variety of platforms.
Additionally, another axis of variation was added: GCC versus LLVM/Clang. This supplants the previous ArchLinux tasks that tested both GCC and Clang, whereas previous Earthly-based tasks were only testing with GCC. The GCC/Clang axis is lifted to the build variant level, such that each target operating Linux distribution now has a "GCC" variant and an "LLVM/Clang" variant.
New
tools
utilitiesEarthly has an
IMPORT
feature that allows one to import an external Earthfile and refer to its targets and commands from an importer. TheIMPORT
may specify a URL (including a Git repo) or a local directory path. It will read from theEarthfile
orbuild.earth
in the imported directory.A
build.earth
file has been added to thetools/
subdirectory, and includes non-C-driver-specific utilities for container construction. Each build target environment is based ontools+init-env
, which adds the following utility commands that are universally useful:__str
, previouslystr.sh
, does simple string manipulation.__install
executes the system's package installer "correctly", removing the boilerplate required to perform installs. This script is adapted from the similar script used in libmongocrypt.__boolstr
evaluates a command and printstrue
orfalse
for whether that command exits zero.__alias
generates and installs new commands in/usr/local/bin/
. Effectively a persistentalias
command.__fail
prints a message and exits non-zero.__is_alpine
,__is_ubuntu
, and__is_archlinux
are added as simple commands for detecting the host platform.The
init-env
base target is carefully constructed to ONLY include things that will very rarely change, since a change at this layer would propagate a cache-invalidating through all derived targets.Utility Commands
Utility custom Earthly commands have been added:
ADD_C_COMPILER
,ADD_CXX_COMPILER
,ADD_SASL
, andADD_TLS
each install the platforms corresponding packages based on the values of--c_compiler
,--cxx_compiler
,--sasl
, and--tls
, respectively, for--purpose=build
and--purpose=test
. These infer the package names required of the container platform. Additionally, theADD_C_COMPILER
andADD_CXX_COMPILER
set the persistentCC
andCXX
environment variables, respectively.Each command accepts the same names as used by the corresponding CMake configuration settings, and these commands are therefore used to tweak the container environment for each configuration.
It is expected that additional commands will later be defined for additional configuration axes.