Skip to content

Commit ecdb3a2

Browse files
committed
clean up bin dir handling
1 parent 03a7e91 commit ecdb3a2

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

.evergreen/scripts/configure-env.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ CARGO_HOME=${CARGO_HOME:-${DRIVERS_TOOLS}/.cargo}
1717
UV_TOOL_DIR=$PROJECT_DIRECTORY/.local/uv/tools
1818
UV_CACHE_DIR=$PROJECT_DIRECTORY/.local/uv/cache
1919

20-
20+
echo "HI: $PYMONGO_BIN_DIR, $CI"
21+
exit 1
2122
# Python has cygwin path problems on Windows. Detect prospective mongo-orchestration home directory
2223
if [ "Windows_NT" = "${OS:-}" ]; then # Magic variable in cygwin
2324
DRIVERS_TOOLS=$(cygpath -m $DRIVERS_TOOLS)
@@ -40,6 +41,17 @@ MONGO_ORCHESTRATION_HOME="$DRIVERS_TOOLS/.evergreen/orchestration"
4041
DRIVERS_TOOLS_BINARIES="$DRIVERS_TOOLS/.bin"
4142
MONGODB_BINARIES="$DRIVERS_TOOLS/mongodb/bin"
4243

44+
# On Evergreen jobs, "CI" will be set, and we don't want to write to $HOME.
45+
if [ "${CI:-}" == "true" ]; then
46+
PYMONGO_BIN_DIR=${DRIVERS_TOOLS_BINARIES:-}
47+
# We want to use a path that's already on PATH on spawn hosts.
48+
else
49+
PYMONGO_BIN_DIR=$HOME/cli_bin
50+
fi
51+
52+
53+
PATH="$MONGODB_BINARIES:$DRIVERS_TOOLS_BINARIES:$PYMONGO_BIN_DIR:$PATH"
54+
4355
cat <<EOT > "$SCRIPT_DIR"/env.sh
4456
export PROJECT_DIRECTORY="$PROJECT_DIRECTORY"
4557
export CURRENT_VERSION="$CURRENT_VERSION"
@@ -70,7 +82,7 @@ export PYMONGO_BIN_DIR="$PYMONGO_BIN_DIR"
7082
export UV_TOOL_DIR="$UV_TOOL_DIR"
7183
export UV_CACHE_DIR="$UV_CACHE_DIR"
7284
export UV_TOOL_BIN_DIR="$DRIVERS_TOOLS_BINARIES"
73-
export PATH="$MONGODB_BINARIES:$DRIVERS_TOOLS_BINARIES:$PATH"
85+
export PATH="$PATH"
7486
# shellcheck disable=SC2154
7587
export PROJECT="${project:-mongo-python-driver}"
7688
export PIP_QUIET=1

.evergreen/scripts/install-dependencies.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -eu
44

5-
_BIN_DIR=${DRIVERS_TOOLS_BINARIES:-}
5+
_BIN_DIR=${PYMONGO_BIN_DIR:-}
66

77
# Helper function to pip install a dependency using a temporary python env.
88
function _pip_install() {

0 commit comments

Comments
 (0)