[LLVMbugs] [Bug 19527] the test for PYTHON_EXECUTABLE doesn't take custom python installations and environment variables into account

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Apr 25 09:29:23 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19527

Emanuele Cestari <emanuelecestari at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WORKSFORME                  |---

--- Comment #2 from Emanuele Cestari <emanuelecestari at yahoo.com> ---
(In reply to comment #1)
> I regularly use 'cmake -DPYTHON_EXECUTABLE=my/python' without any special
> environment variables and it works fine for me.
> 
> If your custom versions of python have non-standard PYTHONPATH requirements,
> then you should make sure to set the environment before running CMake.
> 
> I don't think there's anything we should change here.

1) -DPYTHON_EXECUTABLE=my/python it's not necessarily the python executable
that ends up filling the PYTHON_EXECUTABLE variable
2) the PYTHON_EXECUTABLE is the result of the FindPythonInterp cmake function
3) the business logic of FindPythonInterp is not documented anywhere by the
company that makes cmake, nor there are any explicit guarantees about it.
4) the environment variables should be added inside the script to support
custom environments, otherwise it's extremely likely that no one will be able
to use that and here is why:
4.1) there are Unix/Linux OSs that use python for system-wide tasks therefore
they already provide a python installation. Assuming that you are a developer
you have another python installation on your local folder, now you have at
least 2 python installations. If you now try to export some environment
variable that is python-specific it will impact both python installations and
this is likely to cause big problems. So your answer about exporting variables
it's not viable and it's likely to not be viable in any OS that is using python
for administrative tasks ( and basically all the GNU/Linux distributions do
this ) plus it doesn't take into account that the script is ill formed on its
own if the purpose of this script is about supporting both the system default
python installation and a custom python installation; if the purpose of this
script is to not offer support for custom python installations then everything
is fine as it is now.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140425/672f3d3a/attachment.html>


More information about the llvm-bugs mailing list