Skip to content

Use uvx for CMake and Server Toolchain for Ninja #1428

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
merged 25 commits into from
Aug 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
8bc041e
Upgrade uv to 0.8.0
eramongodb Jul 21, 2025
c17ea5b
Add uv 0.8.0 checksum values
eramongodb Jul 21, 2025
b168edc
Update uv lockfile
eramongodb Jul 21, 2025
2914ac8
Use `uvx` for CMake and Server Toolchain for Ninja
eramongodb Jul 21, 2025
c976ce8
Consistently use CMAKE_BUILD_PARALLEL_LEVEL (/maxcpucount) for MSBuild
eramongodb Jul 21, 2025
fbd5644
Fix EnforceProcessCountAcrossBuilds typo
eramongodb Jul 22, 2025
ff55b13
Revert relocation of find_ccache_and_export_vars in install-c-driver.sh
eramongodb Jul 22, 2025
58722bd
Merge remote-tracking branch 'upstream/master' into HEAD
eramongodb Jul 24, 2025
aa9820b
Remove redundant canary
eramongodb Jul 24, 2025
25e90a5
RHEL still needs the LIB_DIR env var
eramongodb Jul 24, 2025
8b45944
Upgrade uv to 0.8.2
eramongodb Jul 24, 2025
4d6a643
Automatically patch uv-installer.sh with checksums
eramongodb Jul 24, 2025
f693cb9
Use `uv tool install` as intended with UV_TOOL_DIR
eramongodb Jul 24, 2025
c05d7b4
Consistently minimize CMake version check output
eramongodb Jul 24, 2025
271cf30
Move LIB_DIR and distro_id out of uninstall_check.sh
eramongodb Jul 25, 2025
ff5e933
Upgrade uv to 0.8.3
eramongodb Jul 25, 2025
7fa3c4a
Reduce complexity for Windows vs. non-Windows
eramongodb Jul 25, 2025
105d89e
Merge remote-tracking branch 'upstream/master' into cxx-uv-tools
eramongodb Jul 30, 2025
a075c1f
Fix uv tool install command for versioned CMake
eramongodb Aug 5, 2025
122296c
Fix call to uvx in UninstallCheck
eramongodb Aug 6, 2025
7687b65
Merge remote-tracking branch 'upstream/master' into HEAD
eramongodb Aug 8, 2025
1139db7
Add cmake to make_release dependencies instead of uvx
eramongodb Aug 8, 2025
5fac8cd
Add install-build-tools.sh to reduce duplication
eramongodb Aug 8, 2025
ad7b0ef
Merge remote-tracking branch 'upstream/master' into cxx-uv-tools
eramongodb Aug 8, 2025
95152e1
Upgrade uv to 0.8.6
eramongodb Aug 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .evergreen/config_generator/components/abi_stability.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from config_generator.components.funcs.install_c_driver import InstallCDriver
from config_generator.components.funcs.install_uv import InstallUV

