From 329bc5768828b27f3e785d48f40ffd7f3bdab784 Mon Sep 17 00:00:00 2001 From: Kevin Albertson Date: Tue, 4 Aug 2026 14:14:01 -0400 Subject: [PATCH 1/2] check uv for python sub-command --- .evergreen/install-build-tools.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.evergreen/install-build-tools.sh b/.evergreen/install-build-tools.sh index 60f70b7df..a57b5dd28 100755 --- a/.evergreen/install-build-tools.sh +++ b/.evergreen/install-build-tools.sh @@ -17,6 +17,15 @@ export_uv_tool_dirs() { export PATH UV_TOOL_DIR UV_TOOL_BIN_DIR UV_PYTHON_INSTALL_DIR } +# Returns 0 if system uv supports the `uv python` subcommand (added in uv 0.3.0). +uv_supports_python() { + command -v uv &>/dev/null || return 1 + uv python --help &>/dev/null || { + echo "system-provided uv does not support \`uv python\`: $(uv --version 2>&1)" >&2 + return 1 + } +} + install_build_tools() { export_uv_tool_dirs || return @@ -29,8 +38,8 @@ install_build_tools() { export UV_PYTHON="/opt/mongodbtoolchain/v4/bin/python3" fi - if ! command -v uv &>/dev/null; then - echo "missing system-provided uv binary: fallback to uv-installer.sh" >&2 + if ! uv_supports_python; then + echo "missing or unusable system-provided uv binary: fallback to uv-installer.sh" >&2 : "${EVG_DIR:="$(dirname "${BASH_SOURCE[0]}")"}" || return . "${EVG_DIR:?}/init.sh" || return From e09f1cbd4f4e49dbfea7cd0bf5061e74b956fdb0 Mon Sep 17 00:00:00 2001 From: Kevin Albertson Date: Tue, 4 Aug 2026 16:34:30 -0400 Subject: [PATCH 2/2] note workaround --- .evergreen/install-build-tools.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.evergreen/install-build-tools.sh b/.evergreen/install-build-tools.sh index a57b5dd28..9fd8b3ce8 100755 --- a/.evergreen/install-build-tools.sh +++ b/.evergreen/install-build-tools.sh @@ -18,6 +18,7 @@ export_uv_tool_dirs() { } # Returns 0 if system uv supports the `uv python` subcommand (added in uv 0.3.0). +# TODO(MONGOCRYPT-961) drop this workaround once macOS 11 is dropped (which has too-old uv) uv_supports_python() { command -v uv &>/dev/null || return 1 uv python --help &>/dev/null || {