absolutify_elf_sonames.py: fix _patchelf (#44343)

This commit is contained in:
Harmen Stoppels 2024-05-23 16:05:10 +02:00 committed by GitHub
parent 125175ae25
commit 92000e81b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,7 +13,6 @@
import spack.config import spack.config
import spack.relocate import spack.relocate
from spack.util.elf import ElfParsingError, parse_elf from spack.util.elf import ElfParsingError, parse_elf
from spack.util.executable import Executable
def is_shared_library_elf(filepath): def is_shared_library_elf(filepath):
@ -149,10 +148,9 @@ def post_install(spec, explicit=None):
return return
# Should failing to locate patchelf be a hard error? # Should failing to locate patchelf be a hard error?
patchelf_path = spack.relocate._patchelf() patchelf = spack.relocate._patchelf()
if not patchelf_path: if not patchelf:
return return
patchelf = Executable(patchelf_path)
fixes = find_and_patch_sonames(spec.prefix, spec.package.non_bindable_shared_objects, patchelf) fixes = find_and_patch_sonames(spec.prefix, spec.package.non_bindable_shared_objects, patchelf)