diff --git a/etc/evergreen_yml_components/definitions.yml b/etc/evergreen_yml_components/definitions.yml index 17aeed36853..3f91f4a8b48 100644 --- a/etc/evergreen_yml_components/definitions.yml +++ b/etc/evergreen_yml_components/definitions.yml @@ -270,6 +270,8 @@ functions: display_name: "adjust venv" params: binary: bash + env: + use_python310: ${use_python310|} args: - "src/evergreen/functions/venv_adjust.sh" @@ -788,6 +790,8 @@ functions: display_name: "set up venv" params: binary: bash + env: + use_python310: ${use_python310|} args: - "src/evergreen/functions/venv_setup.sh" diff --git a/etc/evergreen_yml_components/variants/amazon/test_release.yml b/etc/evergreen_yml_components/variants/amazon/test_release.yml index b5e4280b428..de83ec146ae 100644 --- a/etc/evergreen_yml_components/variants/amazon/test_release.yml +++ b/etc/evergreen_yml_components/variants/amazon/test_release.yml @@ -11,6 +11,8 @@ buildvariants: run_on: - amazon2-latest-small expansions: + # TODO SERVER-119677: Remove use_python310 once Amazon2 sqlite is upgraded + use_python310: true test_flags: >- --excludeWithAnyTags=SERVER-34286,incompatible_with_amazon_linux,requires_external_data_source --modules=none @@ -63,6 +65,8 @@ buildvariants: - amazon2-latest-small tags: ["emergency_release"] expansions: + # TODO SERVER-119677: Remove use_python310 once Amazon2 sqlite is upgraded + use_python310: true additional_package_targets: >- archive-mongocryptd-stripped archive-mongocryptd-debug @@ -116,6 +120,8 @@ buildvariants: run_on: - amazon2-arm64-latest-m8g-xlarge expansions: + # TODO SERVER-119677: Remove use_python310 once Amazon2 sqlite is upgraded + use_python310: true test_flags: >- --excludeWithAnyTags=SERVER-34286,incompatible_with_amazon_linux,requires_external_data_source --modules=none @@ -168,6 +174,8 @@ buildvariants: - amazon2-arm64-latest-m8g-xlarge tags: ["emergency_release"] expansions: + # TODO SERVER-119677: Remove use_python310 once Amazon2 sqlite is upgraded + use_python310: true additional_package_targets: >- archive-mongocryptd-stripped archive-mongocryptd-debug diff --git a/evergreen/prelude_python.sh b/evergreen/prelude_python.sh index 200fd7f0269..0d85cbc7630 100644 --- a/evergreen/prelude_python.sh +++ b/evergreen/prelude_python.sh @@ -5,8 +5,18 @@ elif [ "$(uname)" = "Darwin" ]; then python='/Library/Frameworks/Python.Framework/Versions/3.13/bin/python3' echo "Executing on mac, setting python to ${python}" else + # Check if Python 3.10 is requested via Evergreen parameter + # TODO SERVER-119677: Remove use_python310 parameter once Amazon2 sqlite is upgraded + if [ "${use_python310}" = "true" ]; then + if [ -f /opt/mongodbtoolchain/v4/bin/python3 ]; then + python="/opt/mongodbtoolchain/v4/bin/python3" + echo "Using Python 3.10 from v4 toolchain (use_python310=true): ${python}" + else + echo "ERROR: use_python310 is set but Python 3 is not available at /opt/mongodbtoolchain/v4/bin/python3" + return 1 + fi # Check if v5 toolchain exists - it requires Python 3.13 - if [ -d /opt/mongodbtoolchain/v5 ]; then + elif [ -d /opt/mongodbtoolchain/v5 ]; then if [ -f /opt/mongodbtoolchain/v5/bin/python3.13 ]; then python="/opt/mongodbtoolchain/v5/bin/python3.13" echo "Found python 3.13 in v5 toolchain, setting python to ${python}"