From 6dd9dbc07177b6ca424bd755b5f6a1030f7aedae Mon Sep 17 00:00:00 2001 From: Patrick Gartung Date: Tue, 24 Sep 2019 08:38:19 -0500 Subject: Change get_patchelf to immediately return patchelf path if found (#12925) --- lib/spack/spack/relocate.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/relocate.py b/lib/spack/spack/relocate.py index 01fc913a0e..8873d1d725 100644 --- a/lib/spack/spack/relocate.py +++ b/lib/spack/spack/relocate.py @@ -66,20 +66,20 @@ def get_patchelf(): Returns the full patchelf binary path. """ # as we may need patchelf, find out where it is - 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: + 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_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): -- cgit v1.2.3-70-g09d2