from config_generator.etc.distros import find_large_distro
from config_generator.etc.function import Function, merge_defns
Expand Down Expand Up @@ -182,16 +183,21 @@ def task_groups():
EvgTaskGroup(
name=f'tg-{TAG}-{polyfill}-cxx{cxx_standard}',
max_hosts=-1,
setup_group_can_fail_task=True,
setup_task_can_fail_task=True,
setup_task=[
git_get_project(directory='mongo-cxx-driver'),
InstallUV.call(),
InstallCDriver.call(),
bash_exec(
command_type=EvgCommandType.SETUP,
env={
'cxx_standard': f'{cxx_standard}',
'polyfill': polyfill,
},
include_expansions_in_env=['distro_id'],
include_expansions_in_env=[
'distro_id',
'UV_INSTALL_DIR',
],
script='mongo-cxx-driver/.evergreen/scripts/abi-stability-setup.sh'
),
s3_put(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def tasks():
tags=[TAG, distro_name],
run_on=distro.name,
commands=[
InstallCDriver.call(),
InstallUV.call(),
InstallCDriver.call(),
Compile.call(build_type='Debug', vars={'ENABLE_TESTS': 'ON'}),
TestSearchIndexHelpers.call(),
],
Expand Down
23 changes: 11 additions & 12 deletions .evergreen/config_generator/components/cmake_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
# pylint: disable=line-too-long
# fmt: off
MATRIX = [
("min", [3, 15, 4]),
("max-v3", [3, 31, 7]),
("max", [4, 0, 1]),
# As-if `cmake~=<version>` (PEP 0440).
("min", "3.15.0"),
("max-v3", "3.0" ),
("max", "4.0.0" ),
]
# fmt: on

Expand All @@ -30,20 +31,20 @@ class CMakeCompat(Function):
command_type=EvgCommandType.TEST,
working_dir='mongo-cxx-driver',
include_expansions_in_env=[
'CMAKE_MAJOR_VERSION',
'CMAKE_MINOR_VERSION',
'CMAKE_PATCH_VERSION',
'CMAKE_VERSION',
'distro_id',
'INSTALL_C_DRIVER',
'UV_INSTALL_DIR',
],
script='.evergreen/scripts/cmake-compat.sh',
),
bash_exec(
command_type=EvgCommandType.TEST,
include_expansions_in_env=[
'CMAKE_MAJOR_VERSION',
'CMAKE_MINOR_VERSION',
'CMAKE_PATCH_VERSION',
'CMAKE_VERSION',
'distro_id',
'INSTALL_C_DRIVER',
'UV_INSTALL_DIR',
],
script='mongo-cxx-driver/.evergreen/scripts/cmake-compat-check.sh',
),
Expand All @@ -69,9 +70,7 @@ def tasks():
(InstallCDriver.call() if install_c_driver else FetchCDriverSource.call()),
CMakeCompat.call(
vars={
'CMAKE_MAJOR_VERSION': version[0],
'CMAKE_MINOR_VERSION': version[1],
'CMAKE_PATCH_VERSION': version[2],
'CMAKE_VERSION': version,
'INSTALL_C_DRIVER': int(install_c_driver),
},
),
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/config_generator/components/compile_only.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ def tasks():
commands = [expansions_update(updates=updates)] if updates else []
commands += [
Setup.call(),
InstallCDriver.call(),
InstallUV.call(),
InstallCDriver.call(),
Compile.call(
build_type=build_type,
compiler=compiler,
Expand Down
17 changes: 14 additions & 3 deletions .evergreen/config_generator/components/funcs/install_uv.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,31 @@ class InstallUV(Function):
set -o errexit
set -o pipefail

version="0.8.6"

if [[ ! -n "${MONGO_CXX_DRIVER_CACHE_DIR}" ]]; then
echo "MONGO_CXX_DRIVER_CACHE_DIR is not defined!" 1>&2
exit 1
fi

uv_install_dir="${MONGO_CXX_DRIVER_CACHE_DIR}/uv-0.5.14"
uv_install_dir="${MONGO_CXX_DRIVER_CACHE_DIR}/uv-$version"
mkdir -p "$uv_install_dir"

if ! command -v "$uv_install_dir/uv" 2>/dev/null; then
# Install if the binary is missing or the incorrect version.
if ! (command -v "$uv_install_dir/uv" >/dev/null && "$uv_install_dir/uv" --version 2>/dev/null | grep "$version"); then
script="$(mktemp)"
cp -f mongo-cxx-driver/.evergreen/scripts/uv-installer.sh "$script"
chmod +x "$script"
# Always patch the install script so it validates checksums.
(
. mongo-cxx-driver/.evergreen/scripts/patch-uv-installer.sh
patch_uv_installer "$script" "$version"
)
env \\
UV_INSTALL_DIR="$uv_install_dir" \\
UV_UNMANAGED_INSTALL=1 \\
INSTALLER_PRINT_VERBOSE=1 \\
mongo-cxx-driver/.evergreen/scripts/uv-installer.sh
"$script"
fi

PATH="$uv_install_dir:$PATH" command -V uv
Expand Down
32 changes: 2 additions & 30 deletions .evergreen/config_generator/components/funcs/setup.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,11 @@
from config_generator.etc.function import Function
from config_generator.etc.utils import bash_exec

from shrub.v3.evg_command import EvgCommandType, git_get_project
from shrub.v3.evg_command import git_get_project


class Setup(Function):
name = 'setup'
commands = [
bash_exec(
command_type=EvgCommandType.SETUP,
script='''\
set -o errexit
set -o pipefail
rm -rf "mongo-cxx-driver"
rm -fr "mongo-c-driver"
rm -fr mongod
rm -fr drivers-evergreen-tools
'''
),
git_get_project(directory='mongo-cxx-driver'),
bash_exec(
command_type=EvgCommandType.SETUP,
script='''\
set -o errexit
set -o pipefail
cc --version || true
c++ --version || true
gcc --version || true
g++ --version || true
clang --version || true
cmake --version || true
openssl version || true
'''
),
]
commands = git_get_project(directory='mongo-cxx-driver')


def functions():
Expand Down
1 change: 1 addition & 0 deletions .evergreen/config_generator/components/funcs/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Test(Function):
'TEST_WITH_VALGRIND',
'use_mongocryptd',
'USE_STATIC_LIBS',
'UV_INSTALL_DIR',
'VALGRIND_INSTALL_DIR',
],
working_dir='mongo-cxx-driver',
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/config_generator/components/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ def tasks():
commands += [
Setup.call(),
StartMongod.call(mongodb_version=mongodb_version, topology=topology),
InstallCDriver.call(vars=icd_vars),
InstallUV.call(),
InstallCDriver.call(vars=icd_vars),
Compile.call(polyfill=polyfill, vars=compile_vars),
FetchDET.call(),
RunKMSServers.call(),
Expand Down
4 changes: 3 additions & 1 deletion .evergreen/config_generator/components/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ class Lint(Function):
command_type=EvgCommandType.TEST,
working_dir='mongo-cxx-driver',
env={'DRYRUN': '1'},
script='${UV_INSTALL_DIR}/uv run --frozen etc/clang-format-all.sh',
script='''\
PATH="${UV_INSTALL_DIR}:$PATH" uv run --frozen etc/clang-format-all.sh
''',
)


Expand Down
6 changes: 3 additions & 3 deletions .evergreen/config_generator/components/sanitizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ def tasks():
test_vars = {
'TEST_WITH_CSFLE': 'ON',
'MONGOCXX_TEST_TOPOLOGY': topology,
'example_projects_cc': 'clang',
'example_projects_cxx': 'clang++',
'example_projects_cc': cc_compiler,
'example_projects_cxx': cxx_compiler,
}

if link_type == 'static':
Expand Down Expand Up @@ -96,8 +96,8 @@ def tasks():
commands += [
Setup.call(),
StartMongod.call(mongodb_version=mongodb_version, topology=topology),
InstallCDriver.call(),
InstallUV.call(),
InstallCDriver.call(),
Compile.call(vars=compile_vars),
FetchDET.call(),
RunKMSServers.call(),
Expand Down
2 changes: 2 additions & 0 deletions .evergreen/config_generator/components/scan_build.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from config_generator.components.funcs.fetch_c_driver_source import FetchCDriverSource
from config_generator.components.funcs.install_uv import InstallUV
from config_generator.components.funcs.setup import Setup

from config_generator.etc.distros import find_large_distro
Expand Down Expand Up @@ -121,6 +122,7 @@ def tasks():
commands=[
Setup.call(),
FetchCDriverSource.call(),
InstallUV.call(),
RunScanBuild.call(cxx_standard, polyfill),
UploadScanArtifacts.call(),
],
Expand Down
29 changes: 26 additions & 3 deletions .evergreen/config_generator/components/uninstall_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,34 @@ class UninstallCheck(Function):
commands = bash_exec(
command_type=EvgCommandType.TEST,
working_dir='mongo-cxx-driver',
include_expansions_in_env=['distro_id'],
script='''\
set -o errexit
set -o pipefail

PATH="${UV_INSTALL_DIR}:$PATH"

# lib vs. lib64 (i.e. RHEL).
if [[ "${distro_id}" == rhel* ]]; then
LIB_DIR="lib64"
else
LIB_DIR="lib"
fi

touch "build/install/$LIB_DIR/canary.txt"

ls -l "build/install/share/mongo-cxx-driver"

case "$OSTYPE" in
darwin*|linux*) .evergreen/scripts/uninstall_check.sh ;;
cygwin) cmd.exe /c ".evergreen\\\\scripts\\\\uninstall_check_windows.cmd" ;;
darwin*|linux*)
# Ninja generator.
uvx cmake --build build --target uninstall
env LIB_DIR="$LIB_DIR" .evergreen/scripts/uninstall_check.sh
;;
cygwin)
# Visual Studio generator.
uvx cmake --build build --config Debug --target uninstall
cmd.exe /c ".evergreen\\\\scripts\\\\uninstall_check_windows.cmd"
;;
esac
'''
)
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/config_generator/components/valgrind.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ def tasks():
commands += [
Setup.call(),
StartMongod.call(mongodb_version=mongodb_version, topology=topology),
InstallCDriver.call(vars=icd_vars),
InstallUV.call(),
InstallCDriver.call(vars=icd_vars),
Compile.call(compiler=compiler, vars=compile_vars),
FetchDET.call(),
RunKMSServers.call(),
Expand Down
Loading