Skip to content

Commit 6471f17

Browse files
committed
rename cpp-headers-search-path option to search-path-cpp-headers
1 parent f0190f7 commit 6471f17

File tree

5 files changed

+32
-32
lines changed

5 files changed

+32
-32
lines changed

easybuild/tools/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ def mk_full_default_path(name, prefix=DEFAULT_PREFIX):
206206
'backup_modules',
207207
'banned_linked_shared_libs',
208208
'checksum_priority',
209-
'cpp_headers_search_path',
210209
'container_config',
211210
'container_image_format',
212211
'container_image_name',
@@ -262,6 +261,7 @@ def mk_full_default_path(name, prefix=DEFAULT_PREFIX):
262261
'rpath_filter',
263262
'rpath_override_dirs',
264263
'required_linked_shared_libs',
264+
'search_path_cpp_headers',
265265
'skip',
266266
'software_commit',
267267
'stop',

easybuild/tools/options.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
from easybuild.tools.run import run_shell_cmd
102102
from easybuild.tools.package.utilities import avail_package_naming_schemes
103103
from easybuild.tools.toolchain.compiler import DEFAULT_OPT_LEVEL, OPTARCH_MAP_CHAR, OPTARCH_SEP, Compiler
104-
from easybuild.tools.toolchain.toolchain import CPP_HEADERS_SEARCH_PATHS, DEFAULT_CPP_HEADERS_SEARCH_PATH
104+
from easybuild.tools.toolchain.toolchain import SEARCH_PATH_CPP_HEADERS, DEFAULT_SEARCH_PATH_CPP_HEADERS
105105
from easybuild.tools.toolchain.toolchain import SYSTEM_TOOLCHAIN_NAME
106106
from easybuild.tools.repository.repository import avail_repositories
107107
from easybuild.tools.systemtools import DARWIN, UNKNOWN, check_python_version, get_cpu_architecture, get_cpu_family
@@ -376,8 +376,6 @@ def override_options(self):
376376
'choice', 'store_or_None', DEFAULT_CHECKSUM_PRIORITY, CHECKSUM_PRIORITY_CHOICES),
377377
'cleanup-builddir': ("Cleanup build dir after successful installation.", None, 'store_true', True),
378378
'cleanup-tmpdir': ("Cleanup tmp dir after successful run.", None, 'store_true', True),
379-
'cpp-headers-search-path': ("Search path used by EasyBuild to inject include directories", 'choice',
380-
'store', DEFAULT_CPP_HEADERS_SEARCH_PATH, [*CPP_HEADERS_SEARCH_PATHS]),
381379
'color': ("Colorize output", 'choice', 'store', fancylogger.Colorize.AUTO, fancylogger.Colorize,
382380
{'metavar': 'WHEN'}),
383381
'consider-archived-easyconfigs': ("Also consider archived easyconfigs", None, 'store_true', False),
@@ -626,6 +624,8 @@ def config_options(self):
626624
"(is passed as list of arguments to create the repository instance). "
627625
"For more info, use --avail-repositories."),
628626
'strlist', 'store', self.default_repositorypath),
627+
'search-path-cpp-headers': ("Search path used at build time for include directories", 'choice',
628+
'store', DEFAULT_SEARCH_PATH_CPP_HEADERS, [*SEARCH_PATH_CPP_HEADERS]),
629629
'sourcepath': ("Path(s) to where sources should be downloaded (string, colon-separated)",
630630
None, 'store', mk_full_default_path('sourcepath')),
631631
'subdir-modules': ("Installpath subdir for modules", None, 'store', DEFAULT_PATH_SUBDIRS['subdir_modules']),

easybuild/tools/toolchain/compiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class Compiler(Toolchain):
9393
'vectorize': (None, "Enable compiler auto-vectorization, default except for noopt and lowopt"),
9494
'packed-linker-options': (False, "Pack the linker options as comma separated list"), # ScaLAPACK mainly
9595
'rpath': (True, "Use RPATH wrappers when --rpath is enabled in EasyBuild configuration"),
96-
'cpp-headers-search-path': (None, "Search path used by EasyBuild to inject include directories"),
96+
'search-path-cpp-headers': (None, "Search path used at build time for include directories"),
9797
'extra_cflags': (None, "Specify extra CFLAGS options."),
9898
'extra_cxxflags': (None, "Specify extra CXXFLAGS options."),
9999
'extra_fflags': (None, "Specify extra FFLAGS options."),

