This is an automated email from the ASF dual-hosted git repository.
joemcdonnell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
The following commit(s) were added to refs/heads/master by this push:
new 152c7ef33 IMPALA-12242: Fix failover case in
bin/cmake_aux/create_py3_virtualenv.sh
152c7ef33 is described below
commit 152c7ef33ff6886df77bb21211f7dcce532e1202
Author: Joe McDonnell <[email protected]>
AuthorDate: Fri Jun 23 23:05:21 2023 -0700
IMPALA-12242: Fix failover case in bin/cmake_aux/create_py3_virtualenv.sh
bin/cmake_aux/create_py3_virtualenv.sh will try to use
"python3 -m venv", but if it fails, it wants to fall back
to using impala-virtualenv. Unfortunately, the "python3 -m venv"
command left behind a directory and impala-virtualenv can't
handle it.
This removes the venv directory created by "python3 -m venv"
before falling back to impala-virtualenv.
Testing:
- Remove python3-venv from bin/bootstrap_build.sh and ran
it on a fresh Ubuntu 20 machine. This scenario would
fail without the fix.
Change-Id: Ic20d5b2fba3da3c5358e3ab5513885389bb9eeaa
Reviewed-on: http://gerrit.cloudera.org:8080/20118
Reviewed-by: Joe McDonnell <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
---
bin/cmake_aux/create_py3_virtualenv.sh | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/bin/cmake_aux/create_py3_virtualenv.sh
b/bin/cmake_aux/create_py3_virtualenv.sh
index 5e0a8fe98..d632fc952 100755
--- a/bin/cmake_aux/create_py3_virtualenv.sh
+++ b/bin/cmake_aux/create_py3_virtualenv.sh
@@ -42,12 +42,14 @@ if $IS_PY36_OR_HIGHER ; then
# Success
exit 0
fi
-fi
-
-if $IS_PY36_OR_HIGHER ; then
+ # Failure
echo "WARNING: Tried to create virtualenv with Python3's venv module and
failed."
echo "Falling back to old impala-virtualenv path..."
+ # Remove the directory that Python3 venv created, so impala-virtualenv can
start
+ # from a clean slate.
+ rm -rf ${VENV_DIR}
fi
+
# Fall back to using the old impala-virtualenv method
impala-virtualenv --python ${IMPALA_SYSTEM_PYTHON3} ${VENV_DIR}