@@ -104,13 +104,11 @@ def get_lldb_python_path(lldb_build_root):
104
104
return None
105
105
return subprocess .check_output ([lldb_path , "-P" ]).rstrip ().decode ('utf-8' )
106
106
107
- def get_lldb_python_from_path (lldb_path ):
108
- (head , tail ) = os .path .split (lldb_path )
109
- if tail and re .match ('^python[23][.0-9]*$' , tail ):
110
- return tail
111
- if head and head != lldb_path :
112
- return get_lldb_python_from_path (head )
113
- return None
107
+ def get_lldb_python_interpreter (lldb_build_root ):
108
+ python_path = os .path .join (lldb_build_root , 'bin' , 'lldb-python' )
109
+ if not os .access (python_path , os .F_OK ):
110
+ return None
111
+ return python_path
114
112
115
113
###
116
114
@@ -1959,20 +1957,19 @@ config.substitutions.append(('%import-libdispatch', getattr(config, 'import_libd
1959
1957
1960
1958
if config .lldb_build_root != "" :
1961
1959
lldb_python_path = get_lldb_python_path (config .lldb_build_root )
1960
+ lldb_python_interpreter = get_lldb_python_interpreter (config .lldb_build_root )
1962
1961
if lldb_python_path == None :
1963
1962
lit_config .warning ("""
1964
1963
Specified lldb_build_root, but could not find lldb in that build root
1965
1964
""" )
1965
+ elif lldb_python_interpreter == None :
1966
+ lit_config .warning ("""
1967
+ Specified lldb_build_root, but could not find lldb-python in that build root
1968
+ """ )
1966
1969
else :
1967
- lldb_python = get_lldb_python_from_path (lldb_python_path )
1968
- if lldb_python == None :
1969
- lit_config .warning ("""
1970
- Unable to determine python version from LLDB Python path %s
1971
- """ % lldb_python_path )
1972
- else :
1973
- config .available_features .add ('lldb' )
1974
- config .substitutions .append (('%lldb-python-path' , lldb_python_path ))
1975
- config .substitutions .append (('%{lldb-python}' , 'PYTHONPATH=%s %s' % (lldb_python_path , lldb_python )))
1970
+ config .available_features .add ('lldb' )
1971
+ config .substitutions .append (('%lldb-python-path' , lldb_python_path ))
1972
+ config .substitutions .append (('%{lldb-python}' , 'PYTHONPATH=%s %s' % (lldb_python_path , lldb_python_interpreter )))
1976
1973
1977
1974
# Disable randomized hash seeding by default. Tests need to manually opt in to
1978
1975
# random seeds by unsetting the SWIFT_DETERMINISTIC_HASHING environment
0 commit comments