Change get_patchelf to immediately return patchelf path if found (#12925)
This commit is contained in:
parent
10d5e90e65
commit
6dd9dbc071
@ -66,20 +66,20 @@ def get_patchelf():
|
|||||||
Returns the full patchelf binary path.
|
Returns the full patchelf binary path.
|
||||||
"""
|
"""
|
||||||
# as we may need patchelf, find out where it is
|
# 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':
|
if str(spack.architecture.platform()) == 'test':
|
||||||
return None
|
return None
|
||||||
if str(spack.architecture.platform()) == 'darwin':
|
if str(spack.architecture.platform()) == 'darwin':
|
||||||
return None
|
return None
|
||||||
patchelf = spack.util.executable.which('patchelf')
|
|
||||||
if patchelf is None:
|
|
||||||
patchelf_spec = spack.cmd.parse_specs("patchelf", concretize=True)[0]
|
patchelf_spec = spack.cmd.parse_specs("patchelf", concretize=True)[0]
|
||||||
patchelf = spack.repo.get(patchelf_spec)
|
patchelf = spack.repo.get(patchelf_spec)
|
||||||
if not patchelf.installed:
|
if not patchelf.installed:
|
||||||
patchelf.do_install(use_cache=False)
|
patchelf.do_install(use_cache=False)
|
||||||
patchelf_executable = os.path.join(patchelf.prefix.bin, "patchelf")
|
patchelf_executable = os.path.join(patchelf.prefix.bin, "patchelf")
|
||||||
return patchelf_executable
|
return patchelf_executable
|
||||||
else:
|
|
||||||
return patchelf.path
|
|
||||||
|
|
||||||
|
|
||||||
def get_existing_elf_rpaths(path_name):
|
def get_existing_elf_rpaths(path_name):
|
||||||
|
Loading…
Reference in New Issue
Block a user