easybuild/tools/toolchain/toolchain.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,15 @@
9797
]
9898
# modes to handle CPP header search paths
9999
# see: https://gcc.gnu.org/onlinedocs/cpp/Environment-Variables.html
100-
CPP_HEADERS_SEARCH_PATH_FLAGS = "CPPFLAGS"
101-
CPP_HEADERS_SEARCH_PATH_CPATH = "CPATH"
102-
CPP_HEADERS_SEARCH_PATH_INCLUDE = "INCLUDE_PATHS"
103-
CPP_HEADERS_SEARCH_PATHS = {
104-
CPP_HEADERS_SEARCH_PATH_FLAGS: ["CPPFLAGS"],
105-
CPP_HEADERS_SEARCH_PATH_CPATH: ["CPATH"],
106-
CPP_HEADERS_SEARCH_PATH_INCLUDE: ["C_INCLUDE_PATH", "CPLUS_INCLUDE_PATH", "OBJC_INCLUDE_PATH"],
100+
SEARCH_PATH_CPP_HEADERS_FLAGS = "CPPFLAGS"
101+
SEARCH_PATH_CPP_HEADERS_CPATH = "CPATH"
102+
SEARCH_PATH_CPP_HEADERS_INCLUDE = "INCLUDE_PATHS"
103+
SEARCH_PATH_CPP_HEADERS = {
104+
SEARCH_PATH_CPP_HEADERS_FLAGS: ["CPPFLAGS"],
105+
SEARCH_PATH_CPP_HEADERS_CPATH: ["CPATH"],
106+
SEARCH_PATH_CPP_HEADERS_INCLUDE: ["C_INCLUDE_PATH", "CPLUS_INCLUDE_PATH", "OBJC_INCLUDE_PATH"],
107107
}
108-
DEFAULT_CPP_HEADERS_SEARCH_PATH = CPP_HEADERS_SEARCH_PATH_FLAGS
108+
DEFAULT_SEARCH_PATH_CPP_HEADERS = SEARCH_PATH_CPP_HEADERS_FLAGS
109109

110110

111111
def is_system_toolchain(tc_name):
@@ -1090,26 +1090,26 @@ def _add_dependency_cpp_headers(self, dep_root, extra_dirs=None):
10901090
header_dirs.extend(extra_dirs)
10911091
header_dirs = set(header_dirs) # remove duplicates
10921092

1093-
# mode of operation is defined by cpp-headers-search-path option
1093+
# mode of operation is defined by search-path-cpp-headers option
10941094
# toolchain option has precedence over build option
1095-
cpp_headers_mode = DEFAULT_CPP_HEADERS_SEARCH_PATH
1096-
tc_opt = self.options.option("cpp-headers-search-path")
1095+
cpp_headers_mode = DEFAULT_SEARCH_PATH_CPP_HEADERS
1096+
tc_opt = self.options.option("search-path-cpp-headers")
10971097
if tc_opt is not None:
1098-
self.log.debug("cpp-headers-search-path set by toolchain option: %s", cpp_headers_mode)
1098+
self.log.debug("search-path-cpp-headers set by toolchain option: %s", cpp_headers_mode)
10991099
cpp_headers_mode = tc_opt
11001100
else:
1101-
build_opt = build_option("cpp_headers_search_path")
1101+
build_opt = build_option("search_path_cpp_headers")
11021102
if build_opt is not None:
1103-
self.log.debug("cpp-headers-search-path set by build option: %s", cpp_headers_mode)
1103+
self.log.debug("search-path-cpp-headers set by build option: %s", cpp_headers_mode)
11041104
cpp_headers_mode = build_opt
11051105

1106-
if cpp_headers_mode not in CPP_HEADERS_SEARCH_PATHS:
1106+
if cpp_headers_mode not in SEARCH_PATH_CPP_HEADERS:
11071107
raise EasyBuildError(
1108-
"Unknown value selected for option cpp-headers-search-path. Choose one of: %s",
1109-
", ".join(CPP_HEADERS_SEARCH_PATHS)
1108+
"Unknown value selected for option search-path-cpp-headers. Choose one of: %s",
1109+
", ".join(SEARCH_PATH_CPP_HEADERS)
11101110
)
11111111

1112-
for env_var in CPP_HEADERS_SEARCH_PATHS[cpp_headers_mode]:
1112+
for env_var in SEARCH_PATH_CPP_HEADERS[cpp_headers_mode]:
11131113
self.log.debug("Adding header paths to toolchain variable '%s': %s", env_var, dep_root)
11141114
self.variables.append_subdirs(env_var, dep_root, subdirs=header_dirs)
11151115

test/framework/toolchain.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -955,46 +955,46 @@ def test_precision_flags(self):
955955

956956
self.modtool.purge()
957957

958-
def test_cpp_headers_search_path(self):
959-
"""Test functionality behind cpp-headers-search-path option"""
958+
def test_search_path_cpp_headers(self):
959+
"""Test functionality behind search-path-cpp-headers option"""
960960
cpp_headers_mode = {
961961
"CPPFLAGS": ["CPPFLAGS"],
962962
"CPATH": ["CPATH"],
963963
"INCLUDE_PATHS": ["C_INCLUDE_PATH", "CPLUS_INCLUDE_PATH", "OBJC_INCLUDE_PATH"],
964964
}
965965
# test without toolchain option
966966
for build_opt in cpp_headers_mode:
967-
init_config(build_options={"cpp_headers_search_path": build_opt, "silent": True})
967+
init_config(build_options={"search_path_cpp_headers": build_opt, "silent": True})
968968
tc = self.get_toolchain("foss", version="2018a")
969969
with self.mocked_stdout_stderr():
970970
tc.prepare()
971971
for env_var in cpp_headers_mode[build_opt]:
972972
assert_fail_msg = (
973-
f"Variable {env_var} required by cpp-headers-search-path build option '{build_opt}' "
973+
f"Variable {env_var} required by search-path-cpp-headers build option '{build_opt}' "
974974
"not found in toolchain environment"
975975
)
976976
self.assertIn(env_var, [*tc.variables], assert_fail_msg)
977977
self.modtool.purge()
978978
# test with toolchain option
979979
for build_opt in cpp_headers_mode:
980-
init_config(build_options={"cpp_headers_search_path": build_opt, "silent": True})
980+
init_config(build_options={"search_path_cpp_headers": build_opt, "silent": True})
981981
for tc_opt in cpp_headers_mode:
982982
tc = self.get_toolchain("foss", version="2018a")
983-
tc.set_options({"cpp-headers-search-path": tc_opt})
983+
tc.set_options({"search-path-cpp-headers": tc_opt})
984984
with self.mocked_stdout_stderr():
985985
tc.prepare()
986986
for env_var in cpp_headers_mode[tc_opt]:
987987
assert_fail_msg = (
988-
f"Variable {env_var} required by cpp-headers-search-path toolchain option '{tc_opt}' "
988+
f"Variable {env_var} required by search-path-cpp-headers toolchain option '{tc_opt}' "
989989
"not found in toolchain environment"
990990
)
991991
self.assertIn(env_var, [*tc.variables], assert_fail_msg)
992992
self.modtool.purge()
993993
# test wrong toolchain option
994994
tc = self.get_toolchain("foss", version="2018a")
995-
tc.set_options({"cpp-headers-search-path": "WRONG_MODE"})
995+
tc.set_options({"search-path-cpp-headers": "WRONG_MODE"})
996996
with self.mocked_stdout_stderr():
997-
error_pattern = "Unknown value selected for option cpp-headers-search-path"
997+
error_pattern = "Unknown value selected for option search-path-cpp-headers"
998998
self.assertErrorRegex(EasyBuildError, error_pattern, tc.prepare)
999999
self.modtool.purge()
10001000

0 commit comments

Comments
 (0)