aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2024-06-18 08:07:49 -0700
committerJonas Devlieghere <jonas@devlieghere.com>2024-06-18 08:12:11 -0700
commit7dbc1688b550510b6777acbbbcfea8e02ba34ed2 (patch)
treeb54cf7e09951ad0db1a94791655435823055bc4d
parent3eb4128eb0cb4a42b912ee352c120a9c0f2ddbd6 (diff)
downloadllvm-7dbc1688b550510b6777acbbbcfea8e02ba34ed2.zip
llvm-7dbc1688b550510b6777acbbbcfea8e02ba34ed2.tar.gz
llvm-7dbc1688b550510b6777acbbbcfea8e02ba34ed2.tar.bz2
[lldb] Extend Python interpreter workaround to Xcode Python (attempt #2.5)
The Python interpreter in Xcode cannot be copied because of a relative RPATH. Our workaround would just use that Python interpreter directly when it detects this. For the reasons explained in my previous commit, that doesn't work in a virtual environment. Address this case by creating a symlink to the "real" interpreter in the virtual environment.
-rw-r--r--lldb/test/API/lit.cfg.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/lldb/test/API/lit.cfg.py b/lldb/test/API/lit.cfg.py
index 6d45508..96520c7 100644
--- a/lldb/test/API/lit.cfg.py
+++ b/lldb/test/API/lit.cfg.py
@@ -99,10 +99,11 @@ def find_python_interpreter():
except subprocess.CalledProcessError:
# The copied Python didn't work. Assume we're dealing with the Python
# interpreter in Xcode. Given that this is not a system binary SIP
- # won't prevent us form injecting the interceptors so we get away with
- # not copying the executable.
+ # won't prevent us form injecting the interceptors, but when running in
+ # a virtual environment, we can't use it directly. Create a symlink
+ # instead.
os.remove(copied_python)
- return real_python
+ os.symlink(real_python, copied_python)
# The copied Python works.
return copied_python