Skip to content

Commit 354d0b6

Browse files
authored
Merge pull request #4854 from jfgrimm/rpath-sanity-resolve-path
Enhance RPATH sanity check to skip anything whose absolute path resolves to outside the install dir
2 parents 8d8e70f + 2e939a6 commit 354d0b6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

easybuild/framework/easyblock.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3413,6 +3413,14 @@ def sanity_check_rpath(self, rpath_dirs=None, check_readelf_rpath=True):
34133413
self.log.debug(f"Sanity checking RPATH for files in {dirpath}")
34143414

34153415
for path in [os.path.join(dirpath, x) for x in os.listdir(dirpath)]:
3416+
# skip the check for any symlinks that resolve to outside the installation directory
3417+
if not is_parent_path(self.installdir, path):
3418+
realpath = os.path.realpath(path)
3419+
msg = (f"Skipping RPATH sanity check for {path}, since its absolute path {realpath} resolves to"
3420+
f" outside the installation directory {self.installdir}")
3421+
self.log.info(msg)
3422+
continue
3423+
34163424
self.log.debug(f"Sanity checking RPATH for {path}")
34173425

34183426
out = get_linked_libs_raw(path)

0 commit comments

Comments
 (0)