From 4818e6eb5a3bff486e8caab3ac43de743532b414 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Wed, 24 Jul 2024 15:04:31 +0200 Subject: [PATCH] Return full path when gcc or ld are used to find the library. That way, we don't rely on the SONAME being set (it isn't set for many libraries), nor do we rely on the SONAME being the same as the filename (which isn't necessarily true). Finally, it resolves the issue that find_library only returns the library name, and then if some python code opens this library dynamically, the runtime loader might find a different one (or none at all, e.g. because LD_LIBRARY_PATH is filtered) --- easybuild/easyblocks/p/python.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/easybuild/easyblocks/p/python.py b/easybuild/easyblocks/p/python.py index d701a5f1d2..1459e7b538 100644 --- a/easybuild/easyblocks/p/python.py +++ b/easybuild/easyblocks/p/python.py @@ -207,8 +207,7 @@ def patch_step(self, *args, **kwargs): if orig_gcc_so_name: orig_gcc_so_name_regex = r'(\s*)' + re.escape(orig_gcc_so_name) + r'(\s*)' updated_gcc_so_name = ( - "os.path.join(os.path.dirname(_findLib_gcc(name)), _get_soname(_findLib_gcc(name)))" - + " or _get_soname(_findLib_ld(name))" + "_findLib_gcc(name) or _findLib_ld(name)" ) apply_regex_substitutions( ctypes_util_py,