From 37d4a1b248be7c3a70e27c452e4354b8ca9359c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Baylac=20Jacqu=C3=A9?= Date: Thu, 22 Dec 2022 19:01:31 +0100 Subject: [PATCH] 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. --- src/nixglhost.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/nixglhost.py b/src/nixglhost.py index b305f07..e8650ec 100755 --- a/src/nixglhost.py +++ b/src/nixglhost.py @@ -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