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

commit 3b0d6277d5af7ac9749152dd89fe0bbe3a130322
Author: Peter Rozsa <pro...@cloudera.com>
AuthorDate: Fri Jul 11 16:49:27 2025 +0200

    IMPALA-14215: Fix tarball creation for extra Python versions
    
    make_shell_tarball.sh previously used the system Python to copy the
    required packages to each extra python versions. This caused version
    mismatches as the compiled modules are not portable between Python
    versions. This change modifies the logic to use the cache of the
    provided extra version instead of the system Python.
    
    Tests:
     - manually validated that each provided extra Python contains their
       respective compiled dependencies
    
    Change-Id: Iaee9b3a98b73fd1faf1b7c8ba4b388722add6fb4
    Reviewed-on: http://gerrit.cloudera.org:8080/23160
    Reviewed-by: Michael Smith <michael.sm...@cloudera.com>
    Reviewed-by: Csaba Ringhofer <csringho...@cloudera.com>
    Reviewed-by: Joe McDonnell <joemcdonn...@cloudera.com>
    Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
---
 shell/packaging/make_shell_tarball.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/shell/packaging/make_shell_tarball.sh 
b/shell/packaging/make_shell_tarball.sh
index 31acb04ba..acbc8436c 100755
--- a/shell/packaging/make_shell_tarball.sh
+++ b/shell/packaging/make_shell_tarball.sh
@@ -41,6 +41,8 @@ shift
 SHELL_HOME=${IMPALA_HOME}/shell
 BUILD_DIR=${SHELL_HOME}/build
 TARBALL_ROOT=${BUILD_DIR}/impala-shell-${IMPALA_VERSION}
+IMPALA_SYSTEM_PYTHON3_VERSION=$(${IMPALA_SYSTEM_PYTHON3} -c 'import sys; \
+    print("{}.{}".format(sys.version_info.major, sys.version_info.minor))')
 
 for PYTHON_EXE in $*; do
   PYTHON_NAME=$(basename ${PYTHON_EXE})
@@ -58,8 +60,13 @@ for PYTHON_EXE in $*; do
   if [[ $PYTHON_MAJOR_VERSION == 2 ]]; then
     source ${IMPALA_HOME}/shell/build/python2_venv/bin/activate
   else
-    source ${IMPALA_HOME}/shell/build/python3_venv/bin/activate
+    if [[ $IMPALA_SYSTEM_PYTHON3_VERSION == $PYTHON_VERSION ]]; then
+      source ${IMPALA_HOME}/shell/build/python3_venv/bin/activate
+    else
+      source 
${IMPALA_HOME}/shell/build/python${PYTHON_VERSION}_venv/bin/activate
+    fi
   fi
+
   mkdir -p ${TARBALL_ROOT}/install_py${PYTHON_VERSION}
   pip install --cache ${PIP_CACHE} \
       --target ${TARBALL_ROOT}/install_py${PYTHON_VERSION} ${PYPI_PACKAGE}

Reply via email to