Fix embedded_launcher can't find files
The problem came from Python libraries doesn't know the information that we enabled embedded_launcher (only Python binary knows about that). And we can't simply remove runfiles dir for Python libraries since host Python mode need this. Bug: b/80441699 Test: m perf_profo_flames Change-Id: I73ffc4d7504f95a708ae7cca47bc6c15a673aa31
This commit is contained in:
@@ -11,7 +11,6 @@ import zipfile
|
||||
PYTHON_BINARY = '%interpreter%'
|
||||
MAIN_FILE = '%main%'
|
||||
PYTHON_PATH = 'PYTHONPATH'
|
||||
ZIP_RUNFILES_DIRECTORY_NAME = 'runfiles'
|
||||
|
||||
def SearchPathEnv(name):
|
||||
search_path = os.getenv('PATH', os.defpath).split(os.pathsep)
|
||||
@@ -36,7 +35,7 @@ def ExtractRunfiles():
|
||||
temp_dir = tempfile.mkdtemp("", "Soong.python_")
|
||||
zf = zipfile.ZipFile(os.path.dirname(__file__))
|
||||
zf.extractall(temp_dir)
|
||||
return os.path.join(temp_dir, ZIP_RUNFILES_DIRECTORY_NAME)
|
||||
return temp_dir
|
||||
|
||||
def Main():
|
||||
args = sys.argv[1:]
|
||||
@@ -83,7 +82,7 @@ def Main():
|
||||
except:
|
||||
raise
|
||||
finally:
|
||||
shutil.rmtree(os.path.dirname(runfiles_path), True)
|
||||
shutil.rmtree(runfiles_path, True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
Main()
|
||||
|
Reference in New Issue
Block a user