fightBoxing opened a new pull request, #113: URL: https://github.com/apache/impala/pull/113
## Problem `shell/impala-shell` resolves the host's default interpreter and then requires an exactly matching `install_py<major.minor>` directory in the tarball. If the host's default python version was not one of the versions bundled at package time, the shell refuses to start: ``` This impala-shell package was not built to support Python 3.7. Supported Python versions are: 2.7, 3.11, 3.6, 3.9. ``` This is easy to hit in practice: CentOS 8 / Kylin hosts default to python 3.7, while the tarball may only be built for 3.6, 3.9 and 3.11. The exact version match itself is required because some bundled dependencies (`bitarray`, `kerberos`, `sasl`) are compiled extensions, so loosening the match to "any python3" would break at import time. ## Fix Pick the first interpreter that both exists on the host and has a matching bundled install directory: 1. `$IMPALA_PYTHON_EXECUTABLE`, when set (unchanged, but a bad value now reports an error instead of silently falling back). 2. The unversioned names `python`, `python3`, `python2`, in that order, preserving the previous default behaviour. 3. One interpreter per bundled directory, e.g. `install_py3.11` -> `python3.11`. If none matches, the existing error message is printed (now listing the packaged versions and pointing at `IMPALA_PYTHON_EXECUTABLE`). The packaged versions are derived from the `install_py*` directories that are actually present, so no python version is hardcoded in the script. ## Verification Ran the launcher against a stubbed tarball layout with stub interpreters: | case | bundled | host default | result | | --- | --- | --- | --- | | default python not packaged | 2.7, 3.6, 3.9, 3.11 | python=3.7, python3.11=3.11 | starts with python3.11 | | exact match preferred | 2.7, 3.7, 3.9 | python=3.7 | starts with python (unchanged) | | no usable interpreter | 2.7, 3.6 | python=3.7 | exit 1, lists "2.7, 3.6" | | `IMPALA_PYTHON_EXECUTABLE=python2.7` | 2.7, 3.9 | python=3.7 | uses python2.7 | | `IMPALA_PYTHON_EXECUTABLE=python9.9` | 2.7, 3.9 | python=3.7 | exit 1 | | python2-only host | 2.7 | python=2.7 | starts with python (unchanged) | No Java/C++ code touched; only `shell/impala-shell`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
