From 24d271e539653e019d36f2b17a917945542286b9 Mon Sep 17 00:00:00 2001 From: Zack Winter <3457246+zackwintermdb@users.noreply.github.com> Date: Tue, 9 Jan 2024 17:59:13 -0800 Subject: [PATCH] SERVER-84658 Switch prelude from using /tmp/ to evergreen-specific /tmp (#17932) GitOrigin-RevId: 7a242028c9e1b21292f4ca777609285e292432f8 --- evergreen/prelude_venv.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/evergreen/prelude_venv.sh b/evergreen/prelude_venv.sh index 5b7b1272a68..4c87c194a98 100644 --- a/evergreen/prelude_venv.sh +++ b/evergreen/prelude_venv.sh @@ -3,15 +3,17 @@ function activate_venv { if [ -d "${workdir}/venv" ]; then # It's possible for activate to fail without stderr; as a result the cat operation (below) could fail. # To mitigate this, create an empty error log. - touch /tmp/activate_error.log + # We're relying on the evergreen provided tmp directory here because Amazon Linux 2023 has an issue + # writing to /tmp/ on startup. + touch $TMPDIR/activate_error.log if [ "Windows_NT" = "$OS" ]; then # Need to quote the path on Windows to preserve the separator. - . "${workdir}/venv/Scripts/activate" 2> /tmp/activate_error.log + . "${workdir}/venv/Scripts/activate" 2> $TMPDIR/activate_error.log else - . ${workdir}/venv/bin/activate 2> /tmp/activate_error.log + . ${workdir}/venv/bin/activate 2> $TMPDIR/activate_error.log fi if [ $? -ne 0 ]; then - echo "Failed to activate virtualenv: $(cat /tmp/activate_error.log)" + echo "Failed to activate virtualenv: $(cat $TMPDIR/activate_error.log)" exit 1 fi python=python