Skip to content

Commit 2689e8a

Browse files
authored
Merge pull request #4768 from pavelToman/patch-1
add support for `check_readelf_rpath` easyconfig parameter to optionally skip RPATH checks
2 parents 7bc1f0e + 1e655d4 commit 2689e8a

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

easybuild/framework/easyblock.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3734,13 +3734,22 @@ def trace_and_log(msg):
37343734

37353735
return fail_msgs
37363736

3737-
def sanity_check_rpath(self, rpath_dirs=None, check_readelf_rpath=True):
3737+
def sanity_check_rpath(self, rpath_dirs=None, check_readelf_rpath=None):
37383738
"""Sanity check binaries/libraries w.r.t. RPATH linking."""
37393739

37403740
self.log.info("Checking RPATH linkage for binaries/libraries...")
37413741

37423742
fails = []
37433743

3744+
if check_readelf_rpath is None:
3745+
# Configure RPATH checking by readelf using easyconfig variable 'check_readelf_rpath' (default True)
3746+
check_readelf_rpath = self.cfg["check_readelf_rpath"]
3747+
3748+
if check_readelf_rpath:
3749+
self.log.info("Checks on RPATH section of binaries/libraries (via 'readelf -d') enabled")
3750+
else:
3751+
self.log.info("Checks on RPATH section of binaries/libraries (via 'readelf -d') disabled")
3752+
37443753
if build_option('strict_rpath_sanity_check'):
37453754
self.log.info("Unsetting $LD_LIBRARY_PATH since strict RPATH sanity check is enabled...")
37463755
# hard reset $LD_LIBRARY_PATH before running RPATH sanity check

easybuild/framework/easyconfig/default.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@
236236
"and will be archived in the next major release of EasyBuild", OTHER],
237237
'build_info_msg': [None, "String with information to be printed to stdout and logged during the building "
238238
"of the easyconfig", OTHER],
239+
'check_readelf_rpath': [True, "If False, it won't check the RPATH by readelf even with the --rpath flag", OTHER],
239240
}
240241

241242

test/framework/toy_build.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3035,6 +3035,15 @@ def grab_gcc_rpath_wrapper_args():
30353035
with self.mocked_stdout_stderr():
30363036
self._test_toy_build(ec_file=toy_ec, extra_args=['--rpath'], raise_error=True)
30373037

3038+
# test check_readelf_rpath easyconfig parameter
3039+
test_ecs = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'easyconfigs', 'test_ecs')
3040+
toy_ec_txt = read_file(os.path.join(test_ecs, 't', 'toy', 'toy-0.0.eb'))
3041+
toy_ec_txt += "\ncheck_readelf_rpath = False\n"
3042+
toy_ec = os.path.join(self.test_prefix, 'toy.eb')
3043+
write_file(toy_ec, toy_ec_txt)
3044+
with self.mocked_stdout_stderr():
3045+
self._test_toy_build(ec_file=toy_ec, extra_args=['--rpath'], raise_error=True)
3046+
30383047
def test_toy_filter_rpath_sanity_libs(self):
30393048
"""Test use of --filter-rpath-sanity-libs."""
30403049

0 commit comments

Comments
 (0)