From bea6f12bcd25ed6ea15261d2af7cd5d9041f4d50 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 21 Jan 2025 09:50:12 -0600 Subject: [PATCH 01/13] PYTHON-5050 Fix installation of just --- .evergreen/install-dependencies.sh | 12 ----------- .evergreen/run-azurekms-test.sh | 13 ++++++++---- .evergreen/run-gcpkms-test.sh | 11 ++++++++--- .evergreen/scripts/install-dependencies.sh | 4 +--- .evergreen/scripts/prepare-resources.sh | 23 ++++++++++++++++------ .evergreen/scripts/setup-dev-env.sh | 2 ++ 6 files changed, 37 insertions(+), 28 deletions(-) diff --git a/.evergreen/install-dependencies.sh b/.evergreen/install-dependencies.sh index 8773fa2c6d..bf3619a459 100755 --- a/.evergreen/install-dependencies.sh +++ b/.evergreen/install-dependencies.sh @@ -1,18 +1,6 @@ #!/bin/bash set -eu -# Copy PyMongo's test certificates over driver-evergreen-tools' -cp ${PROJECT_DIRECTORY}/test/certificates/* ${DRIVERS_TOOLS}/.evergreen/x509gen/ - -# Replace MongoOrchestration's client certificate. -cp ${PROJECT_DIRECTORY}/test/certificates/client.pem ${MONGO_ORCHESTRATION_HOME}/lib/client.pem - -if [ -w /etc/hosts ]; then - SUDO="" -else - SUDO="sudo" -fi - # Install just. # On Evergreen jobs, "CI" will be set, and we don't want to write to $HOME. if [ "${CI:-}" == "true" ]; then diff --git a/.evergreen/run-azurekms-test.sh b/.evergreen/run-azurekms-test.sh index d5c332fa8d..28a84a52e2 100755 --- a/.evergreen/run-azurekms-test.sh +++ b/.evergreen/run-azurekms-test.sh @@ -8,17 +8,22 @@ export AZUREKMS_VMNAME=${AZUREKMS_VMNAME} export AZUREKMS_PRIVATEKEYPATH=/tmp/testazurekms_privatekey export LIBMONGOCRYPT_URL=https://s3.amazonaws.com/mciuploads/libmongocrypt/debian11/master/latest/libmongocrypt.tar.gz SKIP_SERVERS=1 bash $HERE/setup-encryption.sh -tar czf /tmp/mongo-python-driver.tgz . +# Set up the remote files to test. +git add . +git commit -m "add files" || true +git archive -o /tmp/mongo-python-driver.tar HEAD +tar -rf /tmp/mongo-python-driver.tar libmongocrypt +gzip -f /tmp/mongo-python-driver.tar # shellcheck disable=SC2088 -AZUREKMS_SRC="/tmp/mongo-python-driver.tgz" AZUREKMS_DST="~/" \ +AZUREKMS_SRC="/tmp/mongo-python-driver.tar.gz" AZUREKMS_DST="~/" \ $DRIVERS_TOOLS/.evergreen/csfle/azurekms/copy-file.sh echo "Copying files ... end" echo "Untarring file ... begin" -AZUREKMS_CMD="tar xf mongo-python-driver.tgz" \ +AZUREKMS_CMD="tar xf mongo-python-driver.tar.gz" \ $DRIVERS_TOOLS/.evergreen/csfle/azurekms/run-command.sh echo "Untarring file ... end" echo "Running test ... begin" -AZUREKMS_CMD="KEY_NAME=\"$AZUREKMS_KEYNAME\" KEY_VAULT_ENDPOINT=\"$AZUREKMS_KEYVAULTENDPOINT\" SUCCESS=true TEST_FLE_AZURE_AUTO=1 ./.evergreen/just.sh test-eg" \ +AZUREKMS_CMD="KEY_NAME=\"$AZUREKMS_KEYNAME\" KEY_VAULT_ENDPOINT=\"$AZUREKMS_KEYVAULTENDPOINT\" SUCCESS=true TEST_FLE_AZURE_AUTO=1 bash ./.evergreen/just.sh test-eg" \ $DRIVERS_TOOLS/.evergreen/csfle/azurekms/run-command.sh echo "Running test ... end" bash $HERE/teardown-encryption.sh diff --git a/.evergreen/run-gcpkms-test.sh b/.evergreen/run-gcpkms-test.sh index 4c953584b2..37ec2bfe56 100755 --- a/.evergreen/run-gcpkms-test.sh +++ b/.evergreen/run-gcpkms-test.sh @@ -10,11 +10,16 @@ export GCPKMS_ZONE=${GCPKMS_ZONE} export GCPKMS_INSTANCENAME=${GCPKMS_INSTANCENAME} export LIBMONGOCRYPT_URL=https://s3.amazonaws.com/mciuploads/libmongocrypt/debian11/master/latest/libmongocrypt.tar.gz SKIP_SERVERS=1 bash $HERE/setup-encryption.sh -tar czf /tmp/mongo-python-driver.tgz . -GCPKMS_SRC=/tmp/mongo-python-driver.tgz GCPKMS_DST=$GCPKMS_INSTANCENAME: $DRIVERS_TOOLS/.evergreen/csfle/gcpkms/copy-file.sh +# Set up the remote files to test. +git add . +git commit -m "add files" || true +git archive -o /tmp/mongo-python-driver.tar HEAD +tar -rf /tmp/mongo-python-driver.tar libmongocrypt +gzip -f /tmp/mongo-python-driver.tar +GCPKMS_SRC=/tmp/mongo-python-driver.tar.gz GCPKMS_DST=$GCPKMS_INSTANCENAME: $DRIVERS_TOOLS/.evergreen/csfle/gcpkms/copy-file.sh echo "Copying files ... end" echo "Untarring file ... begin" -GCPKMS_CMD="tar xf mongo-python-driver.tgz" $DRIVERS_TOOLS/.evergreen/csfle/gcpkms/run-command.sh +GCPKMS_CMD="tar xf mongo-python-driver.tar.gz" $DRIVERS_TOOLS/.evergreen/csfle/gcpkms/run-command.sh echo "Untarring file ... end" echo "Running test ... begin" GCPKMS_CMD="SUCCESS=true TEST_FLE_GCP_AUTO=1 ./.evergreen/just.sh test-eg" $DRIVERS_TOOLS/.evergreen/csfle/gcpkms/run-command.sh diff --git a/.evergreen/scripts/install-dependencies.sh b/.evergreen/scripts/install-dependencies.sh index bbbfc745ec..ff0e91f5c2 100755 --- a/.evergreen/scripts/install-dependencies.sh +++ b/.evergreen/scripts/install-dependencies.sh @@ -1,6 +1,4 @@ #!/bin/bash set -eu -file="$PROJECT_DIRECTORY/.evergreen/install-dependencies.sh" -# Don't use ${file} syntax here because evergreen treats it as an empty expansion. -[ -f "$file" ] && bash "$file" || echo "$file not available, skipping" +bash "$PROJECT_DIRECTORY/.evergreen/install-dependencies.sh" diff --git a/.evergreen/scripts/prepare-resources.sh b/.evergreen/scripts/prepare-resources.sh index 3cfa2c4efd..da869e7055 100755 --- a/.evergreen/scripts/prepare-resources.sh +++ b/.evergreen/scripts/prepare-resources.sh @@ -6,12 +6,23 @@ pushd $HERE . env.sh rm -rf $DRIVERS_TOOLS -if [ "$PROJECT" = "drivers-tools" ]; then - # If this was a patch build, doing a fresh clone would not actually test the patch - cp -R $PROJECT_DIRECTORY/ $DRIVERS_TOOLS -else - git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git $DRIVERS_TOOLS -fi +git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git $DRIVERS_TOOLS echo "{ \"releases\": { \"default\": \"$MONGODB_BINARIES\" }}" >$MONGO_ORCHESTRATION_HOME/orchestration.config popd + +# Copy PyMongo's test certificates over driver-evergreen-tools' +cp ${PROJECT_DIRECTORY}/test/certificates/* ${DRIVERS_TOOLS}/.evergreen/x509gen/ + +# Replace MongoOrchestration's client certificate. +cp ${PROJECT_DIRECTORY}/test/certificates/client.pem ${MONGO_ORCHESTRATION_HOME}/lib/client.pem + +if [ -w /etc/hosts ]; then + SUDO="" +else + SUDO="sudo" +fi + +# Add 'server' and 'hostname_not_in_cert' as a hostnames +echo "127.0.0.1 server" | $SUDO tee -a /etc/hosts +echo "127.0.0.1 hostname_not_in_cert" | $SUDO tee -a /etc/hosts diff --git a/.evergreen/scripts/setup-dev-env.sh b/.evergreen/scripts/setup-dev-env.sh index 7042871942..bfe0bc5b9a 100755 --- a/.evergreen/scripts/setup-dev-env.sh +++ b/.evergreen/scripts/setup-dev-env.sh @@ -17,6 +17,8 @@ else BIN_DIR=.venv/bin fi +. $HERE/install-dependencies.sh + # Ensure there is a python venv. if [ ! -d $BIN_DIR ]; then . .evergreen/utils.sh From 563c74d84ab65dec8fec116fa427f9e7a7e23ccc Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 21 Jan 2025 09:54:44 -0600 Subject: [PATCH 02/13] update install-deps --- .evergreen/install-dependencies.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.evergreen/install-dependencies.sh b/.evergreen/install-dependencies.sh index bf3619a459..b22ff31c1b 100755 --- a/.evergreen/install-dependencies.sh +++ b/.evergreen/install-dependencies.sh @@ -27,7 +27,3 @@ if [ ! -f $BIN_DIR/just ]; then fi } fi - -# Add 'server' and 'hostname_not_in_cert' as a hostnames -echo "127.0.0.1 server" | $SUDO tee -a /etc/hosts -echo "127.0.0.1 hostname_not_in_cert" | $SUDO tee -a /etc/hosts From 2bd633d2fbc12b8d56587bbf97d732b79ce138c9 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 21 Jan 2025 10:00:44 -0600 Subject: [PATCH 03/13] fix install-deps --- .evergreen/install-dependencies.sh | 2 +- .evergreen/scripts/setup-dev-env.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.evergreen/install-dependencies.sh b/.evergreen/install-dependencies.sh index b22ff31c1b..49ed40fa88 100755 --- a/.evergreen/install-dependencies.sh +++ b/.evergreen/install-dependencies.sh @@ -4,7 +4,7 @@ set -eu # Install just. # On Evergreen jobs, "CI" will be set, and we don't want to write to $HOME. if [ "${CI:-}" == "true" ]; then - BIN_DIR=$DRIVERS_TOOLS_BINARIES + BIN_DIR=${DRIVERS_TOOLS_BINARIES:-} else BIN_DIR=$HOME/.local/bin fi diff --git a/.evergreen/scripts/setup-dev-env.sh b/.evergreen/scripts/setup-dev-env.sh index bfe0bc5b9a..f87bb124a5 100755 --- a/.evergreen/scripts/setup-dev-env.sh +++ b/.evergreen/scripts/setup-dev-env.sh @@ -17,7 +17,7 @@ else BIN_DIR=.venv/bin fi -. $HERE/install-dependencies.sh +. $HERE/../install-dependencies.sh # Ensure there is a python venv. if [ ! -d $BIN_DIR ]; then From e95ca499ce07764234d22b0222fc4bc3f24fff59 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 21 Jan 2025 10:02:01 -0600 Subject: [PATCH 04/13] fix install-deps --- .evergreen/install-dependencies.sh | 29 ---------------------- .evergreen/scripts/install-dependencies.sh | 28 ++++++++++++++++++++- .evergreen/scripts/setup-dev-env.sh | 2 +- 3 files changed, 28 insertions(+), 31 deletions(-) delete mode 100755 .evergreen/install-dependencies.sh diff --git a/.evergreen/install-dependencies.sh b/.evergreen/install-dependencies.sh deleted file mode 100755 index 49ed40fa88..0000000000 --- a/.evergreen/install-dependencies.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -set -eu - -# Install just. -# On Evergreen jobs, "CI" will be set, and we don't want to write to $HOME. -if [ "${CI:-}" == "true" ]; then - BIN_DIR=${DRIVERS_TOOLS_BINARIES:-} -else - BIN_DIR=$HOME/.local/bin -fi -if [ ! -f $BIN_DIR/just ]; then - if [ "Windows_NT" = "${OS:-}" ]; then - TARGET="--target x86_64-pc-windows-msvc" - else - TARGET="" - fi - curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- $TARGET --to "$BIN_DIR" || { - # CARGO_HOME is defined in configure-env.sh - export CARGO_HOME=${CARGO_HOME:-$HOME/.cargo/} - export RUSTUP_HOME="${CARGO_HOME}/.rustup" - . ${DRIVERS_TOOLS}/.evergreen/install-rust.sh - cargo install just - if [ "Windows_NT" = "${OS:-}" ]; then - mv $CARGO_HOME/just.exe $BIN_DIR/just - else - mv $CARGO_HOME/just $BIN_DIR - fi - } -fi diff --git a/.evergreen/scripts/install-dependencies.sh b/.evergreen/scripts/install-dependencies.sh index ff0e91f5c2..9c5f3c13ad 100755 --- a/.evergreen/scripts/install-dependencies.sh +++ b/.evergreen/scripts/install-dependencies.sh @@ -1,4 +1,30 @@ #!/bin/bash set -eu -bash "$PROJECT_DIRECTORY/.evergreen/install-dependencies.sh" + +# Install just. +# On Evergreen jobs, "CI" will be set, and we don't want to write to $HOME. +if [ "${CI:-}" == "true" ]; then + BIN_DIR=${DRIVERS_TOOLS_BINARIES:-} +else + BIN_DIR=$HOME/.local/bin +fi +if [ ! -f $BIN_DIR/just ]; then + if [ "Windows_NT" = "${OS:-}" ]; then + TARGET="--target x86_64-pc-windows-msvc" + else + TARGET="" + fi + curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- $TARGET --to "$BIN_DIR" || { + # CARGO_HOME is defined in configure-env.sh + export CARGO_HOME=${CARGO_HOME:-$HOME/.cargo/} + export RUSTUP_HOME="${CARGO_HOME}/.rustup" + . ${DRIVERS_TOOLS}/.evergreen/install-rust.sh + cargo install just + if [ "Windows_NT" = "${OS:-}" ]; then + mv $CARGO_HOME/just.exe $BIN_DIR/just + else + mv $CARGO_HOME/just $BIN_DIR + fi + } +fi diff --git a/.evergreen/scripts/setup-dev-env.sh b/.evergreen/scripts/setup-dev-env.sh index f87bb124a5..bfe0bc5b9a 100755 --- a/.evergreen/scripts/setup-dev-env.sh +++ b/.evergreen/scripts/setup-dev-env.sh @@ -17,7 +17,7 @@ else BIN_DIR=.venv/bin fi -. $HERE/../install-dependencies.sh +. $HERE/install-dependencies.sh # Ensure there is a python venv. if [ ! -d $BIN_DIR ]; then From 5a82fcf4e912ec7d970bced7aa280ef0c9227c81 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 21 Jan 2025 10:17:18 -0600 Subject: [PATCH 05/13] use bash instead --- .evergreen/scripts/setup-dev-env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.evergreen/scripts/setup-dev-env.sh b/.evergreen/scripts/setup-dev-env.sh index bfe0bc5b9a..81b9858a9a 100755 --- a/.evergreen/scripts/setup-dev-env.sh +++ b/.evergreen/scripts/setup-dev-env.sh @@ -17,7 +17,7 @@ else BIN_DIR=.venv/bin fi -. $HERE/install-dependencies.sh +bash $HERE/install-dependencies.sh # Ensure there is a python venv. if [ ! -d $BIN_DIR ]; then From e39170e4fb7f5659d7224a125abf20aefb6a7304 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 21 Jan 2025 10:28:58 -0600 Subject: [PATCH 06/13] fix install-deps --- .evergreen/scripts/install-dependencies.sh | 15 ++++++++------- .evergreen/scripts/setup-dev-env.sh | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.evergreen/scripts/install-dependencies.sh b/.evergreen/scripts/install-dependencies.sh index 9c5f3c13ad..e22733014e 100755 --- a/.evergreen/scripts/install-dependencies.sh +++ b/.evergreen/scripts/install-dependencies.sh @@ -5,26 +5,27 @@ set -eu # Install just. # On Evergreen jobs, "CI" will be set, and we don't want to write to $HOME. if [ "${CI:-}" == "true" ]; then - BIN_DIR=${DRIVERS_TOOLS_BINARIES:-} + _BIN_DIR=${DRIVERS_TOOLS_BINARIES:-} else - BIN_DIR=$HOME/.local/bin + _BIN_DIR=$HOME/.local/bin fi if [ ! -f $BIN_DIR/just ]; then if [ "Windows_NT" = "${OS:-}" ]; then - TARGET="--target x86_64-pc-windows-msvc" + _TARGET="--target x86_64-pc-windows-msvc" else - TARGET="" + _TARGET="" fi - curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- $TARGET --to "$BIN_DIR" || { + curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- $_TARGET --to "$_BIN_DIR" || { # CARGO_HOME is defined in configure-env.sh export CARGO_HOME=${CARGO_HOME:-$HOME/.cargo/} export RUSTUP_HOME="${CARGO_HOME}/.rustup" . ${DRIVERS_TOOLS}/.evergreen/install-rust.sh cargo install just if [ "Windows_NT" = "${OS:-}" ]; then - mv $CARGO_HOME/just.exe $BIN_DIR/just + mv $CARGO_HOME/just.exe $_BIN_DIR/just else - mv $CARGO_HOME/just $BIN_DIR + mv $CARGO_HOME/just $_BIN_DIR fi + export PATH="$_BIN_DIR:$PATH" } fi diff --git a/.evergreen/scripts/setup-dev-env.sh b/.evergreen/scripts/setup-dev-env.sh index 81b9858a9a..bfe0bc5b9a 100755 --- a/.evergreen/scripts/setup-dev-env.sh +++ b/.evergreen/scripts/setup-dev-env.sh @@ -17,7 +17,7 @@ else BIN_DIR=.venv/bin fi -bash $HERE/install-dependencies.sh +. $HERE/install-dependencies.sh # Ensure there is a python venv. if [ ! -d $BIN_DIR ]; then From a342c7f785d8df0e5ccdb04e6ff3de0bb38e170f Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 21 Jan 2025 12:36:42 -0600 Subject: [PATCH 07/13] fix install-deps --- .evergreen/scripts/install-dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.evergreen/scripts/install-dependencies.sh b/.evergreen/scripts/install-dependencies.sh index e22733014e..a6a9ee7936 100755 --- a/.evergreen/scripts/install-dependencies.sh +++ b/.evergreen/scripts/install-dependencies.sh @@ -9,7 +9,7 @@ if [ "${CI:-}" == "true" ]; then else _BIN_DIR=$HOME/.local/bin fi -if [ ! -f $BIN_DIR/just ]; then +if [ ! -f $_BIN_DIR/just ]; then if [ "Windows_NT" = "${OS:-}" ]; then _TARGET="--target x86_64-pc-windows-msvc" else From 6b4fc2fcd89c82775adbbd3c1878b9f9389b8e66 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 21 Jan 2025 12:44:06 -0600 Subject: [PATCH 08/13] fix install-deps --- .evergreen/scripts/install-dependencies.sh | 40 +++++++++++++--------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/.evergreen/scripts/install-dependencies.sh b/.evergreen/scripts/install-dependencies.sh index a6a9ee7936..f73b9d7457 100755 --- a/.evergreen/scripts/install-dependencies.sh +++ b/.evergreen/scripts/install-dependencies.sh @@ -9,23 +9,29 @@ if [ "${CI:-}" == "true" ]; then else _BIN_DIR=$HOME/.local/bin fi -if [ ! -f $_BIN_DIR/just ]; then - if [ "Windows_NT" = "${OS:-}" ]; then - _TARGET="--target x86_64-pc-windows-msvc" - else - _TARGET="" - fi + + +function _pip_install() { + _HERE=$(dirname ${BASH_SOURCE:-$0}) + . $_HERE/utils.sh + _VENV_PATH=$(mktemp -d) + echo "Installing $2 using pip..." + createvirtualenv "$(find_python3)" $_VENV_PATH + python -m pip install $1 + ln -s "$(which $2)" $_BIN_DIR/$2 + echo "Installing $2 using pip... done." +} + + +# Ensure just is installed. +if ! command -v just 2>/dev/null; then + # On most systems we can install directly. + echo "Installing just..." curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- $_TARGET --to "$_BIN_DIR" || { - # CARGO_HOME is defined in configure-env.sh - export CARGO_HOME=${CARGO_HOME:-$HOME/.cargo/} - export RUSTUP_HOME="${CARGO_HOME}/.rustup" - . ${DRIVERS_TOOLS}/.evergreen/install-rust.sh - cargo install just - if [ "Windows_NT" = "${OS:-}" ]; then - mv $CARGO_HOME/just.exe $_BIN_DIR/just - else - mv $CARGO_HOME/just $_BIN_DIR - fi - export PATH="$_BIN_DIR:$PATH" + _pip_install rust-just just } + if ! command -v just 2>/dev/null; then + export PATH="$PATH:$_BIN_DIR" + fi + echo "Installing just... done." fi From f718d6d48c5b891729aadae93ee506c8740ca0ca Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 21 Jan 2025 12:46:50 -0600 Subject: [PATCH 09/13] fix install-deps --- .evergreen/scripts/install-dependencies.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.evergreen/scripts/install-dependencies.sh b/.evergreen/scripts/install-dependencies.sh index f73b9d7457..0448d9704b 100755 --- a/.evergreen/scripts/install-dependencies.sh +++ b/.evergreen/scripts/install-dependencies.sh @@ -26,6 +26,10 @@ function _pip_install() { # Ensure just is installed. if ! command -v just 2>/dev/null; then # On most systems we can install directly. + _TARGET="" + if [ "Windows_NT" = "${OS:-}" ]; then + TARGET="--target x86_64-pc-windows-msvc" + fi echo "Installing just..." curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- $_TARGET --to "$_BIN_DIR" || { _pip_install rust-just just From d1dc9450b7a19839e0ae41146601bb9050b13a89 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 21 Jan 2025 12:56:17 -0600 Subject: [PATCH 10/13] fix install-deps --- .evergreen/scripts/install-dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.evergreen/scripts/install-dependencies.sh b/.evergreen/scripts/install-dependencies.sh index 0448d9704b..03809b29b7 100755 --- a/.evergreen/scripts/install-dependencies.sh +++ b/.evergreen/scripts/install-dependencies.sh @@ -13,7 +13,7 @@ fi function _pip_install() { _HERE=$(dirname ${BASH_SOURCE:-$0}) - . $_HERE/utils.sh + . $_HERE/../utils.sh _VENV_PATH=$(mktemp -d) echo "Installing $2 using pip..." createvirtualenv "$(find_python3)" $_VENV_PATH From 4d6417b3d7b7ecd6cbf5f90cf65ac2059b1695c6 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 21 Jan 2025 13:02:09 -0600 Subject: [PATCH 11/13] fix install-deps --- .evergreen/scripts/install-dependencies.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.evergreen/scripts/install-dependencies.sh b/.evergreen/scripts/install-dependencies.sh index 03809b29b7..d0f08e04a0 100755 --- a/.evergreen/scripts/install-dependencies.sh +++ b/.evergreen/scripts/install-dependencies.sh @@ -31,6 +31,7 @@ if ! command -v just 2>/dev/null; then TARGET="--target x86_64-pc-windows-msvc" fi echo "Installing just..." + mkdir -p "$_BIN_DIR" 2>/dev/null || true curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- $_TARGET --to "$_BIN_DIR" || { _pip_install rust-just just } From feee80d0ed7fc0b103324c5b4614ba15a1a53b73 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 21 Jan 2025 13:20:40 -0600 Subject: [PATCH 12/13] fix windows install --- .evergreen/scripts/install-dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.evergreen/scripts/install-dependencies.sh b/.evergreen/scripts/install-dependencies.sh index d0f08e04a0..b34cc0197c 100755 --- a/.evergreen/scripts/install-dependencies.sh +++ b/.evergreen/scripts/install-dependencies.sh @@ -28,7 +28,7 @@ if ! command -v just 2>/dev/null; then # On most systems we can install directly. _TARGET="" if [ "Windows_NT" = "${OS:-}" ]; then - TARGET="--target x86_64-pc-windows-msvc" + _TARGET="--target x86_64-pc-windows-msvc" fi echo "Installing just..." mkdir -p "$_BIN_DIR" 2>/dev/null || true From 00e2b279991d0486453b381f48ff0cfeb9f71b31 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 21 Jan 2025 13:22:54 -0600 Subject: [PATCH 13/13] cleanup --- .evergreen/scripts/install-dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.evergreen/scripts/install-dependencies.sh b/.evergreen/scripts/install-dependencies.sh index b34cc0197c..2b127889aa 100755 --- a/.evergreen/scripts/install-dependencies.sh +++ b/.evergreen/scripts/install-dependencies.sh @@ -2,7 +2,6 @@ set -eu -# Install just. # On Evergreen jobs, "CI" will be set, and we don't want to write to $HOME. if [ "${CI:-}" == "true" ]; then _BIN_DIR=${DRIVERS_TOOLS_BINARIES:-} @@ -11,6 +10,7 @@ else fi +# Helper function to pip install a dependency using a temporary python env. function _pip_install() { _HERE=$(dirname ${BASH_SOURCE:-$0}) . $_HERE/../utils.sh