Bugfix: do not try to copy and patch unexisting DSOs

It seems like some drivers installations are missing some NVidia
subsystems. We stumbled upon the case of somebody missing the Cuda
libraries.

It did end up making fail the patchelf call.

Preventing the copying/patch routine to run when we do not have any
DSO to copy/patch.
This commit is contained in:
Félix Baylac Jacqué 2022-12-22 19:01:31 +01:00
parent 09fda6b9bd
commit 37d4a1b248
No known key found for this signature in database
GPG Key ID: EFD315F31848DBA4
1 changed files with 7 additions and 1 deletions

View File

@ -108,6 +108,9 @@ class LibraryPath:
and self.path == other.path
)
def __repr__(self):
return f"LibraryPath<{self.path}>"
def __hash__(self):
return hash(
(
@ -436,7 +439,10 @@ def cache_library_path(library_path: LibraryPath, cache_dir_root: str) -> str:
(library_path.glx, glx_dir),
]:
os.makedirs(d, exist_ok=True)
copy_and_patch_libs(dsos=dsos, dest_dir=d, rpath=lib_dir)
if len(dsos) > 0:
copy_and_patch_libs(dsos=dsos, dest_dir=d, rpath=lib_dir)
else:
log_info(f"Did not find any DSO to put in {d}, skipping copy and patching.")
return cache_path_root