IMPALA-12434: Isolate pkg_resources.py to its own directory

In some build environments, the impala-shell Python 3
virtualenv install fails due to interactions with
shell/pkg_resources.py. This doesn't reproduce in the standard
development environment, but it is consistent. It seems to
be related to invoking a command in ${IMPALA_HOME}/shell
and the pkg_resources.py being in that directory.

To avoid any interactions, this moves shell/pkg_resources.py
to shell/legacy/pkg_resources.py. This keeps it off of the
path for the failing command, and it also keeps it off of
our PYTHONPATH (which includes ${IMPALA_HOME}/shell).

Testing:
 - Ran a build in the affected build environment
 - Ran a core job

Change-Id: Id8f2d8a8472c7bb405bf88673ed9779e23cde1d6
Reviewed-on: http://gerrit.cloudera.org:8080/20468
Reviewed-by: Michael Smith <michael.smith@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
This commit is contained in:
Joe McDonnell
2023-09-08 09:40:51 -07:00
parent 6f9a7622ed
commit 1a1a84ee23
4 changed files with 3 additions and 3 deletions

View File

@@ -28,7 +28,7 @@ for file in $(git ls-files '**/*.py'); do
continue
fi
# Skip the shell's pkg_resources.py
if [[ "${file}" == "shell/pkg_resources.py" ]]; then
if [[ "${file}" == "shell/legacy/pkg_resources.py" ]]; then
continue
fi

View File

@@ -225,7 +225,7 @@ cmake_modules/FindJNI.cmake
# http://www.apache.org/legal/resolved.html#category-a : Python Software Foundation
# License is allowed.
shell/pkg_resources.py
shell/legacy/pkg_resources.py
# Notices in Impala as required by ASF rules:
DISCLAIMER

View File

@@ -186,7 +186,7 @@ cp ${SHELL_HOME}/impala_shell.py ${TARBALL_ROOT}
cp ${SHELL_HOME}/compatibility.py ${TARBALL_ROOT}
cp ${SHELL_HOME}/thrift_printer.py ${TARBALL_ROOT}
cp ${SHELL_HOME}/pkg_resources.py ${TARBALL_ROOT}/legacy
cp ${SHELL_HOME}/legacy/pkg_resources.py ${TARBALL_ROOT}/legacy
pushd ${BUILD_DIR} > /dev/null
echo "Making tarball in ${BUILD_DIR}"