Change get_patchelf to immediately return patchelf path if found (#12925)

This commit is contained in:
Patrick Gartung 2019-09-24 08:38:19 -05:00 committed by GitHub
parent 10d5e90e65
commit 6dd9dbc071
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,20 +66,20 @@ def get_patchelf():
Returns the full patchelf binary path.
"""
# as we may need patchelf, find out where it is
patchelf = spack.util.executable.which('patchelf')
if patchelf is not None:
return patchelf.path
else:
if str(spack.architecture.platform()) == 'test':
return None
if str(spack.architecture.platform()) == 'darwin':
return None
patchelf = spack.util.executable.which('patchelf')
if patchelf is None:
patchelf_spec = spack.cmd.parse_specs("patchelf", concretize=True)[0]
patchelf = spack.repo.get(patchelf_spec)
if not patchelf.installed:
patchelf.do_install(use_cache=False)
patchelf_executable = os.path.join(patchelf.prefix.bin, "patchelf")
return patchelf_executable
else:
return patchelf.path
def get_existing_elf_rpaths(path_name):