If a user has PYTHONPATH set in the environment, append new entries to it rather than blindly setting PYTHONPATH to a fixed string. This allows tests to, for example, find psutil if it is in PYTHONPATH. Without this change, lit will detect psutil but then various tests will fail because PYTHONPATH has been overwritten and psutil cannot be found.
Diff Detail
- Repository
- rL LLVM
Event Timeline
@greened This seems reasonable but I'm wondering under what scenario psutil is installed in a non-standard location which requires the use of PYTHONPATH. The usual way to handle installing a python package that you don't want system wide is to use virtualenv and then run pip install psutil in that environment.
utils/lit/tests/lit.cfg | ||
---|---|---|
39 | You should add a comment above the if 'PYTHONPATH' explaining why this is being here because it looks like the Required because some tests import the lit module comment is describing the entire block of code, whereas it actually only describes the very first statement (pythonpath_list = [lit_path]). |
virtualenv isn't available everywhere. Some sites prefer that users point to a specific Python installation via PYTHONPATH.
@greened Sorry looks like I missed your earlier pings. LGTM
Can you commit this, or would you like me to do it on your behalf?
You should add a comment above the if 'PYTHONPATH' explaining why this is being here because it looks like the Required because some tests import the lit module comment is describing the entire block of code, whereas it actually only describes the very first statement (pythonpath_list = [lit_path]).