Skip to content

Commit

Permalink
use 'true' and 'false' as values for %(rpath)s template
Browse files Browse the repository at this point in the history
  • Loading branch information
boegel committed Oct 9, 2024
1 parent 7c2641d commit 348a30e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions easybuild/framework/easyconfig/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
('cuda_sm_space_sep', "Space-separated list of sm_* values that correspond with CUDA compute capabilities"),
('mpi_cmd_prefix', "Prefix command for running MPI programs (with default number of ranks)"),
# can't be a boolean (True/False), must be a string value since it's a string template
('rpath', "String value indicating whether or not RPATH linking is used ('yes' or 'no')"),
('rpath', "String value indicating whether or not RPATH linking is used ('true' or 'false')"),
('software_commit', "Git commit id to use for the software as specified by --software-commit command line option"),
('sysroot', "Location root directory of system, prefix for standard paths like /usr/lib and /usr/include"
"as specified by the --sysroot configuration option"),
Expand Down Expand Up @@ -211,7 +211,7 @@ def template_constant_dict(config, ignore=None, skip_lower=None, toolchain=None)
template_values['arch'] = platform.uname()[4]

# set 'rpath' template based on 'rpath' configuration option, using empty string as fallback
template_values['rpath'] = 'yes' if build_option('rpath') else 'no'
template_values['rpath'] = 'true' if build_option('rpath') else 'false'

# set 'sysroot' template based on 'sysroot' configuration option, using empty string as fallback
template_values['sysroot'] = build_option('sysroot') or ''
Expand Down
8 changes: 4 additions & 4 deletions test/framework/easyconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -1434,18 +1434,18 @@ def test_rpath_template(self):
write_file(test_ec, test_ec_txt)

ec = EasyConfig(test_ec)
expected = '--with-rpath=yes' if get_os_name() == 'Linux' else '--with-rpath=no'
expected = '--with-rpath=true' if get_os_name() == 'Linux' else '--with-rpath=false'
self.assertEqual(ec['configopts'], expected)

# force True
update_build_option('rpath', True)
ec = EasyConfig(test_ec)
self.assertEqual(ec['configopts'], "--with-rpath=yes")
self.assertEqual(ec['configopts'], "--with-rpath=true")

# force False
update_build_option('rpath', False)
ec = EasyConfig(test_ec)
self.assertEqual(ec['configopts'], "--with-rpath=no")
self.assertEqual(ec['configopts'], "--with-rpath=false")

def test_sysroot_template(self):
"""Test the %(sysroot)s template"""
Expand Down Expand Up @@ -3389,7 +3389,7 @@ def test_template_constant_dict(self):

arch_regex = re.compile('^[a-z0-9_]+$')

rpath = 'yes' if get_os_name() == 'Linux' else 'no'
rpath = 'true' if get_os_name() == 'Linux' else 'false'

expected = {
'bitbucket_account': 'gzip',
Expand Down

0 comments on commit 348a30e

Please sign in to comment.