Skip to content

Commit b3c16f6

Browse files
authored
Merge pull request easybuilders#4779 from boegel/limit_rpath_readelf_fail_output
limit output included in sanity check failure message for missing RPATH section in output of '`readelf -d`' + fix regex used to look for `'(RPATH)'`
2 parents 0813e82 + 39518c0 commit b3c16f6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

easybuild/framework/easyblock.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3349,7 +3349,7 @@ def sanity_check_rpath(self, rpath_dirs=None, check_readelf_rpath=True):
33493349

33503350
not_found_regex = re.compile(r'(\S+)\s*\=\>\s*not found')
33513351
lib_path_regex = re.compile(r'\S+\s*\=\>\s*(\S+)')
3352-
readelf_rpath_regex = re.compile('(RPATH)', re.M)
3352+
readelf_rpath_regex = re.compile(r'\(RPATH\)', re.M)
33533353

33543354
# List of libraries that should be exempt from the RPATH sanity check;
33553355
# For example, libcuda.so.1 should never be RPATH-ed by design,
@@ -3413,7 +3413,7 @@ def sanity_check_rpath(self, rpath_dirs=None, check_readelf_rpath=True):
34133413
if res.exit_code != EasyBuildExit.SUCCESS:
34143414
fail_msg = f"Failed to run 'readelf -d {path}': {res.output}"
34153415
elif not readelf_rpath_regex.search(res.output):
3416-
fail_msg = f"No '(RPATH)' found in 'readelf -d' output for {path}: {out}"
3416+
fail_msg = f"No '(RPATH)' found in 'readelf -d' output for {path}"
34173417

34183418
if fail_msg:
34193419
self.log.warning(fail_msg)

test/framework/toy_build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3031,7 +3031,7 @@ def test_toy_filter_rpath_sanity_libs(self):
30313031

30323032
libtoy_libdir = os.path.join(self.test_installpath, 'software', 'libtoy', '0.0', 'lib')
30333033
toyapp_bin = os.path.join(self.test_installpath, 'software', 'toy-app', '0.0', 'bin', 'toy-app')
3034-
rpath_regex = re.compile(r"RPATH.*" + libtoy_libdir, re.M)
3034+
rpath_regex = re.compile(r"\(RPATH\).*" + libtoy_libdir, re.M)
30353035
with self.mocked_stdout_stderr():
30363036
res = run_shell_cmd(f"readelf -d {toyapp_bin}")
30373037
self.assertTrue(rpath_regex.search(res.output),

0 commit comments

Comments
 (0)