Skip to content

Commit edebff5

Browse files
authored
use script from drivers evergreen tools to find python (#940)
To fix observed task failure
1 parent 5b381e9 commit edebff5

File tree

2 files changed

+39
-3
lines changed

2 files changed

+39
-3
lines changed

.evergreen/config.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,40 @@ functions:
1414
rm -rf ~/.aws ~/.notary_env.sh
1515
exit 0
1616
17+
"fetch drivers-evergreen-tools":
18+
- command: subprocess.exec
19+
type: setup
20+
params:
21+
binary: bash
22+
args:
23+
- -c
24+
- |
25+
if [[ ! -d drivers-evergreen-tools ]]; then
26+
git clone --depth=1 https://github.com/mongodb-labs/drivers-evergreen-tools.git
27+
fi
28+
- command: subprocess.exec
29+
type: setup
30+
params:
31+
binary: bash
32+
working_dir: drivers-evergreen-tools
33+
args:
34+
- -c
35+
- find .evergreen -type f -name "*.sh" -exec chmod +rx "{}" \;
36+
- command: subprocess.exec
37+
type: setup
38+
params:
39+
binary: bash
40+
args:
41+
- -c
42+
- |
43+
set -o errexit
44+
. drivers-evergreen-tools/.evergreen/find-python3.sh
45+
echo "PYTHON3_BINARY: $(find_python3)" >|python3_binary.yml
46+
- command: expansions.update
47+
type: setup
48+
params:
49+
file: python3_binary.yml
50+
1751
"fetch source":
1852
- command: git.get_project
1953
params: {directory: libmongocrypt}
@@ -89,7 +123,7 @@ functions:
89123
shell: bash
90124
script: |
91125
env "WORKDIR=${workdir}" \
92-
"PYTHON=${python|}" \
126+
"PYTHON=${PYTHON3_BINARY|}" \
93127
"HAS_PACKAGES=${has_packages|false}" \
94128
"PACKAGER_DISTRO=${packager_distro}" \
95129
"PACKAGER_ARCH=${packager_arch}" \
@@ -360,6 +394,7 @@ tasks:
360394
- func: "fetch source"
361395
- func: "build and test"
362396
- func: "tar and upload libmongocrypt libraries"
397+
- func: "fetch drivers-evergreen-tools" # Set PYTHON3_BINARY.
363398
- func: "create packages and repos"
364399
- func: "upload packages and repos"
365400

@@ -1155,7 +1190,6 @@ buildvariants:
11551190
has_packages: true
11561191
packager_distro: debian12
11571192
packager_arch: x86_64
1158-
python: python3
11591193
tasks:
11601194
- build-and-test-and-upload
11611195
- name: publish-packages

.evergreen/create-packages-and-repos.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ if test -d "$WORKDIR/venv"; then
2222
fi
2323
python=python
2424
else
25-
python="${PYTHON:-/opt/mongodbtoolchain/v3/bin/python3}"
25+
# Require PYTHON be set:
26+
: "${PYTHON:?}"
27+
python="${PYTHON}"
2628
fi
2729

2830
export PYTHONPATH

0 commit comments

Comments
 (0)