Skip to content

Commit c9f47a3

Browse files
author
Caspar van Leeuwen
committed
Add warning for users that filter LD_LIBRARY_PATH, but do not patch ctypes
1 parent 13471fd commit c9f47a3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

easybuild/easyblocks/p/python.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,18 @@ def fetch_step(self, *args, **kwargs):
393393
msg = "The length of 'checksums' (%s) was not equal to the total amount of sources (%s) + patches (%s)"
394394
msg += ". Did you forget to add a checksum for patch_ctypes_ld_library_path?."
395395
raise EasyBuildError(msg, len(checksums), len(sources), len(len_patches + 1))
396+
# If LD_LIBRARY_PATH is filtered, but no patch is specified, warn the user that his may not work
397+
elif (
398+
'LD_LIBRARY_PATH' in filtered_env_vars and
399+
'LIBRARY_PATH' not in filtered_env_vars and
400+
not patch_ctypes_ld_library_path
401+
):
402+
msg = "EasyBuild was configured to filter LD_LIBRARY_PATH (and not to filter LIBRARY_PATH). "
403+
msg += "However, no patch for ctypes was specified through 'patch_ctypes_ld_library_path' in the "
404+
msg += "EasyConfig. Note that ctypes.util.find_library, ctypes.CDLL and ctypes.cdll.LoadLibrary heavily "
405+
msg += "rely on LD_LIBRARY_PATH. Without the patch, a setup without LD_LIBRARY_PATH will likely not work "
406+
msg += "correctly."
407+
self.log.warning(msg)
396408

397409
super().fetch_step(*args, **kwargs)
398410

0 commit comments

Comments
 (0)