[Bug 16183] New: LLDB finds incorrect python version if python 3 is installed (Arch Linux)

Bug ID 16183
Summary LLDB finds incorrect python version if python 3 is installed (Arch Linux)
Product lldb
Version unspecified
Hardware PC
OS Linux
Status NEW
Severity normal
Priority P
Component All Bugs
Assignee lldb-dev@cs.uiuc.edu
Reporter daniel.malea@intel.com
Classification Unclassified

The LLDB SWIG scripts only support python 2. When trying to run with python 3,
the following error occurs:

File "<string>", line 1
     from distutils.sysconfig import get_python_lib; print
get_python_lib(True, False, "/tmp/llvm/build");

Due to:

  <lldb_dir>/scripts/Python/build-swig-Python.sh
and
  <lldb_dir>/scripts/Python/build-swig-Python-LLDB.sh

scripts using "usr/bin/env python" to locate the right python executable. On
Arch Linux, where python 3 is the default, the correct way to find python is by
doing "/usr/bin/env python2" however "python2" is not installed on Mac OS X...
So to keep things working on multiple platforms,  propagating the LLVM CMake
variable "PYTHON_EXECUTABLE" to the scripts above is the right approach.