Skip to content

Commit

Permalink
Return full path when gcc or ld are used to find the library. That wa…
Browse files Browse the repository at this point in the history
…y, 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)
  • Loading branch information
Caspar van Leeuwen committed Jul 24, 2024
1 parent 0cc765f commit 4818e6e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions easybuild/easyblocks/p/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4818e6e

Please sign in to comment.