diff --git a/easybuild/framework/easyblock.py b/easybuild/framework/easyblock.py index 409b6dda75..304e9b3f3a 100644 --- a/easybuild/framework/easyblock.py +++ b/easybuild/framework/easyblock.py @@ -90,7 +90,6 @@ from easybuild.tools.package.utilities import package from easybuild.tools.py2vs3 import extract_method_name, string_type from easybuild.tools.repository.repository import init_repository -from easybuild.tools.toolchain.toolchain import DUMMY_TOOLCHAIN_NAME from easybuild.tools.systemtools import det_parallelism, use_group from easybuild.tools.utilities import INDENT_4SPACES, get_class_for, quote_str, remove_unwanted_chars, trace_msg from easybuild.tools.version import this_is_easybuild, VERBOSE_VERSION, VERSION @@ -1027,7 +1026,7 @@ def make_module_dep(self, unload_info=None): # include toolchain as first dependency to load tc_mod = None - if self.toolchain.name != DUMMY_TOOLCHAIN_NAME: + if not self.toolchain.is_system_toolchain(): tc_mod = self.toolchain.det_short_module_name() self.log.debug("Toolchain to load in generated module (before excluding any deps): %s", tc_mod) @@ -1355,7 +1354,7 @@ def load_module(self, mod_paths=None, purge=True, extra_modules=None): # for flat module naming schemes, we can load the module directly; # for non-flat (hierarchical) module naming schemes, we may need to load the toolchain module first # to update $MODULEPATH such that the module can be loaded using the short module name - if self.mod_subdir and self.toolchain.name != DUMMY_TOOLCHAIN_NAME: + if self.mod_subdir and not self.toolchain.is_system_toolchain(): mods.insert(0, self.toolchain.det_short_module_name()) # pass initial environment, to use it for resetting the environment before loading the modules diff --git a/easybuild/framework/easyconfig/constants.py b/easybuild/framework/easyconfig/constants.py index d462a01ea4..372834b7a5 100644 --- a/easybuild/framework/easyconfig/constants.py +++ b/easybuild/framework/easyconfig/constants.py @@ -50,4 +50,5 @@ 'OS_NAME': (get_os_name(), "System name (e.g. 'fedora' or 'RHEL')"), 'OS_VERSION': (get_os_version(), "System version"), 'SYS_PYTHON_VERSION': (platform.python_version(), "System Python version (platform.python_version())"), + 'SYSTEM': ({'name': 'system', 'version': 'system'}, "System toolchain"), } diff --git a/easybuild/framework/easyconfig/easyconfig.py b/easybuild/framework/easyconfig/easyconfig.py index 71909b9d73..fa668ed7f0 100644 --- a/easybuild/framework/easyconfig/easyconfig.py +++ b/easybuild/framework/easyconfig/easyconfig.py @@ -68,7 +68,7 @@ from easybuild.tools.modules import modules_tool from easybuild.tools.py2vs3 import OrderedDict, string_type from easybuild.tools.systemtools import check_os_dependency -from easybuild.tools.toolchain.toolchain import DUMMY_TOOLCHAIN_NAME, DUMMY_TOOLCHAIN_VERSION +from easybuild.tools.toolchain.toolchain import SYSTEM_TOOLCHAIN_NAME, is_system_toolchain from easybuild.tools.toolchain.toolchain import TOOLCHAIN_CAPABILITIES, TOOLCHAIN_CAPABILITY_CUDA from easybuild.tools.toolchain.utilities import get_toolchain, search_toolchain from easybuild.tools.utilities import flatten, get_class_for, nub, quote_py_str, remove_unwanted_chars @@ -144,18 +144,18 @@ def det_subtoolchain_version(current_tc, subtoolchain_name, optional_toolchains, """ Returns unique version for subtoolchain, in tc dict. If there is no unique version: - * use '' for dummy, if dummy is not skipped. + * use '' for system, if system is not skipped. * return None for skipped subtoolchains, that is, - optional toolchains or dummy without add_dummy_to_minimal_toolchains. + optional toolchains or system toolchain without add_system_to_minimal_toolchains. * in all other cases, raises an exception. """ uniq_subtc_versions = set([subtc['version'] for subtc in cands if subtc['name'] == subtoolchain_name]) # init with "skipped" subtoolchain_version = None - # dummy toolchain: bottom of the hierarchy - if subtoolchain_name == DUMMY_TOOLCHAIN_NAME: - if build_option('add_dummy_to_minimal_toolchains') and not incl_capabilities: + # system toolchain: bottom of the hierarchy + if is_system_toolchain(subtoolchain_name): + if build_option('add_system_to_minimal_toolchains') and not incl_capabilities: subtoolchain_version = '' elif len(uniq_subtc_versions) == 1: subtoolchain_version = list(uniq_subtc_versions)[0] @@ -177,7 +177,7 @@ def get_toolchain_hierarchy(parent_toolchain, incl_capabilities=False): Determine list of subtoolchains for specified parent toolchain. Result starts with the most minimal subtoolchains first, ends with specified toolchain. - The dummy toolchain is considered the most minimal subtoolchain only if the add_dummy_to_minimal_toolchains + The system toolchain is considered the most minimal subtoolchain only if the add_system_to_minimal_toolchains build option is enabled. The most complex hierarchy we have now is goolfc which works as follows: @@ -192,7 +192,7 @@ def get_toolchain_hierarchy(parent_toolchain, incl_capabilities=False): / | GCCcore(*) | \ | - (dummy: only considered if --add-dummy-to-minimal-toolchains configuration option is enabled) + (system: only considered if --add-system-to-minimal-toolchains configuration option is enabled) :param parent_toolchain: dictionary with name/version of parent toolchain :param incl_capabilities: also register toolchain capabilities in result @@ -864,7 +864,7 @@ def filter_deps(self, deps): def dependencies(self, build_only=False): """ Returns an array of parsed dependencies (after filtering, if requested) - dependency = {'name': '', 'version': '', 'dummy': (False|True), 'versionsuffix': '', 'toolchain': ''} + dependency = {'name': '', 'version': '', 'system': (False|True), 'versionsuffix': '', 'toolchain': ''} Iterable builddependencies are flattened when not iterating. :param build_only: only return build dependencies, discard others @@ -927,7 +927,7 @@ def toolchain(self): tcdeps = None tcname, tcversion = self['toolchain']['name'], self['toolchain']['version'] - if tcname != DUMMY_TOOLCHAIN_NAME: + if not is_system_toolchain(tcname): tc_ecfile = robot_find_easyconfig(tcname, tcversion) if tc_ecfile is None: self.log.debug("No easyconfig found for toolchain %s version %s, can't determine dependencies", @@ -950,7 +950,7 @@ def all_dependencies(self): if self._all_dependencies is None: self.log.debug("Composing list of all dependencies (incl. toolchain)") self._all_dependencies = copy.deepcopy(self.dependencies()) - if self['toolchain']['name'] != DUMMY_TOOLCHAIN_NAME: + if not is_system_toolchain(self['toolchain']['name']): self._all_dependencies.append(self.toolchain.as_dict()) return self._all_dependencies @@ -1110,7 +1110,7 @@ def _parse_dependency(self, dep, hidden=False, build_only=False): of these attributes, 'name' and 'version' are mandatory output dict contains these attributes: - ['name', 'version', 'versionsuffix', 'dummy', 'toolchain', 'short_mod_name', 'full_mod_name', 'hidden', + ['name', 'version', 'versionsuffix', 'system', 'toolchain', 'short_mod_name', 'full_mod_name', 'hidden', 'external_module'] :param hidden: indicate whether corresponding module file should be installed hidden ('.'-prefixed) @@ -1131,8 +1131,8 @@ def _parse_dependency(self, dep, hidden=False, build_only=False): # toolchain with which this dependency is installed 'toolchain': None, 'toolchain_inherited': False, - # boolean indicating whether we're dealing with a dummy toolchain for this dependency - 'dummy': False, + # boolean indicating whether we're dealing with a system toolchain for this dependency + SYSTEM_TOOLCHAIN_NAME: False, # boolean indicating whether the module for this dependency is (to be) installed hidden 'hidden': hidden, # boolean indicating whether this this a build-only dependency @@ -1146,9 +1146,9 @@ def _parse_dependency(self, dep, hidden=False, build_only=False): if isinstance(dep, dict): dependency.update(dep) - # make sure 'dummy' key is handled appropriately - if 'dummy' in dep and 'toolchain' not in dep: - dependency['toolchain'] = dep['dummy'] + # make sure 'system' key is handled appropriately + if SYSTEM_TOOLCHAIN_NAME in dep and 'toolchain' not in dep: + dependency['toolchain'] = dep[SYSTEM_TOOLCHAIN_NAME] if dep.get('external_module', False): dependency.update(self.handle_external_module_metadata(dep['full_mod_name'])) @@ -1198,9 +1198,9 @@ def _parse_dependency(self, dep, hidden=False, build_only=False): self.log.debug("Inheriting parent toolchain %s for dep %s (until deps are finalised)", tc, dependency) dependency['toolchain_inherited'] = True - # (true) boolean value simply indicates that a dummy toolchain is used + # (true) boolean value simply indicates that a system toolchain is used elif isinstance(tc_spec, bool) and tc_spec: - tc = {'name': DUMMY_TOOLCHAIN_NAME, 'version': DUMMY_TOOLCHAIN_VERSION} + tc = {'name': SYSTEM_TOOLCHAIN_NAME, 'version': ''} # two-element list/tuple value indicates custom toolchain specification elif isinstance(tc_spec, (list, tuple,)): @@ -1256,9 +1256,9 @@ def _finalize_dependencies(self): self.log.debug("Skipping filtered dependency %s when finalising dependencies", orig_dep['name']) continue - # handle dependencies with inherited (non-dummy) toolchain + # handle dependencies with inherited (non-system) toolchain # this *must* be done after parsing all dependencies, to avoid problems with templates like %(pyver)s - if dep['toolchain_inherited'] and dep['toolchain']['name'] != DUMMY_TOOLCHAIN_NAME: + if dep['toolchain_inherited'] and not is_system_toolchain(dep['toolchain']['name']): tc = None dep_str = '%s %s%s' % (dep['name'], dep['version'], dep['versionsuffix']) self.log.debug("Figuring out toolchain to use for dep %s...", dep) @@ -1284,8 +1284,8 @@ def _finalize_dependencies(self): dep['toolchain_inherited'] = orig_dep['toolchain_inherited'] = False if not dep['external_module']: - # make sure 'dummy' is set correctly - orig_dep['dummy'] = dep['toolchain']['name'] == DUMMY_TOOLCHAIN_NAME + # make sure 'system' is set correctly + orig_dep[SYSTEM_TOOLCHAIN_NAME] = is_system_toolchain(dep['toolchain']['name']) # set module names orig_dep['short_mod_name'] = ActiveMNS().det_short_module_name(dep) @@ -1683,7 +1683,7 @@ def process_easyconfig(path, build_specs=None, validate=True, parse_only=False, easyconfig['dependencies'].append(dep) # add toolchain as dependency too - if ec['toolchain']['name'] != DUMMY_TOOLCHAIN_NAME: + if not is_system_toolchain(ec['toolchain']['name']): tc = ec.toolchain.as_dict() _log.debug("Adding toolchain %s as dependency for app %s." % (tc, name)) easyconfig['dependencies'].append(tc) @@ -1845,7 +1845,7 @@ def robot_find_subtoolchain_for_dep(dep, modtool, parent_tc=None, parent_first=F print_warning(warning_msg, silent=build_option('silent')) toolchain_hierarchy = [] - # start with subtoolchains first, i.e. first (dummy or) compiler-only toolchain, etc., + # start with subtoolchains first, i.e. first (system or) compiler-only toolchain, etc., # unless parent toolchain should be considered first if parent_first: toolchain_hierarchy = toolchain_hierarchy[::-1] diff --git a/easybuild/framework/easyconfig/format/one.py b/easybuild/framework/easyconfig/format/one.py index 2cfaafe63d..f77042ec3b 100644 --- a/easybuild/framework/easyconfig/format/one.py +++ b/easybuild/framework/easyconfig/format/one.py @@ -44,6 +44,7 @@ from easybuild.framework.easyconfig.templates import to_template_str from easybuild.tools.build_log import EasyBuildError, print_msg from easybuild.tools.filetools import read_file, write_file +from easybuild.tools.toolchain.toolchain import SYSTEM_TOOLCHAIN_NAME from easybuild.tools.py2vs3 import string_type from easybuild.tools.utilities import INDENT_4SPACES, quote_py_str @@ -72,7 +73,7 @@ def dump_dependency(dep, toolchain): # mininal spec: (name, version) tup = (dep['name'], dep['version']) if dep['toolchain'] != toolchain: - if dep['dummy']: + if dep[SYSTEM_TOOLCHAIN_NAME]: tup += (dep['versionsuffix'], True) else: tup += (dep['versionsuffix'], (dep['toolchain']['name'], dep['toolchain']['version'])) diff --git a/easybuild/framework/easyconfig/format/version.py b/easybuild/framework/easyconfig/format/version.py index 117f40208e..b337f18ee6 100644 --- a/easybuild/framework/easyconfig/format/version.py +++ b/easybuild/framework/easyconfig/format/version.py @@ -45,8 +45,6 @@ class EasyVersion(LooseVersion): """Exact LooseVersion. No modifications needed (yet)""" - # TODO: replace all LooseVersion with EasyVersion in eb, after moving EasyVersion to easybuild/tools? - # TODO: is dummy some magic version? (ie do we need special attributes for dummy versions?) def __len__(self): """Determine length of this EasyVersion instance.""" @@ -152,7 +150,7 @@ def test(self, test_version): try: res = self.operator(test_version, self.version) except TypeError: - # fallback for case when 'dummy' version is compared with proper version + # fallback for case when string-value version (e.g. 'dummy') is compared with proper version # this results in a TypeError in Python 3 (comparing 'str' with 'int'), but not in Python 2 # any comparison is meaningless in this case, so always returning True as result should be fine res = True diff --git a/easybuild/framework/easyconfig/tools.py b/easybuild/framework/easyconfig/tools.py index 4debf27a6d..a0e2e60c3c 100644 --- a/easybuild/framework/easyconfig/tools.py +++ b/easybuild/framework/easyconfig/tools.py @@ -57,7 +57,7 @@ from easybuild.tools.github import fetch_easyconfigs_from_pr, download_repo from easybuild.tools.multidiff import multidiff from easybuild.tools.py2vs3 import OrderedDict -from easybuild.tools.toolchain.toolchain import DUMMY_TOOLCHAIN_NAME +from easybuild.tools.toolchain.toolchain import is_system_toolchain from easybuild.tools.toolchain.utilities import search_toolchain from easybuild.tools.utilities import only_if_module_is_available, quote_str from easybuild.tools.version import VERSION as EASYBUILD_VERSION @@ -441,7 +441,7 @@ def find_related_easyconfigs(path, ec): toolchain_name = ec['toolchain']['name'] toolchain_name_pattern = r'-%s-\S+' % toolchain_name toolchain_pattern = '-%s-%s' % (toolchain_name, ec['toolchain']['version']) - if toolchain_name == DUMMY_TOOLCHAIN_NAME: + if is_system_toolchain(toolchain_name): toolchain_name_pattern = '' toolchain_pattern = '' diff --git a/easybuild/framework/easyconfig/tweak.py b/easybuild/framework/easyconfig/tweak.py index ef7a651728..b80230b2cc 100644 --- a/easybuild/framework/easyconfig/tweak.py +++ b/easybuild/framework/easyconfig/tweak.py @@ -43,6 +43,7 @@ from distutils.version import LooseVersion from easybuild.base import fancylogger +from easybuild.framework.easyconfig.constants import EASYCONFIG_CONSTANTS from easybuild.framework.easyconfig.default import get_easyconfig_parameter_default from easybuild.framework.easyconfig.easyconfig import EasyConfig, create_paths, process_easyconfig from easybuild.framework.easyconfig.easyconfig import get_toolchain_hierarchy, ActiveMNS @@ -53,7 +54,7 @@ from easybuild.tools.filetools import read_file, write_file from easybuild.tools.module_naming_scheme.utilities import det_full_ec_version from easybuild.tools.robot import resolve_dependencies, robot_find_easyconfig -from easybuild.tools.toolchain.toolchain import DUMMY_TOOLCHAIN_NAME +from easybuild.tools.toolchain.toolchain import SYSTEM_TOOLCHAIN_NAME from easybuild.tools.toolchain.toolchain import TOOLCHAIN_CAPABILITIES from easybuild.tools.utilities import flatten, nub, quote_str @@ -248,7 +249,13 @@ def tweak_one(orig_ec, tweaked_ec, tweaks, targetdir=None): if not res: raise EasyBuildError("No toolchain found in easyconfig file %s: %s", orig_ec, ectxt) - toolchain = eval(res.group(1)) + # need to treat toolchain specified via 'SYSTEM' constant separately, + # since SYSTEM constant is not defined during 'eval' + if res.group(1) == 'SYSTEM': + toolchain = copy.copy(EASYCONFIG_CONSTANTS['SYSTEM'][0]) + else: + toolchain = eval(res.group(1)) + for key in ['name', 'version']: tc_key = "toolchain_%s" % key if tc_key in keys: @@ -455,7 +462,7 @@ def select_or_generate_ec(fp, paths, specs): # find ALL available easyconfig files for specified software cfg = { 'version': '*', - 'toolchain': {'name': DUMMY_TOOLCHAIN_NAME, 'version': '*'}, + 'toolchain': {'name': SYSTEM_TOOLCHAIN_NAME, 'version': '*'}, 'versionprefix': '*', 'versionsuffix': '*', } diff --git a/easybuild/toolchains/clanggcc.py b/easybuild/toolchains/clanggcc.py index 7710d55d68..6a35c270fc 100644 --- a/easybuild/toolchains/clanggcc.py +++ b/easybuild/toolchains/clanggcc.py @@ -32,7 +32,7 @@ """ from easybuild.toolchains.compiler.clang import Clang from easybuild.toolchains.compiler.gcc import Gcc -from easybuild.tools.toolchain.toolchain import DUMMY_TOOLCHAIN_NAME +from easybuild.tools.toolchain.toolchain import SYSTEM_TOOLCHAIN_NAME TC_CONSTANT_CLANGGCC = "ClangGCC" @@ -43,4 +43,4 @@ class ClangGcc(Clang, Gcc): NAME = 'ClangGCC' COMPILER_MODULE_NAME = ['Clang', 'GCC'] COMPILER_FAMILY = TC_CONSTANT_CLANGGCC - SUBTOOLCHAIN = DUMMY_TOOLCHAIN_NAME + SUBTOOLCHAIN = SYSTEM_TOOLCHAIN_NAME diff --git a/easybuild/toolchains/compiler/systemcompiler.py b/easybuild/toolchains/compiler/systemcompiler.py new file mode 100644 index 0000000000..f4c1bfd551 --- /dev/null +++ b/easybuild/toolchains/compiler/systemcompiler.py @@ -0,0 +1,40 @@ +## +# Copyright 2019-2019 Ghent University +# +# This file is part of EasyBuild, +# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), +# with support of Ghent University (http://ugent.be/hpc), +# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), +# Flemish Research Foundation (FWO) (http://www.fwo.be/en) +# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). +# +# https://github.com/easybuilders/easybuild +# +# EasyBuild is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation v2. +# +# EasyBuild is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with EasyBuild. If not, see . +## +""" +Support for system compiler. + +:author: Kenneth Hoste (Ghent University) +""" + +from easybuild.tools.toolchain.compiler import Compiler + + +TC_CONSTANT_SYSTEM = 'SYSTEM' + + +class SystemCompiler(Compiler): + """System compiler""" + COMPILER_MODULE_NAME = [] + COMPILER_FAMILY = TC_CONSTANT_SYSTEM diff --git a/easybuild/toolchains/craycce.py b/easybuild/toolchains/craycce.py index 5e8f414837..41fc4d831b 100644 --- a/easybuild/toolchains/craycce.py +++ b/easybuild/toolchains/craycce.py @@ -31,10 +31,10 @@ from easybuild.toolchains.compiler.craype import CrayPECray from easybuild.toolchains.linalg.libsci import LibSci from easybuild.toolchains.mpi.craympich import CrayMPICH -from easybuild.tools.toolchain.toolchain import DUMMY_TOOLCHAIN_NAME +from easybuild.tools.toolchain.toolchain import SYSTEM_TOOLCHAIN_NAME class CrayCCE(CrayPECray, CrayMPICH, LibSci): """Compiler toolchain for Cray Programming Environment for Cray Compiling Environment (CCE) (PrgEnv-cray).""" NAME = 'CrayCCE' - SUBTOOLCHAIN = DUMMY_TOOLCHAIN_NAME + SUBTOOLCHAIN = SYSTEM_TOOLCHAIN_NAME diff --git a/easybuild/toolchains/craygnu.py b/easybuild/toolchains/craygnu.py index 46ee734b0e..ef4a6365d9 100644 --- a/easybuild/toolchains/craygnu.py +++ b/easybuild/toolchains/craygnu.py @@ -31,10 +31,10 @@ from easybuild.toolchains.compiler.craype import CrayPEGCC from easybuild.toolchains.linalg.libsci import LibSci from easybuild.toolchains.mpi.craympich import CrayMPICH -from easybuild.tools.toolchain.toolchain import DUMMY_TOOLCHAIN_NAME +from easybuild.tools.toolchain.toolchain import SYSTEM_TOOLCHAIN_NAME class CrayGNU(CrayPEGCC, CrayMPICH, LibSci): """Compiler toolchain for Cray Programming Environment for GCC compilers (PrgEnv-gnu).""" NAME = 'CrayGNU' - SUBTOOLCHAIN = DUMMY_TOOLCHAIN_NAME + SUBTOOLCHAIN = SYSTEM_TOOLCHAIN_NAME diff --git a/easybuild/toolchains/crayintel.py b/easybuild/toolchains/crayintel.py index ee86963755..051ff17c57 100644 --- a/easybuild/toolchains/crayintel.py +++ b/easybuild/toolchains/crayintel.py @@ -31,10 +31,10 @@ from easybuild.toolchains.compiler.craype import CrayPEIntel from easybuild.toolchains.linalg.libsci import LibSci from easybuild.toolchains.mpi.craympich import CrayMPICH -from easybuild.tools.toolchain.toolchain import DUMMY_TOOLCHAIN_NAME +from easybuild.tools.toolchain.toolchain import SYSTEM_TOOLCHAIN_NAME class CrayIntel(CrayPEIntel, CrayMPICH, LibSci): """Compiler toolchain for Cray Programming Environment for Intel compilers (PrgEnv-intel).""" NAME = 'CrayIntel' - SUBTOOLCHAIN = DUMMY_TOOLCHAIN_NAME + SUBTOOLCHAIN = SYSTEM_TOOLCHAIN_NAME diff --git a/easybuild/toolchains/craypgi.py b/easybuild/toolchains/craypgi.py index 4b189b85aa..5536459042 100644 --- a/easybuild/toolchains/craypgi.py +++ b/easybuild/toolchains/craypgi.py @@ -28,9 +28,10 @@ """ from easybuild.toolchains.compiler.craype import CrayPEPGI from easybuild.toolchains.mpi.craympich import CrayMPICH -from easybuild.tools.toolchain.toolchain import DUMMY_TOOLCHAIN_NAME +from easybuild.tools.toolchain.toolchain import SYSTEM_TOOLCHAIN_NAME + class CrayPGI(CrayPEPGI, CrayMPICH): """Compiler toolchain for Cray Programming Environment for Cray Compiling Environment (PGI) (PrgEnv-pgi).""" NAME = 'CrayPGI' - SUBTOOLCHAIN = DUMMY_TOOLCHAIN_NAME + SUBTOOLCHAIN = SYSTEM_TOOLCHAIN_NAME diff --git a/easybuild/toolchains/gcc.py b/easybuild/toolchains/gcc.py index 16b8de69eb..fb3fa8275b 100644 --- a/easybuild/toolchains/gcc.py +++ b/easybuild/toolchains/gcc.py @@ -29,11 +29,12 @@ """ from easybuild.toolchains.gcccore import GCCcore -from easybuild.tools.toolchain.toolchain import DUMMY_TOOLCHAIN_NAME +from easybuild.tools.toolchain.toolchain import SYSTEM_TOOLCHAIN_NAME + class GccToolchain(GCCcore): """Simple toolchain with just the GCC compilers.""" NAME = 'GCC' COMPILER_MODULE_NAME = [NAME] - SUBTOOLCHAIN = [GCCcore.NAME, DUMMY_TOOLCHAIN_NAME] + SUBTOOLCHAIN = [GCCcore.NAME, SYSTEM_TOOLCHAIN_NAME] OPTIONAL = False diff --git a/easybuild/toolchains/gcccore.py b/easybuild/toolchains/gcccore.py index 705c3ccb3d..846e650d57 100644 --- a/easybuild/toolchains/gcccore.py +++ b/easybuild/toolchains/gcccore.py @@ -29,7 +29,7 @@ """ from easybuild.toolchains.compiler.gcc import Gcc -from easybuild.tools.toolchain.toolchain import DUMMY_TOOLCHAIN_NAME +from easybuild.tools.toolchain.toolchain import SYSTEM_TOOLCHAIN_NAME class GCCcore(Gcc): @@ -37,7 +37,7 @@ class GCCcore(Gcc): NAME = 'GCCcore' # Replace the default compiler module name with our own COMPILER_MODULE_NAME = [NAME] - SUBTOOLCHAIN = DUMMY_TOOLCHAIN_NAME + SUBTOOLCHAIN = SYSTEM_TOOLCHAIN_NAME # GCCcore is only guaranteed to be present in recent toolchains # for old versions of some toolchains (GCC, intel) it is not part of the hierarchy and hence optional OPTIONAL = True diff --git a/easybuild/toolchains/gnu.py b/easybuild/toolchains/gnu.py index ede9ff34bb..1593f7cc0d 100644 --- a/easybuild/toolchains/gnu.py +++ b/easybuild/toolchains/gnu.py @@ -29,10 +29,10 @@ """ from easybuild.toolchains.compiler.gcc import Gcc -from easybuild.tools.toolchain.toolchain import DUMMY_TOOLCHAIN_NAME +from easybuild.tools.toolchain.toolchain import SYSTEM_TOOLCHAIN_NAME class GNU(Gcc): """Compiler-only toolchain, including only GCC and binutils.""" NAME = 'GNU' - SUBTOOLCHAIN = DUMMY_TOOLCHAIN_NAME + SUBTOOLCHAIN = SYSTEM_TOOLCHAIN_NAME diff --git a/easybuild/toolchains/iccifort.py b/easybuild/toolchains/iccifort.py index c7b99f58c6..1ab9058f6b 100644 --- a/easybuild/toolchains/iccifort.py +++ b/easybuild/toolchains/iccifort.py @@ -33,7 +33,7 @@ from easybuild.toolchains.compiler.inteliccifort import IntelIccIfort from easybuild.toolchains.gcccore import GCCcore -from easybuild.tools.toolchain.toolchain import DUMMY_TOOLCHAIN_NAME +from easybuild.tools.toolchain.toolchain import SYSTEM_TOOLCHAIN_NAME class IccIfort(IntelIccIfort): @@ -41,7 +41,7 @@ class IccIfort(IntelIccIfort): NAME = 'iccifort' # use GCCcore as subtoolchain rather than GCC, since two 'real' compiler-only toolchains don't mix well, # in particular in a hierarchical module naming scheme - SUBTOOLCHAIN = [GCCcore.NAME, DUMMY_TOOLCHAIN_NAME] + SUBTOOLCHAIN = [GCCcore.NAME, SYSTEM_TOOLCHAIN_NAME] OPTIONAL = False def is_deprecated(self): diff --git a/easybuild/toolchains/pgi.py b/easybuild/toolchains/pgi.py index 9012a3d65a..79e151f888 100644 --- a/easybuild/toolchains/pgi.py +++ b/easybuild/toolchains/pgi.py @@ -33,7 +33,7 @@ from easybuild.toolchains.compiler.pgi import Pgi from easybuild.toolchains.gcccore import GCCcore -from easybuild.tools.toolchain.toolchain import DUMMY_TOOLCHAIN_NAME +from easybuild.tools.toolchain.toolchain import SYSTEM_TOOLCHAIN_NAME class PgiToolchain(Pgi): @@ -41,5 +41,5 @@ class PgiToolchain(Pgi): NAME = 'PGI' # use GCCcore as subtoolchain rather than GCC, since two 'real' compiler-only toolchains don't mix well, # in particular in a hierarchical module naming scheme - SUBTOOLCHAIN = [GCCcore.NAME, DUMMY_TOOLCHAIN_NAME] + SUBTOOLCHAIN = [GCCcore.NAME, SYSTEM_TOOLCHAIN_NAME] OPTIONAL = False diff --git a/easybuild/toolchains/system.py b/easybuild/toolchains/system.py new file mode 100644 index 0000000000..95a841851c --- /dev/null +++ b/easybuild/toolchains/system.py @@ -0,0 +1,37 @@ +## +# Copyright 2019-2019 Ghent University +# +# This file is part of EasyBuild, +# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), +# with support of Ghent University (http://ugent.be/hpc), +# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), +# Flemish Research Foundation (FWO) (http://www.fwo.be/en) +# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). +# +# https://github.com/easybuilders/easybuild +# +# EasyBuild is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation v2. +# +# EasyBuild is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with EasyBuild. If not, see . +## +""" +EasyBuild support for system compiler toolchain. + +:author: Kenneth Hoste (Ghent University) +""" + +from easybuild.tools.toolchain.toolchain import SYSTEM_TOOLCHAIN_NAME +from easybuild.toolchains.compiler.systemcompiler import SystemCompiler + + +class SystemToolchain(SystemCompiler): + """System toolchain.""" + NAME = SYSTEM_TOOLCHAIN_NAME diff --git a/easybuild/tools/config.py b/easybuild/tools/config.py index 6d51b02bf7..934b2a6d34 100644 --- a/easybuild/tools/config.py +++ b/easybuild/tools/config.py @@ -193,7 +193,7 @@ def mk_full_default_path(name, prefix=DEFAULT_PREFIX): 'zip_logs', ], False: [ - 'add_dummy_to_minimal_toolchains', + 'add_system_to_minimal_toolchains', 'allow_modules_tool_mismatch', 'consider_archived_easyconfigs', 'container_build_image', diff --git a/easybuild/tools/docs.py b/easybuild/tools/docs.py index cad7b109ac..a45e5fc35b 100644 --- a/easybuild/tools/docs.py +++ b/easybuild/tools/docs.py @@ -58,7 +58,7 @@ from easybuild.tools.filetools import read_file from easybuild.tools.modules import modules_tool from easybuild.tools.py2vs3 import OrderedDict, ascii_lowercase -from easybuild.tools.toolchain.toolchain import DUMMY_TOOLCHAIN_NAME +from easybuild.tools.toolchain.toolchain import DUMMY_TOOLCHAIN_NAME, SYSTEM_TOOLCHAIN_NAME, is_system_toolchain from easybuild.tools.toolchain.utilities import search_toolchain from easybuild.tools.utilities import INDENT_2SPACES, INDENT_4SPACES from easybuild.tools.utilities import import_available_modules, mk_rst_table, nub, quote_str @@ -526,8 +526,8 @@ def list_software(output_format=FORMAT_TXT, detailed=False, only_installed=False software = {} for ec in ecs: software.setdefault(ec['name'], []) - if ec['toolchain']['name'] == DUMMY_TOOLCHAIN_NAME: - toolchain = DUMMY_TOOLCHAIN_NAME + if is_system_toolchain(ec['toolchain']['name']): + toolchain = SYSTEM_TOOLCHAIN_NAME else: toolchain = '%s/%s' % (ec['toolchain']['name'], ec['toolchain']['version']) @@ -710,6 +710,11 @@ def list_toolchains(output_format=FORMAT_TXT): tcs = dict() for (tcname, tcc) in tclist: + + # filter deprecated 'dummy' toolchain + if tcname == DUMMY_TOOLCHAIN_NAME: + continue + tc = tcc(version='1.2.3') # version doesn't matter here, but something needs to be there tcs[tcname] = tc.definition() diff --git a/easybuild/tools/module_naming_scheme/hierarchical_mns.py b/easybuild/tools/module_naming_scheme/hierarchical_mns.py index a43abd683f..8206f1d70e 100644 --- a/easybuild/tools/module_naming_scheme/hierarchical_mns.py +++ b/easybuild/tools/module_naming_scheme/hierarchical_mns.py @@ -99,7 +99,7 @@ def det_toolchain_compilers_name_version(self, tc_comps): Determine toolchain compiler tag, for given list of compilers. """ if tc_comps is None: - # no compiler in toolchain, dummy toolchain + # no compiler in toolchain, system toolchain res = None elif len(tc_comps) == 1: res = (tc_comps[0]['name'], self.det_full_version(tc_comps[0])) @@ -128,7 +128,7 @@ def det_module_subdir(self, ec): tc_comps = det_toolchain_compilers(ec) # determine prefix based on type of toolchain used if tc_comps is None: - # no compiler in toolchain, dummy toolchain => Core module + # no compiler in toolchain, system toolchain => Core module subdir = CORE else: tc_comp_name, tc_comp_ver = self.det_toolchain_compilers_name_version(tc_comps) @@ -162,12 +162,12 @@ def det_modpath_extensions(self, ec): # we consider the following to be compilers: # * has 'compiler' specified as moduleclass is_compiler = modclass == MODULECLASS_COMPILER - # * CUDA, but only when not installed with 'dummy' toolchain (i.e. one or more toolchain compilers found) - non_dummy_tc = tc_comps is not None - non_dummy_cuda = ec['name'] == 'CUDA' and non_dummy_tc + # * CUDA, but only when not installed with 'system' toolchain (i.e. one or more toolchain compilers found) + non_system_tc = tc_comps is not None + non_system_cuda = ec['name'] == 'CUDA' and non_system_tc paths = [] - if is_compiler or non_dummy_cuda: + if is_compiler or non_system_cuda: # obtain list of compilers based on that extend $MODULEPATH in some way other than / extend_comps = [] # exclude GCC for which / is used as $MODULEPATH extension @@ -186,10 +186,10 @@ def det_modpath_extensions(self, ec): # 'icc' key should be provided since it's the only one used in the template comp_versions.update({'icc': self.det_full_version(ec)}) - if non_dummy_tc: + if non_system_tc: tc_comp_name, tc_comp_ver = tc_comp_info if tc_comp_name in comp_names: - # also provide toolchain version for non-dummy toolchains + # also provide toolchain version for non-system toolchains comp_versions.update({tc_comp_name: tc_comp_ver}) comp_ver_keys = re.findall(r'%\((\w+)\)s', comp_ver_tmpl) diff --git a/easybuild/tools/module_naming_scheme/toolchain.py b/easybuild/tools/module_naming_scheme/toolchain.py index 090db57a4a..62648bc8b8 100644 --- a/easybuild/tools/module_naming_scheme/toolchain.py +++ b/easybuild/tools/module_naming_scheme/toolchain.py @@ -31,7 +31,6 @@ from easybuild.framework.easyconfig.easyconfig import process_easyconfig, robot_find_easyconfig from easybuild.tools.build_log import EasyBuildError from easybuild.tools.module_naming_scheme.utilities import det_full_ec_version -from easybuild.tools.toolchain.toolchain import DUMMY_TOOLCHAIN_NAME _log = fancylogger.getLogger('module_naming_scheme.toolchain', fname=False) @@ -89,8 +88,8 @@ def det_toolchain_compilers(ec): :param ec: a parsed EasyConfig file (an AttributeError will occur if a simple dict is passed) """ tc_elems = ec.toolchain.definition() - if ec.toolchain.name == DUMMY_TOOLCHAIN_NAME: - # dummy toolchain has no compiler + if ec.toolchain.is_system_toolchain(): + # system toolchain has no (real) compiler component tc_comps = None elif TOOLCHAIN_COMPILER not in tc_elems: # every toolchain should have at least a compiler diff --git a/easybuild/tools/module_naming_scheme/utilities.py b/easybuild/tools/module_naming_scheme/utilities.py index 5c3855267e..d3daa67aa6 100644 --- a/easybuild/tools/module_naming_scheme/utilities.py +++ b/easybuild/tools/module_naming_scheme/utilities.py @@ -38,7 +38,7 @@ from easybuild.base import fancylogger from easybuild.tools.module_naming_scheme.mns import ModuleNamingScheme from easybuild.tools.py2vs3 import string_type -from easybuild.tools.toolchain.toolchain import DUMMY_TOOLCHAIN_NAME +from easybuild.tools.toolchain.toolchain import SYSTEM_TOOLCHAIN_NAME, is_system_toolchain from easybuild.tools.utilities import get_subclasses, import_available_modules _log = fancylogger.getLogger('module_naming_scheme.utilities', fname=False) @@ -47,14 +47,14 @@ def det_full_ec_version(ec): """ Determine exact install version, based on supplied easyconfig. - e.g. 1.2.3-goalf-1.1.0-no-OFED or 1.2.3 (for dummy toolchains) + e.g. 1.2.3-goalf-1.1.0-no-OFED or 1.2.3 (for system toolchains) """ ecver = None - toolchain = ec.get('toolchain', {'name': DUMMY_TOOLCHAIN_NAME}) + toolchain = ec.get('toolchain', {'name': SYSTEM_TOOLCHAIN_NAME}) # determine main install version based on toolchain - if toolchain['name'] == DUMMY_TOOLCHAIN_NAME: + if is_system_toolchain(toolchain['name']): ecver = ec['version'] else: ecver = "%s-%s-%s" % (ec['version'], toolchain['name'], toolchain['version']) diff --git a/easybuild/tools/options.py b/easybuild/tools/options.py index b0b6d803f5..23d71ce4be 100644 --- a/easybuild/tools/options.py +++ b/easybuild/tools/options.py @@ -314,8 +314,8 @@ def override_options(self): descr = ("Override options", "Override default EasyBuild behavior.") opts = OrderedDict({ - 'add-dummy-to-minimal-toolchains': ("Include dummy in minimal toolchain searches", - None, 'store_true', False), + 'add-system-to-minimal-toolchains': ("Include system toolchain in minimal toolchain searches", + None, 'store_true', False), 'allow-loaded-modules': ("List of software names for which to allow loaded modules in initial environment", 'strlist', 'store', DEFAULT_ALLOW_LOADED_MODULES), 'allow-modules-tool-mismatch': ("Allow mismatch of modules tool and definition of 'module' function", diff --git a/easybuild/tools/package/utilities.py b/easybuild/tools/package/utilities.py index fd5cdbbedc..c3a394439b 100644 --- a/easybuild/tools/package/utilities.py +++ b/easybuild/tools/package/utilities.py @@ -43,7 +43,6 @@ from easybuild.tools.filetools import change_dir, which from easybuild.tools.package.package_naming_scheme.pns import PackageNamingScheme from easybuild.tools.run import run_cmd -from easybuild.tools.toolchain.toolchain import DUMMY_TOOLCHAIN_NAME from easybuild.tools.utilities import get_subclasses, import_available_modules @@ -112,7 +111,7 @@ def package_with_fpm(easyblock): cmdlist.append('--debug') deps = [] - if easyblock.toolchain.name != DUMMY_TOOLCHAIN_NAME: + if not easyblock.toolchain.is_system_toolchain(): toolchain_dict = easyblock.toolchain.as_dict() deps.extend([toolchain_dict]) diff --git a/easybuild/tools/toolchain/toolchain.py b/easybuild/tools/toolchain/toolchain.py index 9981589632..11143cfe08 100644 --- a/easybuild/tools/toolchain/toolchain.py +++ b/easybuild/tools/toolchain/toolchain.py @@ -74,9 +74,12 @@ # name/version for dummy toolchain # if name==DUMMY_TOOLCHAIN_NAME and version==DUMMY_TOOLCHAIN_VERSION, do not load dependencies +# NOTE: use of 'dummy' toolchain is deprecated, replaced by 'system' toolchain (which always loads dependencies) DUMMY_TOOLCHAIN_NAME = 'dummy' DUMMY_TOOLCHAIN_VERSION = 'dummy' +SYSTEM_TOOLCHAIN_NAME = 'system' + CCACHE = 'ccache' F90CACHE = 'f90cache' @@ -98,6 +101,11 @@ ] +def is_system_toolchain(tc_name): + """Return whether toolchain with specified name is a system toolchain or not.""" + return tc_name in [DUMMY_TOOLCHAIN_NAME, SYSTEM_TOOLCHAIN_NAME] + + class Toolchain(object): """General toolchain class""" @@ -152,6 +160,10 @@ def __init__(self, name=None, version=None, mns=None, class_constants=None, tcde if name is None: raise EasyBuildError("Toolchain init: no name provided") self.name = name + if self.name == DUMMY_TOOLCHAIN_NAME: + self.log.deprecated("Use of 'dummy' toolchain is deprecated, use 'system' toolchain instead", '5.0') + self.name = SYSTEM_TOOLCHAIN_NAME + if version is None: version = self.VERSION if version is None: @@ -178,7 +190,7 @@ def __init__(self, name=None, version=None, mns=None, class_constants=None, tcde self.mod_full_name = None self.mod_short_name = None self.init_modpaths = None - if self.name != DUMMY_TOOLCHAIN_NAME: + if not self.is_system_toolchain(): # sometimes no module naming scheme class instance can/will be provided, e.g. with --list-toolchains if self.mns is not None: tc_dict = self.as_dict() @@ -186,6 +198,10 @@ def __init__(self, name=None, version=None, mns=None, class_constants=None, tcde self.mod_short_name = self.mns.det_short_module_name(tc_dict) self.init_modpaths = self.mns.det_init_modulepaths(tc_dict) + def is_system_toolchain(self): + """Return boolean to indicate whether this toolchain is a system(/dummy) toolchain.""" + return is_system_toolchain(self.name) + def base_init(self): """Initialise missing class attributes (log, options, variables).""" if not hasattr(self, 'log'): @@ -340,13 +356,13 @@ def as_dict(self, name=None, version=None): return { 'name': name, 'version': version, - 'toolchain': {'name': DUMMY_TOOLCHAIN_NAME, 'version': DUMMY_TOOLCHAIN_VERSION}, + 'toolchain': {'name': SYSTEM_TOOLCHAIN_NAME, 'version': ''}, 'versionsuffix': '', - 'dummy': True, 'parsed': True, # pretend this is a parsed easyconfig file, as may be required by det_short_module_name 'hidden': self.hidden, 'full_mod_name': self.mod_full_name, 'short_mod_name': self.mod_short_name, + SYSTEM_TOOLCHAIN_NAME: True, } def det_short_module_name(self): @@ -359,9 +375,9 @@ def _toolchain_exists(self): """ Verify if there exists a toolchain by this name and version """ - # short-circuit to returning module name for this (non-dummy) toolchain - if self.name == DUMMY_TOOLCHAIN_NAME: - self.log.devel("_toolchain_exists: %s toolchain always exists, returning True", DUMMY_TOOLCHAIN_NAME) + # short-circuit to returning module name for this (non-system) toolchain + if self.is_system_toolchain(): + self.log.devel("_toolchain_exists: system toolchain always exists, returning True") return True else: if self.mod_short_name is None: @@ -382,16 +398,14 @@ def set_options(self, options): def get_dependency_version(self, dependency): """ Generate a version string for a dependency on a module using this toolchain """ - # Add toolchain to version string - toolchain = '' - if self.name != DUMMY_TOOLCHAIN_NAME: + # add toolchain to version string (only for non-system toolchain) + if self.is_system_toolchain(): + toolchain = '' + else: toolchain = '-%s-%s' % (self.name, self.version) - elif self.version != DUMMY_TOOLCHAIN_VERSION: - toolchain = '%s' % (self.version) - # Check if dependency is independent of toolchain - # TODO: assuming dummy here, what about version? - if DUMMY_TOOLCHAIN_NAME in dependency and dependency[DUMMY_TOOLCHAIN_NAME]: + # check if dependency is independent of toolchain (i.e. whether is was built with system compiler) + if SYSTEM_TOOLCHAIN_NAME in dependency and dependency[SYSTEM_TOOLCHAIN_NAME]: toolchain = '' suffix = dependency.get('versionsuffix', '') @@ -621,13 +635,8 @@ def _load_modules(self, silent=False): if not self._toolchain_exists() and not self.dry_run: raise EasyBuildError("No module found for toolchain: %s", self.mod_short_name) - if self.name == DUMMY_TOOLCHAIN_NAME: - if self.version == DUMMY_TOOLCHAIN_VERSION: - self.log.info('prepare: toolchain dummy mode, dummy version; not loading dependencies') - if self.dry_run: - dry_run_msg("(no modules are loaded for a dummy-dummy toolchain)", silent=silent) - else: - self.log.info('prepare: toolchain dummy mode and loading dependencies') + if self.is_system_toolchain(): + self.log.info("Loading dependencies using system toolchain...") self._load_dependencies_modules(silent=silent) else: # load the toolchain and dependencies modules @@ -701,7 +710,7 @@ def symlink_commands(self, paths): def compilers(self): """Return list of relevant compilers for this toolchain""" - if self.name == DUMMY_TOOLCHAIN_NAME: + if self.is_system_toolchain(): c_comps = ['gcc', 'g++'] fortran_comps = ['gfortran'] else: @@ -747,7 +756,7 @@ def prepare(self, onlymod=None, deps=None, silent=False, loadmod=True, if loadmod: self._load_modules(silent=silent) - if self.name != DUMMY_TOOLCHAIN_NAME: + if not self.is_system_toolchain(): trace_msg("defining build environment for %s/%s toolchain" % (self.name, self.version)) diff --git a/test/framework/docs.py b/test/framework/docs.py index f1b5bd2aff..a50e34a89a 100644 --- a/test/framework/docs.py +++ b/test/framework/docs.py @@ -136,7 +136,7 @@ def test_list_software(self): r'', r'homepage: http://gcc.gnu.org/', r'', - r' \* GCC v4.6.3: dummy', + r' \* GCC v4.6.3: system', r'', r'\* gzip', r'', @@ -144,7 +144,7 @@ def test_list_software(self): r'', r'homepage: http://www.gzip.org/', r'', - r" \* gzip v1.4: GCC/4.6.3, dummy", + r" \* gzip v1.4: GCC/4.6.3, system", r" \* gzip v1.5: foss/2018a, intel/2018a", '', ])) @@ -197,11 +197,11 @@ def test_list_software(self): r'', r'\*homepage\*: http://gcc.gnu.org/', r'', - r'========= =========', - r'version toolchain', - r'========= =========', - r'``4.6.3`` ``dummy``', - r'========= =========', + r'========= ==========', + r'version toolchain ', + r'========= ==========', + r'``4.6.3`` ``system``', + r'========= ==========', r'', r'', r'\.\. _list_software_gzip_442:', @@ -216,7 +216,7 @@ def test_list_software(self): r'======= ===============================', r'version toolchain ', r'======= ===============================', - r'``1.4`` ``GCC/4.6.3``, ``dummy`` ', + r'``1.4`` ``GCC/4.6.3``, ``system`` ', r'``1.5`` ``foss/2018a``, ``intel/2018a``', r'======= ===============================', ])) @@ -225,17 +225,17 @@ def test_list_software(self): # GCC/4.6.3 is installed, no gzip module installed txt = list_software(output_format='txt', detailed=True, only_installed=True) - self.assertTrue(re.search('^\* GCC', txt, re.M)) - self.assertTrue(re.search('^\s*\* GCC v4.6.3: dummy', txt, re.M)) - self.assertFalse(re.search('^\* gzip', txt, re.M)) - self.assertFalse(re.search('gzip v1\.', txt, re.M)) + self.assertTrue(re.search(r'^\* GCC', txt, re.M)) + self.assertTrue(re.search(r'^\s*\* GCC v4.6.3: system', txt, re.M)) + self.assertFalse(re.search(r'^\* gzip', txt, re.M)) + self.assertFalse(re.search(r'gzip v1\.', txt, re.M)) txt = list_software(output_format='rst', detailed=True, only_installed=True) - self.assertTrue(re.search('^\*GCC\*', txt, re.M)) - self.assertTrue(re.search('4\.6\.3.*dummy', txt, re.M)) - self.assertFalse(re.search('^\*gzip\*', txt, re.M)) - self.assertFalse(re.search('1\.4', txt, re.M)) - self.assertFalse(re.search('1\.5', txt, re.M)) + self.assertTrue(re.search(r'^\*GCC\*', txt, re.M)) + self.assertTrue(re.search(r'4\.6\.3.*system', txt, re.M)) + self.assertFalse(re.search(r'^\*gzip\*', txt, re.M)) + self.assertFalse(re.search(r'1\.4', txt, re.M)) + self.assertFalse(re.search(r'1\.5', txt, re.M)) # check for specific patterns in output for larger set of test easyconfigs build_options = { @@ -252,10 +252,10 @@ def test_list_software(self): '', 'homepage: https://easybuilders.github.io/easybuild', '', - " * toy v0.0: dummy, gompi/2018a", - " * toy v0.0 (versionsuffix: '-deps'): dummy", - " * toy v0.0 (versionsuffix: '-iter'): dummy", - " * toy v0.0 (versionsuffix: '-multiple'): dummy", + " * toy v0.0: gompi/2018a, system", + " * toy v0.0 (versionsuffix: '-deps'): system", + " * toy v0.0 (versionsuffix: '-iter'): system", + " * toy v0.0 (versionsuffix: '-multiple'): system", " * toy v0.0 (versionsuffix: '-test'): gompi/2018a", ] txt = list_software(output_format='txt', detailed=True) @@ -271,15 +271,15 @@ def test_list_software(self): '', '*homepage*: https://easybuilders.github.io/easybuild', '', - '======= ============= ==========================', - 'version versionsuffix toolchain ', - '======= ============= ==========================', - '``0.0`` ``dummy``, ``gompi/2018a``', - '``0.0`` ``-deps`` ``dummy`` ', - '``0.0`` ``-iter`` ``dummy`` ', - '``0.0`` ``-multiple`` ``dummy`` ', - '``0.0`` ``-test`` ``gompi/2018a`` ', - '======= ============= ==========================', + '======= ============= ===========================', + 'version versionsuffix toolchain ', + '======= ============= ===========================', + '``0.0`` ``gompi/2018a``, ``system``', + '``0.0`` ``-deps`` ``system`` ', + '``0.0`` ``-iter`` ``system`` ', + '``0.0`` ``-multiple`` ``system`` ', + '``0.0`` ``-test`` ``gompi/2018a`` ', + '======= ============= ===========================', ] txt = list_software(output_format='rst', detailed=True) lines = txt.split('\n') diff --git a/test/framework/easyblock.py b/test/framework/easyblock.py index 9ec9ea4111..b8eeef3bd5 100644 --- a/test/framework/easyblock.py +++ b/test/framework/easyblock.py @@ -97,7 +97,7 @@ def check_extra_options_format(extra_options): 'version = "%s"' % version, 'homepage = "http://example.com"', 'description = "test easyconfig"', - 'toolchain = {"name":"dummy", "version": "dummy"}', + 'toolchain = SYSTEM', 'exts_list = ["ext1"]', ]) self.writeEC() @@ -214,7 +214,7 @@ def test_fake_module_load(self): 'version = "3.14"', 'homepage = "http://example.com"', 'description = "test easyconfig"', - 'toolchain = {"name": "dummy", "version": "dummy"}', + 'toolchain = SYSTEM', ]) self.writeEC() eb = EasyBlock(EasyConfig(self.eb_file)) @@ -249,7 +249,7 @@ def test_make_module_extend_modpath(self): 'version = "3.14"', 'homepage = "http://example.com"', 'description = "test easyconfig"', - 'toolchain = {"name":"dummy", "version": "dummy"}', + 'toolchain = SYSTEM', 'moduleclass = "compiler"', ]) self.writeEC() @@ -305,7 +305,7 @@ def test_make_module_req(self): 'version = "3.14"', 'homepage = "http://example.com"', 'description = "test easyconfig"', - 'toolchain = {"name":"dummy", "version": "dummy"}', + 'toolchain = SYSTEM', ]) self.writeEC() eb = EasyBlock(EasyConfig(self.eb_file)) @@ -637,7 +637,7 @@ def test_det_iter_cnt(self): 'version = "3.14"', 'homepage = "http://example.com"', 'description = "test easyconfig"', - 'toolchain = {"name": "dummy", "version": "dummy"}', + 'toolchain = SYSTEM', ]) self.writeEC() @@ -675,7 +675,7 @@ def test_extensions_step(self): 'version = "3.14"', 'homepage = "http://example.com"', 'description = "test easyconfig"', - 'toolchain = {"name": "dummy", "version": "dummy"}', + 'toolchain = SYSTEM', 'exts_list = ["ext1"]', ]) self.writeEC() @@ -712,7 +712,7 @@ def test_skip_extensions_step(self): 'version = "3.14"', 'homepage = "http://example.com"', 'description = "test easyconfig"', - 'toolchain = {"name": "dummy", "version": "dummy"}', + 'toolchain = SYSTEM', 'exts_list = ["ext1", "ext2"]', 'exts_filter = ("if [ %(ext_name)s == \'ext2\' ]; then exit 0; else exit 1; fi", "")', 'exts_defaultclass = "DummyExtension"', @@ -735,6 +735,12 @@ def test_skip_extensions_step(self): def test_make_module_step(self): """Test the make_module_step""" + + # put dummy hidden modules in place for test123 dependency + test_mods = os.path.join(self.test_prefix, 'modules') + write_file(os.path.join(test_mods, 'test', '.1.2.3'), '#%Module') + self.modtool.use(test_mods) + name = "pi" version = "3.14" # purposely use a 'nasty' description, that includes (unbalanced) special chars: [, ], {, } @@ -747,18 +753,15 @@ def test_make_module_step(self): 'version = "%s"' % version, 'homepage = "http://example.com"', 'description = "%s"' % descr, - "toolchain = {'name': 'dummy', 'version': 'dummy'}", - "dependencies = [('GCC', '6.4.0-2.28'), ('toy', '0.0-deps')]", + "toolchain = SYSTEM", + "dependencies = [('GCC', '6.4.0-2.28'), ('test', '1.2.3')]", "builddependencies = [('OpenMPI', '2.1.2-GCC-6.4.0-2.28')]", # hidden deps must be included in list of (build)deps - "hiddendependencies = [('toy', '0.0-deps'), ('OpenMPI', '2.1.2-GCC-6.4.0-2.28')]", + "hiddendependencies = [('test', '1.2.3'), ('OpenMPI', '2.1.2-GCC-6.4.0-2.28')]", "modextravars = %s" % str(modextravars), "modextrapaths = %s" % str(modextrapaths), ]) - test_dir = os.path.dirname(os.path.abspath(__file__)) - os.environ['MODULEPATH'] = os.path.join(test_dir, 'modules') - # test if module is generated correctly self.writeEC() ec = EasyConfig(self.eb_file) @@ -819,7 +822,7 @@ def test_make_module_step(self): self.assertTrue(False, "Unknown module syntax: %s" % get_module_syntax()) self.assertTrue(regex.search(txt), "Pattern %s found in %s" % (regex.pattern, txt)) - for (name, ver) in [('toy', '0.0-deps')]: + for (name, ver) in [('test', '1.2.3')]: if get_module_syntax() == 'Tcl': regex = re.compile(r'^\s*module load %s/.%s\s*$' % (name, ver), re.M) elif get_module_syntax() == 'Lua': @@ -861,7 +864,7 @@ def test_gen_dirs(self): "version = '3.14'", "homepage = 'http://example.com'", "description = 'test easyconfig'", - "toolchain = {'name': 'dummy', 'version': 'dummy'}", + "toolchain = SYSTEM", ]) self.writeEC() stdoutorig = sys.stdout @@ -909,7 +912,7 @@ def test_make_builddir(self): "version = '3.14'", "homepage = 'http://example.com'", "description = 'test easyconfig'", - "toolchain = {'name': 'dummy', 'version': 'dummy'}", + "toolchain = SYSTEM", ]) self.writeEC() @@ -1429,7 +1432,7 @@ def test_prepare_step(self): test_easyconfigs = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'easyconfigs', 'test_ecs') ec = process_easyconfig(os.path.join(test_easyconfigs, 't', 'toy', 'toy-0.0.eb'))[0] - mkdir(os.path.join(self.test_buildpath, 'toy', '0.0', 'dummy-dummy'), parents=True) + mkdir(os.path.join(self.test_buildpath, 'toy', '0.0', 'system-system'), parents=True) eb = EasyBlock(ec['ec']) eb.silent = True eb.prepare_step() @@ -1473,14 +1476,14 @@ def test_prepare_step_hmns(self): test_ec = os.path.join(self.test_prefix, 'test.eb') regex = re.compile('^toolchain = .*', re.M) - test_ectxt = regex.sub("toolchain = {'name': 'dummy', 'version': ''}", read_file(toy_ec)) + test_ectxt = regex.sub("toolchain = SYSTEM", read_file(toy_ec)) test_ectxt += "\ndependencies = [('GCC', '6.4.0', '-2.28')]" write_file(test_ec, test_ectxt) test_ec = process_easyconfig(test_ec)[0] eb = EasyBlock(test_ec['ec']) - mkdir(os.path.join(self.test_buildpath, 'toy', '0.0', 'dummy-'), parents=True) + mkdir(os.path.join(self.test_buildpath, 'toy', '0.0', 'system-system'), parents=True) eb.prepare_step() loaded_modules = self.modtool.list() @@ -1589,7 +1592,7 @@ def test_stale_module_caches(self): "version = '1.0.2'", "homepage = 'https://example.com'", "description = '1st test easyconfig'", - "toolchain = {'name': 'dummy', 'version': ''}", + "toolchain = SYSTEM", ]) write_file(ec1, ec1_txt) @@ -1599,7 +1602,7 @@ def test_stale_module_caches(self): "easyblock = 'Toolchain'", "name = 'two'", "version = '2.0'", - "toolchain = {'name': 'dummy', 'version': ''}", + "toolchain = SYSTEM", "homepage = 'https://example.com'", "description = '2nd test easyconfig'", "dependencies = [('one', '1.0')]", diff --git a/test/framework/easyconfig.py b/test/framework/easyconfig.py index dd011a3c5f..e8a5953ee6 100644 --- a/test/framework/easyconfig.py +++ b/test/framework/easyconfig.py @@ -43,7 +43,6 @@ import easybuild.tools.build_log import easybuild.framework.easyconfig as easyconfig -from easybuild.base.fancylogger import setLogLevelDebug, logToScreen from easybuild.framework.easyblock import EasyBlock from easybuild.framework.easyconfig.constants import EXTERNAL_MODULE_MARKER from easybuild.framework.easyconfig.easyconfig import ActiveMNS, EasyConfig, create_paths, copy_easyconfigs @@ -57,6 +56,7 @@ from easybuild.framework.easyconfig.tools import categorize_files_by_type, check_sha256_checksums, dep_graph from easybuild.framework.easyconfig.tools import find_related_easyconfigs, get_paths_for, parse_easyconfigs from easybuild.framework.easyconfig.tweak import obtain_ec_for, tweak_one +from easybuild.toolchains.system import SystemToolchain from easybuild.tools.build_log import EasyBuildError from easybuild.tools.config import module_classes from easybuild.tools.configobj import ConfigObj @@ -142,7 +142,7 @@ def test_mandatory(self): self.contents += '\n' + '\n'.join([ 'homepage = "http://example.com"', 'description = "test easyconfig"', - 'toolchain = {"name": "dummy", "version": "dummy"}', + 'toolchain = SYSTEM', ]) self.prep() @@ -151,7 +151,7 @@ def test_mandatory(self): self.assertEqual(eb['name'], "pi") self.assertEqual(eb['version'], "3.14") self.assertEqual(eb['homepage'], "http://example.com") - self.assertEqual(eb['toolchain'], {"name": "dummy", "version": "dummy"}) + self.assertEqual(eb['toolchain'], {"name": "system", "version": "system"}) self.assertEqual(eb['description'], "test easyconfig") def test_validation(self): @@ -162,7 +162,7 @@ def test_validation(self): 'version = "3.14"', 'homepage = "http://example.com"', 'description = "test easyconfig"', - 'toolchain = {"name":"dummy", "version": "dummy"}', + 'toolchain = SYSTEM', 'stop = "notvalid"', ]) self.prep() @@ -176,7 +176,7 @@ def test_validation(self): ec['osdependencies'] = ['non-existent-dep'] self.assertErrorRegex(EasyBuildError, "OS dependencies were not found", ec.validate) - # dummy toolchain, installversion == version + # system toolchain, installversion == version self.assertEqual(det_full_ec_version(ec), "3.14") os.chmod(self.eb_file, 0o000) @@ -194,6 +194,21 @@ def test_validation(self): error_pattern = "Parsing easyconfig file failed: format requires a mapping \(line 8\)" self.assertErrorRegex(EasyBuildError, error_pattern, EasyConfig, self.eb_file) + def test_system_toolchain_constant(self): + """Test use of SYSTEM constant to specify toolchain.""" + self.contents = '\n'.join([ + 'easyblock = "ConfigureMake"', + 'name = "pi"', + 'version = "3.14"', + 'homepage = "http://example.com"', + 'description = "test easyconfig"', + 'toolchain = SYSTEM', + ]) + self.prep() + eb = EasyConfig(self.eb_file) + self.assertEqual(eb['toolchain'], {'name': 'system', 'version': 'system'}) + self.assertTrue(isinstance(eb.toolchain, SystemToolchain)) + def test_shlib_ext(self): """ inside easyconfigs shared_lib_ext should be set """ self.contents = '\n'.join([ @@ -202,7 +217,7 @@ def test_shlib_ext(self): 'version = "3.14"', 'homepage = "http://example.com"', 'description = "test easyconfig"', - 'toolchain = {"name":"dummy", "version": "dummy"}', + 'toolchain = SYSTEM', 'sanity_check_paths = { "files": ["lib/lib.%s" % SHLIB_EXT] }', ]) self.prep() @@ -346,7 +361,7 @@ def test_exts_list(self): 'version = "3.14"', 'homepage = "http://example.com"', 'description = "test easyconfig"', - 'toolchain = {"name": "dummy", "version": "dummy"}', + 'toolchain = SYSTEM', 'exts_default_options = {', ' "source_tmpl": "gzip-1.4.eb",', # dummy source template to avoid downloading fail ' "source_urls": ["http://example.com/%(name)s/%(version)s"]', @@ -358,9 +373,9 @@ def test_exts_list(self): ' "patches": ["toy-0.0.eb"],', # dummy patch to avoid downloading fail ' "checksums": [', # SHA256 checksum for source (gzip-1.4.eb) - ' "f0235f93773e40a9120e8970e438023d46bbf205d44828beffb60905a8644156",', + ' "6a5abcab719cefa95dca4af0db0d2a9d205d68f775a33b452ec0f2b75b6a3a45",', # SHA256 checksum for 'patch' (toy-0.0.eb) - ' "a79ba0ef5dceb5b8829268247feae8932bed2034c6628ff1d92c84bf45e9a546",', + ' "2d964e0e8f05a7cce0dd83a3e68c9737da14b87b61b8b8b0291d58d4c8d1031c",', ' ],', ' }),', ']', @@ -380,8 +395,8 @@ def test_exts_list(self): self.assertEqual(exts_sources[1]['name'], 'ext2') self.assertEqual(exts_sources[1]['version'], '2.0') self.assertEqual(exts_sources[1]['options'], { - 'checksums': ['f0235f93773e40a9120e8970e438023d46bbf205d44828beffb60905a8644156', - 'a79ba0ef5dceb5b8829268247feae8932bed2034c6628ff1d92c84bf45e9a546'], + 'checksums': ['6a5abcab719cefa95dca4af0db0d2a9d205d68f775a33b452ec0f2b75b6a3a45', + '2d964e0e8f05a7cce0dd83a3e68c9737da14b87b61b8b8b0291d58d4c8d1031c'], 'patches': ['toy-0.0.eb'], 'source_tmpl': 'gzip-1.4.eb', 'source_urls': [('http://example.com', 'suffix')], @@ -412,7 +427,7 @@ def test_extensions_templates(self): 'versionsuffix = "-test"', 'homepage = "http://example.com"', 'description = "test easyconfig"', - 'toolchain = {"name": "dummy", "version": ""}', + 'toolchain = SYSTEM', 'dependencies = [("Python", "3.6.6")]', 'exts_defaultclass = "EB_Toy"', # bogus, but useful to check whether this get resolved @@ -563,7 +578,7 @@ def test_installversion(self): versuff = "|mysuffix" tcname = "GCC" tcver = "4.6.3" - dummy = "dummy" + system = "system" correct_installver = "%s%s-%s-%s%s" % (verpref, ver, tcname, tcver, versuff) cfg = { @@ -578,7 +593,7 @@ def test_installversion(self): correct_installver = "%s%s%s" % (verpref, ver, versuff) cfg = { 'version': ver, - 'toolchain': {'name': dummy, 'version': tcver}, + 'toolchain': {'name': system, 'version': tcver}, 'versionprefix': verpref, 'versionsuffix': versuff, } @@ -611,7 +626,7 @@ def test_obtain_easyconfig(self): 'version = "3.12"', 'homepage = "http://example.com"', 'description = "test easyconfig"', - 'toolchain = {"name": "dummy", "version": "dummy"}', + 'toolchain = SYSTEM', 'patches = %s' % patches ])), (fns[1], "\n".join([ @@ -752,7 +767,7 @@ def test_obtain_easyconfig(self): 'versionsuffix': '', 'toolchain': ec['toolchain'], 'toolchain_inherited': True, - 'dummy': False, + 'system': False, 'short_mod_name': 'testbuildonly/.4.9.3-2.25-GCC-4.8.3', 'full_mod_name': 'testbuildonly/.4.9.3-2.25-GCC-4.8.3', 'build_only': True, @@ -766,7 +781,7 @@ def test_obtain_easyconfig(self): 'versionsuffix': '', 'toolchain': ec['toolchain'], 'toolchain_inherited': True, - 'dummy': False, + 'system': False, 'short_mod_name': 'foo/1.2.3-GCC-4.8.3', 'full_mod_name': 'foo/1.2.3-GCC-4.8.3', 'build_only': False, @@ -780,7 +795,7 @@ def test_obtain_easyconfig(self): 'versionsuffix': '-bleh', 'toolchain': {'name': 'gompi', 'version': '2018a'}, 'toolchain_inherited': False, - 'dummy': False, + 'system': False, 'short_mod_name': 'bar/666-gompi-2018a-bleh', 'full_mod_name': 'bar/666-gompi-2018a-bleh', 'build_only': False, @@ -794,7 +809,7 @@ def test_obtain_easyconfig(self): 'versionsuffix': '', 'toolchain': ec['toolchain'], 'toolchain_inherited': True, - 'dummy': False, + 'system': False, 'short_mod_name': 'test/.3.2.1-GCC-4.8.3', 'full_mod_name': 'test/.3.2.1-GCC-4.8.3', 'build_only': False, @@ -902,7 +917,7 @@ def test_templating(self): 'versionsuffix = "-Python-%%(pyver)s"', 'homepage = "http://example.com/%%(nameletter)s/%%(nameletterlower)s/v%%(version_major)s/"', 'description = "test easyconfig %%(name)s"', - 'toolchain = {"name":"dummy", "version": "dummy2"}', + 'toolchain = SYSTEM', 'source_urls = [GOOGLECODE_SOURCE, GITHUB_SOURCE]', 'sources = [SOURCE_TAR_GZ, (SOURCELOWER_TAR_BZ2, "%(cmd)s")]', 'sanity_check_paths = {', @@ -989,7 +1004,7 @@ def test_build_options(self): 'version = "3.14"', 'homepage = "http://example.com"', 'description = "test easyconfig"', - 'toolchain = {"name":"dummy", "version": "dummy"}', + 'toolchain = SYSTEM', ]) self.contents = orig_contents self.prep() @@ -1059,7 +1074,7 @@ def test_buildininstalldir(self): 'version = "3.14"', 'homepage = "http://example.com"', 'description = "test easyconfig"', - 'toolchain = {"name": "dummy", "version": "dummy"}', + 'toolchain = SYSTEM', 'buildininstalldir = True', ]) self.prep() @@ -1086,7 +1101,7 @@ def test_format_equivalence_basic(self): for eb_file1, eb_file2, specs in [ ('gzip-1.4.eb', 'gzip.eb', {}), ('gzip-1.4.eb', 'gzip.eb', {'version': '1.4'}), - ('gzip-1.4.eb', 'gzip.eb', {'version': '1.4', 'toolchain': {'name': 'dummy', 'version': 'dummy'}}), + ('gzip-1.4.eb', 'gzip.eb', {'version': '1.4', 'toolchain': {'name': 'system', 'version': 'system'}}), ('gzip-1.4-GCC-4.6.3.eb', 'gzip.eb', {'version': '1.4', 'toolchain': {'name': 'GCC', 'version': '4.6.3'}}), ('gzip-1.5-foss-2018a.eb', 'gzip.eb', {'version': '1.5', 'toolchain': {'name': 'foss', 'version': '2018a'}}), @@ -1339,7 +1354,7 @@ def test_unknown_easyconfig_parameter(self): 'version = "3.14"', 'homepage = "http://example.com"', 'description = "test easyconfig"', - 'toolchain = {"name": "dummy", "version": "dummy"}', + 'toolchain = SYSTEM', ]) self.prep() ec = EasyConfig(self.eb_file) @@ -1597,7 +1612,7 @@ def test_dump_order(self): 'patches = ["one.patch"]', "easyblock = 'EB_foo'", '', - "toolchain = {'name': 'dummy', 'version': 'dummy'}", + "toolchain = SYSTEM", '', 'checksums = ["6af6ab95ce131c2dd467d2ebc8270e9c265cc32496210b069e51d3749f335f3d"]', "dependencies = [", @@ -1663,7 +1678,7 @@ def test_dump_extra(self): "homepage = 'http://foo.com/'", 'description = "foo description"', '', - "toolchain = {'name': 'dummy', 'version': 'dummy'}", + "toolchain = {'name': 'system', 'version': 'system'}", '', "dependencies = [", " ('GCC', '4.6.4', '-test'),", @@ -1707,8 +1722,8 @@ def test_dump_template(self): 'description = "foo description"', '', "toolchain = {", - " 'version': 'dummy',", - " 'name': 'dummy',", + " 'version': 'system',", + " 'name': 'system',", '}', '', "sources = [", @@ -1787,8 +1802,8 @@ def test_dump_comments(self): "# toolchain comment", '', "toolchain = {", - " 'version': 'dummy',", - " 'name': 'dummy'", + " 'version': 'system',", + " 'name': 'system'", '}', '', "sanity_check_paths = {", @@ -2218,9 +2233,9 @@ def test_template_constant_dict(self): 'name': 'toy', 'namelower': 'toy', 'nameletter': 't', + 'toolchain_name': 'system', + 'toolchain_version': 'system', 'nameletterlower': 't', - 'toolchain_name': 'dummy', - 'toolchain_version': 'dummy', 'version': '0.01', 'version_major': '0', 'version_major_minor': '0.01', @@ -2420,15 +2435,14 @@ def test_det_subtoolchain_version(self): for subtoolchain_name in subtoolchains[current_tc['name']]] self.assertEqual(versions, ['2018a', None]) - # 'dummy', 'dummy' should be ok: return None for GCCcore, and None or '' for 'dummy'. + # 'system', 'system' should be ok: return None for GCCcore, and None or '' for 'system'. current_tc = {'name': 'GCC', 'version': '6.4.0-2.28'} - cands = [{'name': 'dummy', 'version': 'dummy'}] + cands = [{'name': 'system', 'version': 'system'}] versions = [det_subtoolchain_version(current_tc, subtoolchain_name, optional_toolchains, cands) for subtoolchain_name in subtoolchains[current_tc['name']]] self.assertEqual(versions, [None, None]) - init_config(build_options={ - 'add_dummy_to_minimal_toolchains': True}) + init_config(build_options={'add_system_to_minimal_toolchains': True}) versions = [det_subtoolchain_version(current_tc, subtoolchain_name, optional_toolchains, cands) for subtoolchain_name in subtoolchains[current_tc['name']]] diff --git a/test/framework/easyconfigparser.py b/test/framework/easyconfigparser.py index 43c378f6ae..a36886277f 100644 --- a/test/framework/easyconfigparser.py +++ b/test/framework/easyconfigparser.py @@ -55,7 +55,7 @@ def test_v10(self): ec = ecp.get_config_dict() - self.assertEqual(ec['toolchain'], {'name': 'dummy', 'version': 'dummy'}) + self.assertEqual(ec['toolchain'], {'name': 'system', 'version': 'system'}) self.assertEqual(ec['name'], 'GCC') self.assertEqual(ec['version'], '4.6.3') @@ -77,7 +77,7 @@ def test_v20(self): # this should be ok: ie the default values ec = ecp.get_config_dict() - self.assertEqual(ec['toolchain'], {'name': 'dummy', 'version': 'dummy'}) + self.assertEqual(ec['toolchain'], {'name': 'system', 'version': 'system'}) self.assertEqual(ec['name'], 'GCC') self.assertEqual(ec['version'], '4.6.2') @@ -130,7 +130,7 @@ def test_v20_deps(self): ec = ecp.get_config_dict() self.assertEqual(ec['name'], 'foss') self.assertEqual(ec['version'], '2018a') - self.assertEqual(ec['toolchain'], {'name': 'dummy', 'version': 'dummy'}) + self.assertEqual(ec['toolchain'], {'name': 'system', 'version': 'system'}) # dependencies should be parsed correctly deps = [ @@ -179,7 +179,7 @@ def test_easyconfig_constants(self): for constant_name in constants: self.assertTrue(isinstance(constant_name, string_type), "Constant name %s is a string" % constant_name) val = constants[constant_name] - self.assertTrue(isinstance(val, string_type), "Constant value %s is a string" % val) + self.assertTrue(isinstance(val, (string_type, dict)), "Constant value %s is a string or dict" % val) # check a couple of randomly picked constant values self.assertEqual(constants['SOURCE_TAR_GZ'], '%(name)s-%(version)s.tar.gz') diff --git a/test/framework/easyconfigs/test_ecs/__archive__/i/intel/intel-2012a.eb b/test/framework/easyconfigs/test_ecs/__archive__/i/intel/intel-2012a.eb index 054071c093..f93196a0ea 100644 --- a/test/framework/easyconfigs/test_ecs/__archive__/i/intel/intel-2012a.eb +++ b/test/framework/easyconfigs/test_ecs/__archive__/i/intel/intel-2012a.eb @@ -6,7 +6,7 @@ version = '2012a' homepage = 'http://software.intel.com/en-us/intel-cluster-toolchain-compiler/' description = """Intel Cluster Toolkit Compiler Edition provides Intel C/C++ and Fortran compilers, Intel MPI & Intel MKL.""" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM # fake/empty intel/2012a toolchain, just for testing purposes dependencies = [ diff --git a/test/framework/easyconfigs/test_ecs/c/CUDA/CUDA-5.5.22.eb b/test/framework/easyconfigs/test_ecs/c/CUDA/CUDA-5.5.22.eb index 714c26657c..a10863230d 100644 --- a/test/framework/easyconfigs/test_ecs/c/CUDA/CUDA-5.5.22.eb +++ b/test/framework/easyconfigs/test_ecs/c/CUDA/CUDA-5.5.22.eb @@ -21,7 +21,7 @@ description = """CUDA (formerly Compute Unified Device Architecture) is a parall graphics processing units (GPUs) that they produce. CUDA gives developers access to the virtual instruction set and memory of the parallel computational elements in CUDA GPUs.""" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM # eg. http://developer.download.nvidia.com/compute/cuda/5_5/rel/installers/cuda_5.5.22_linux_64.run source_urls = ['http://developer.download.nvidia.com/compute/cuda/5_5/rel/installers/'] diff --git a/test/framework/easyconfigs/test_ecs/c/CrayCCE/CrayCCE-5.1.29.eb b/test/framework/easyconfigs/test_ecs/c/CrayCCE/CrayCCE-5.1.29.eb index 766d96d756..e17dc5783d 100644 --- a/test/framework/easyconfigs/test_ecs/c/CrayCCE/CrayCCE-5.1.29.eb +++ b/test/framework/easyconfigs/test_ecs/c/CrayCCE/CrayCCE-5.1.29.eb @@ -6,7 +6,7 @@ version = '5.1.29' homepage = '(none)' description = """Toolchain using Cray compiler wrapper, using PrgEnv-cray module.""" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM dependencies = [ ('PrgEnv-cray/' + version, EXTERNAL_MODULE), # also loads cray-libsci diff --git a/test/framework/easyconfigs/test_ecs/f/foss/foss-2018a.eb b/test/framework/easyconfigs/test_ecs/f/foss/foss-2018a.eb index be7e322b3b..295d02e2cf 100644 --- a/test/framework/easyconfigs/test_ecs/f/foss/foss-2018a.eb +++ b/test/framework/easyconfigs/test_ecs/f/foss/foss-2018a.eb @@ -7,7 +7,7 @@ homepage = '(none)' description = """GNU Compiler Collection (GCC) based compiler toolchain, including OpenMPI for MPI support, OpenBLAS (BLAS and LAPACK support), FFTW and ScaLAPACK.""" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM comp_name = 'GCC' comp_version = '6.4.0-2.28' diff --git a/test/framework/easyconfigs/test_ecs/f/fosscuda/fosscuda-2018a.eb b/test/framework/easyconfigs/test_ecs/f/fosscuda/fosscuda-2018a.eb index ffc00c278b..79f05bcd29 100644 --- a/test/framework/easyconfigs/test_ecs/f/fosscuda/fosscuda-2018a.eb +++ b/test/framework/easyconfigs/test_ecs/f/fosscuda/fosscuda-2018a.eb @@ -7,7 +7,7 @@ homepage = '(none)' description = """GCC based compiler toolchain __with CUDA support__, and including OpenMPI for MPI support, OpenBLAS (BLAS and LAPACK support), FFTW and ScaLAPACK.""" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM comp_name = 'GCC' comp_ver = '6.4.0-2.28' diff --git a/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.6.3.eb b/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.6.3.eb index cb4821dcd7..c709cc1f10 100644 --- a/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.6.3.eb +++ b/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.6.3.eb @@ -8,7 +8,7 @@ homepage = 'http://gcc.gnu.org/' description = """The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, and Ada, as well as libraries for these languages (libstdc++, libgcj,...).""" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM sources = [ '%s-%s.tar.gz' % (name.lower(), version), diff --git a/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.6.4.eb b/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.6.4.eb index baf448818b..d2772829d3 100644 --- a/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.6.4.eb +++ b/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.6.4.eb @@ -8,7 +8,7 @@ homepage = 'http://gcc.gnu.org/' description = """The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, and Ada, as well as libraries for these languages (libstdc++, libgcj,...).""" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM source_urls = [ 'http://ftpmirror.gnu.org/%(namelower)s/%(namelower)s-%(version)s', # GCC auto-resolving HTTP mirror diff --git a/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.8.2.eb b/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.8.2.eb index a7723b5eb9..a4faee23c8 100644 --- a/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.8.2.eb +++ b/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.8.2.eb @@ -8,7 +8,7 @@ homepage = 'http://gcc.gnu.org/' description = """The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, and Ada, as well as libraries for these languages (libstdc++, libgcj,...).""" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM source_urls = [ 'http://ftpmirror.gnu.org/%(namelower)s/%(namelower)s-%(version)s', # GCC auto-resolving HTTP mirror diff --git a/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.8.3.eb b/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.8.3.eb index 14e91d37d2..c94e58db97 100644 --- a/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.8.3.eb +++ b/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.8.3.eb @@ -8,7 +8,7 @@ homepage = 'http://gcc.gnu.org/' description = """The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, and Ada, as well as libraries for these languages (libstdc++, libgcj,...).""" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM source_urls = [ 'http://ftpmirror.gnu.org/%(namelower)s/%(namelower)s-%(version)s', # GCC auto-resolving HTTP mirror diff --git a/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.9.2.eb b/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.9.2.eb index ec651b931d..6240e1fc1f 100644 --- a/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.9.2.eb +++ b/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.9.2.eb @@ -8,7 +8,7 @@ homepage = 'http://gcc.gnu.org/' description = """The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, and Ada, as well as libraries for these languages (libstdc++, libgcj,...).""" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM source_urls = [ 'http://ftpmirror.gnu.org/%(namelower)s/%(namelower)s-%(version)s', # GCC auto-resolving HTTP mirror diff --git a/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.9.3-2.25.eb b/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.9.3-2.25.eb index c265058180..a0ac85ed76 100644 --- a/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.9.3-2.25.eb +++ b/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.9.3-2.25.eb @@ -11,11 +11,11 @@ homepage = 'http://gcc.gnu.org/' description = """The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, and Ada, as well as libraries for these languages (libstdc++, libgcj,...).""" -toolchain = {'name': 'dummy', 'version': ''} +toolchain = SYSTEM dependencies = [ ('GCCcore', version), - # binutils built on top of GCCcore, which was built on top of (dummy-built) binutils + # binutils built on top of GCCcore, which was built on top of (system-built) binutils ('binutils', binutilsver, '', ('GCCcore', version)), ] diff --git a/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.9.3-2.26.eb b/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.9.3-2.26.eb index e5204458bf..d6bec8dc31 100644 --- a/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.9.3-2.26.eb +++ b/test/framework/easyconfigs/test_ecs/g/GCC/GCC-4.9.3-2.26.eb @@ -11,11 +11,11 @@ homepage = 'http://gcc.gnu.org/' description = """The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, and Ada, as well as libraries for these languages (libstdc++, libgcj,...).""" -toolchain = {'name': 'dummy', 'version': ''} +toolchain = SYSTEM dependencies = [ ('GCCcore', version), - # binutils built on top of GCCcore, which was built on top of (dummy-built) binutils + # binutils built on top of GCCcore, which was built on top of (system-built) binutils ('binutils', binutilsver, '', ('GCCcore', version)), ] diff --git a/test/framework/easyconfigs/test_ecs/g/GCC/GCC-6.4.0-2.28.eb b/test/framework/easyconfigs/test_ecs/g/GCC/GCC-6.4.0-2.28.eb index 4bd2536a57..262f271095 100644 --- a/test/framework/easyconfigs/test_ecs/g/GCC/GCC-6.4.0-2.28.eb +++ b/test/framework/easyconfigs/test_ecs/g/GCC/GCC-6.4.0-2.28.eb @@ -9,7 +9,7 @@ homepage = 'http://gcc.gnu.org/' description = """The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, and Ada, as well as libraries for these languages (libstdc++, libgcj,...).""" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM source_urls = [ 'http://ftpmirror.gnu.org/%(namelower)s/%(namelower)s-%(version)s', # GCC auto-resolving HTTP mirror diff --git a/test/framework/easyconfigs/test_ecs/g/GCC/GCC-7.3.0-2.30.eb b/test/framework/easyconfigs/test_ecs/g/GCC/GCC-7.3.0-2.30.eb index 228885542c..981a89238b 100644 --- a/test/framework/easyconfigs/test_ecs/g/GCC/GCC-7.3.0-2.30.eb +++ b/test/framework/easyconfigs/test_ecs/g/GCC/GCC-7.3.0-2.30.eb @@ -9,7 +9,7 @@ homepage = 'http://gcc.gnu.org/' description = """The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, and Ada, as well as libraries for these languages (libstdc++, libgcj,...).""" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM source_urls = [ 'http://ftpmirror.gnu.org/%(namelower)s/%(namelower)s-%(version)s', # GCC auto-resolving HTTP mirror diff --git a/test/framework/easyconfigs/test_ecs/g/GCCcore/GCCcore-4.9.3.eb b/test/framework/easyconfigs/test_ecs/g/GCCcore/GCCcore-4.9.3.eb index 2b9895f957..a5028745a5 100644 --- a/test/framework/easyconfigs/test_ecs/g/GCCcore/GCCcore-4.9.3.eb +++ b/test/framework/easyconfigs/test_ecs/g/GCCcore/GCCcore-4.9.3.eb @@ -8,7 +8,7 @@ homepage = 'http://gcc.gnu.org/' description = """The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, and Ada, as well as libraries for these languages (libstdc++, libgcj,...).""" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM source_urls = [ 'http://ftpmirror.gnu.org/%(namelower)s/%(namelower)s-%(version)s', # GCC auto-resolving HTTP mirror diff --git a/test/framework/easyconfigs/test_ecs/g/gcccuda/gcccuda-2018a.eb b/test/framework/easyconfigs/test_ecs/g/gcccuda/gcccuda-2018a.eb index afc4a3e389..1868c8c774 100644 --- a/test/framework/easyconfigs/test_ecs/g/gcccuda/gcccuda-2018a.eb +++ b/test/framework/easyconfigs/test_ecs/g/gcccuda/gcccuda-2018a.eb @@ -6,7 +6,7 @@ version = '2018a' homepage = '(none)' description = """GNU Compiler Collection (GCC) based compiler toolchain, along with CUDA toolkit.""" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM comp_name = 'GCC' comp_ver = '6.4.0-2.28' diff --git a/test/framework/easyconfigs/test_ecs/g/gmvapich2/gmvapich2-15.11.eb b/test/framework/easyconfigs/test_ecs/g/gmvapich2/gmvapich2-15.11.eb index 189c5ed314..dc797409c7 100644 --- a/test/framework/easyconfigs/test_ecs/g/gmvapich2/gmvapich2-15.11.eb +++ b/test/framework/easyconfigs/test_ecs/g/gmvapich2/gmvapich2-15.11.eb @@ -7,7 +7,7 @@ homepage = '(none)' description = """GNU Compiler Collection (GCC) based compiler toolchain, including MVAPICH2 for MPI support.""" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM compname = 'GCC' compver = '4.9.3-2.25' diff --git a/test/framework/easyconfigs/test_ecs/g/golf/golf-2018a.eb b/test/framework/easyconfigs/test_ecs/g/golf/golf-2018a.eb index 02416fe5dc..3378bee8fc 100644 --- a/test/framework/easyconfigs/test_ecs/g/golf/golf-2018a.eb +++ b/test/framework/easyconfigs/test_ecs/g/golf/golf-2018a.eb @@ -7,7 +7,7 @@ homepage = '(none)' description = """GNU Compiler Collection (GCC) based compiler toolchain, including OpenBLAS (BLAS and LAPACK support), and FFTW.""" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM comp_name = 'GCC' comp_version = '6.4.0-2.28' diff --git a/test/framework/easyconfigs/test_ecs/g/golfc/golfc-2018a.eb b/test/framework/easyconfigs/test_ecs/g/golfc/golfc-2018a.eb index 3952cddd3b..f558118951 100644 --- a/test/framework/easyconfigs/test_ecs/g/golfc/golfc-2018a.eb +++ b/test/framework/easyconfigs/test_ecs/g/golfc/golfc-2018a.eb @@ -7,7 +7,7 @@ homepage = '(none)' description = """GCC based compiler toolchain __with CUDA support__, and including OpenBLAS (BLAS and LAPACK support) and FFTW.""" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM comp_name = 'GCC' comp_ver = '6.4.0-2.28' diff --git a/test/framework/easyconfigs/test_ecs/g/gompi/gompi-2018a.eb b/test/framework/easyconfigs/test_ecs/g/gompi/gompi-2018a.eb index fd7335e080..ad59185239 100644 --- a/test/framework/easyconfigs/test_ecs/g/gompi/gompi-2018a.eb +++ b/test/framework/easyconfigs/test_ecs/g/gompi/gompi-2018a.eb @@ -7,7 +7,7 @@ homepage = '(none)' description = """GNU Compiler Collection (GCC) based compiler toolchain, including OpenMPI for MPI support.""" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM compname = 'GCC' compver = '6.4.0-2.28' diff --git a/test/framework/easyconfigs/test_ecs/g/gompi/gompi-2018b.eb b/test/framework/easyconfigs/test_ecs/g/gompi/gompi-2018b.eb index c8cdcc6608..5c596d1d73 100644 --- a/test/framework/easyconfigs/test_ecs/g/gompi/gompi-2018b.eb +++ b/test/framework/easyconfigs/test_ecs/g/gompi/gompi-2018b.eb @@ -7,7 +7,7 @@ homepage = '(none)' description = """GNU Compiler Collection (GCC) based compiler toolchain, including OpenMPI for MPI support.""" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM compname = 'GCC' compver = '7.3.0-2.30' diff --git a/test/framework/easyconfigs/test_ecs/g/gompic/gompic-2018a.eb b/test/framework/easyconfigs/test_ecs/g/gompic/gompic-2018a.eb index 82e4a72f27..3a58fa97a5 100644 --- a/test/framework/easyconfigs/test_ecs/g/gompic/gompic-2018a.eb +++ b/test/framework/easyconfigs/test_ecs/g/gompic/gompic-2018a.eb @@ -7,7 +7,7 @@ homepage = '(none)' description = """GNU Compiler Collection (GCC) based compiler toolchain along with CUDA toolkit, including OpenMPI for MPI support with CUDA features enabled.""" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM comp_name = 'GCC' comp_ver = '6.4.0-2.28' diff --git a/test/framework/easyconfigs/test_ecs/g/gzip/gzip-1.4-broken.eb b/test/framework/easyconfigs/test_ecs/g/gzip/gzip-1.4-broken.eb index 2abf4268aa..0060c859f3 100644 --- a/test/framework/easyconfigs/test_ecs/g/gzip/gzip-1.4-broken.eb +++ b/test/framework/easyconfigs/test_ecs/g/gzip/gzip-1.4-broken.eb @@ -19,7 +19,7 @@ homepage = "http://www.gzip.org/" description = "gzip (GNU zip) is a popular data compression program as a replacement for compress" # test toolchain specification -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM # source tarball filename sources = [SOURCE_TAR_GZ] diff --git a/test/framework/easyconfigs/test_ecs/g/gzip/gzip-1.4.eb b/test/framework/easyconfigs/test_ecs/g/gzip/gzip-1.4.eb index fdaac2ae20..ec646acb08 100644 --- a/test/framework/easyconfigs/test_ecs/g/gzip/gzip-1.4.eb +++ b/test/framework/easyconfigs/test_ecs/g/gzip/gzip-1.4.eb @@ -18,7 +18,7 @@ homepage = "http://www.gzip.org/" description = "gzip (GNU zip) is a popular data compression program as a replacement for compress" # test toolchain specification -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM # source tarball filename sources = [SOURCE_TAR_GZ] diff --git a/test/framework/easyconfigs/test_ecs/i/icc/icc-2016.1.150-GCC-4.9.3-2.25.eb b/test/framework/easyconfigs/test_ecs/i/icc/icc-2016.1.150-GCC-4.9.3-2.25.eb index b41c580268..6ad36375fd 100644 --- a/test/framework/easyconfigs/test_ecs/i/icc/icc-2016.1.150-GCC-4.9.3-2.25.eb +++ b/test/framework/easyconfigs/test_ecs/i/icc/icc-2016.1.150-GCC-4.9.3-2.25.eb @@ -7,7 +7,7 @@ version = '2016.1.150' homepage = 'http://software.intel.com/en-us/intel-compilers/' description = "C and C++ compiler from Intel" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM sources = ['parallel_studio_xe_%(version_major)s_composer_edition_for_cpp_update%(version_minor)s.tgz'] diff --git a/test/framework/easyconfigs/test_ecs/i/iccifort/iccifort-2016.1.150-GCC-4.9.3-2.25.eb b/test/framework/easyconfigs/test_ecs/i/iccifort/iccifort-2016.1.150-GCC-4.9.3-2.25.eb index cbb1e569b9..4cd0e2bea7 100644 --- a/test/framework/easyconfigs/test_ecs/i/iccifort/iccifort-2016.1.150-GCC-4.9.3-2.25.eb +++ b/test/framework/easyconfigs/test_ecs/i/iccifort/iccifort-2016.1.150-GCC-4.9.3-2.25.eb @@ -9,7 +9,7 @@ homepage = 'http://software.intel.com/en-us/intel-cluster-toolkit-compiler/' description = """Intel Cluster Toolkit Compiler Edition provides Intel C,C++ and fortran compilers, Intel MPI and Intel MKL""" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM dependencies = [ ('icc', version, versionsuffix), diff --git a/test/framework/easyconfigs/test_ecs/i/iccifortcuda/iccifortcuda-2016.1.150.eb b/test/framework/easyconfigs/test_ecs/i/iccifortcuda/iccifortcuda-2016.1.150.eb index 642d044000..194735d7cf 100644 --- a/test/framework/easyconfigs/test_ecs/i/iccifortcuda/iccifortcuda-2016.1.150.eb +++ b/test/framework/easyconfigs/test_ecs/i/iccifortcuda/iccifortcuda-2016.1.150.eb @@ -6,7 +6,7 @@ version = '2016.1.150' homepage = '(none)' description = """Intel Cluster Toolkit Compiler Edition provides Intel C/C++ and Fortran compilers, Intel MPI & Intel MKL, with CUDA toolkit""" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM comp_name = 'iccifort' comp_ver = '2016.1.150' diff --git a/test/framework/easyconfigs/test_ecs/i/ifort/ifort-2016.1.150-GCC-4.9.3-2.25.eb b/test/framework/easyconfigs/test_ecs/i/ifort/ifort-2016.1.150-GCC-4.9.3-2.25.eb index 311c34d164..24e1cb11c0 100644 --- a/test/framework/easyconfigs/test_ecs/i/ifort/ifort-2016.1.150-GCC-4.9.3-2.25.eb +++ b/test/framework/easyconfigs/test_ecs/i/ifort/ifort-2016.1.150-GCC-4.9.3-2.25.eb @@ -7,7 +7,7 @@ version = '2016.1.150' homepage = 'http://software.intel.com/en-us/intel-compilers/' description = "C and C++ compiler from Intel" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM sources = ['parallel_studio_xe_%(version_major)s_composer_edition_for_fortran_update%(version_minor)s.tgz'] diff --git a/test/framework/easyconfigs/test_ecs/i/ifort/ifort-2016.1.150.eb b/test/framework/easyconfigs/test_ecs/i/ifort/ifort-2016.1.150.eb index faa94bc587..b91361c9b7 100644 --- a/test/framework/easyconfigs/test_ecs/i/ifort/ifort-2016.1.150.eb +++ b/test/framework/easyconfigs/test_ecs/i/ifort/ifort-2016.1.150.eb @@ -7,7 +7,7 @@ version = '2016.1.150' homepage = 'http://software.intel.com/en-us/intel-compilers/' description = "Fortran compiler from Intel" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM sources = ['l_fcompxe_%s.tgz' % version] diff --git a/test/framework/easyconfigs/test_ecs/i/iimpi/iimpi-2016.01.eb b/test/framework/easyconfigs/test_ecs/i/iimpi/iimpi-2016.01.eb index 8fccd16f64..8eb4480b0f 100644 --- a/test/framework/easyconfigs/test_ecs/i/iimpi/iimpi-2016.01.eb +++ b/test/framework/easyconfigs/test_ecs/i/iimpi/iimpi-2016.01.eb @@ -6,7 +6,7 @@ version = '2016.01' homepage = 'http://software.intel.com/en-us/intel-cluster-toolkit-compiler/' description = """Intel C/C++ and Fortran compilers, alongside Intel MPI.""" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM compver = '2016.1.150-GCC-4.9.3-2.25' diff --git a/test/framework/easyconfigs/test_ecs/i/impi/impi-5.1.2.150.eb b/test/framework/easyconfigs/test_ecs/i/impi/impi-5.1.2.150.eb index 0cba5224b8..a6ecb96cda 100644 --- a/test/framework/easyconfigs/test_ecs/i/impi/impi-5.1.2.150.eb +++ b/test/framework/easyconfigs/test_ecs/i/impi/impi-5.1.2.150.eb @@ -9,7 +9,7 @@ description = """The Intel(R) MPI Library for Linux* OS is a multi-fabric messag passing library based on ANL MPICH2 and OSU MVAPICH2. The Intel MPI Library for Linux OS implements the Message Passing Interface, version 2 (MPI-2) specification.""" -toolchain = {'name': 'dummy', 'version': ''} +toolchain = SYSTEM sources = ['l_mpi_p_%(version)s.tgz'] diff --git a/test/framework/easyconfigs/test_ecs/i/intel/intel-2018a.eb b/test/framework/easyconfigs/test_ecs/i/intel/intel-2018a.eb index 177c056b43..013e23de80 100644 --- a/test/framework/easyconfigs/test_ecs/i/intel/intel-2018a.eb +++ b/test/framework/easyconfigs/test_ecs/i/intel/intel-2018a.eb @@ -6,7 +6,7 @@ version = '2018a' homepage = 'http://software.intel.com/en-us/intel-cluster-toolkit-compiler/' description = """Intel Cluster Toolkit Compiler Edition provides Intel C/C++ and Fortran compilers, Intel MPI & Intel MKL.""" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM compver = '2011.13.367' diff --git a/test/framework/easyconfigs/test_ecs/t/toy/toy-0.0-deps.eb b/test/framework/easyconfigs/test_ecs/t/toy/toy-0.0-deps.eb index 77839125c7..d2a222a21c 100644 --- a/test/framework/easyconfigs/test_ecs/t/toy/toy-0.0-deps.eb +++ b/test/framework/easyconfigs/test_ecs/t/toy/toy-0.0-deps.eb @@ -5,7 +5,7 @@ versionsuffix = '-deps' homepage = 'https://easybuilders.github.io/easybuild' description = "Toy C program, 100% toy." -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM sources = [SOURCE_TAR_GZ] checksums = [[ diff --git a/test/framework/easyconfigs/test_ecs/t/toy/toy-0.0-iter.eb b/test/framework/easyconfigs/test_ecs/t/toy/toy-0.0-iter.eb index 085768f707..76a4aa4f65 100644 --- a/test/framework/easyconfigs/test_ecs/t/toy/toy-0.0-iter.eb +++ b/test/framework/easyconfigs/test_ecs/t/toy/toy-0.0-iter.eb @@ -5,7 +5,7 @@ versionsuffix = '-iter' homepage = 'https://easybuilders.github.io/easybuild' description = "Toy C program, 100% %(name)s." -toolchain = {'name': 'dummy', 'version': ''} +toolchain = SYSTEM sources = [SOURCE_TAR_GZ] patches = ['toy-0.0_fix-silly-typo-in-printf-statement.patch'] diff --git a/test/framework/easyconfigs/test_ecs/t/toy/toy-0.0-multiple.eb b/test/framework/easyconfigs/test_ecs/t/toy/toy-0.0-multiple.eb index abb90dae56..4c67a421f5 100644 --- a/test/framework/easyconfigs/test_ecs/t/toy/toy-0.0-multiple.eb +++ b/test/framework/easyconfigs/test_ecs/t/toy/toy-0.0-multiple.eb @@ -6,7 +6,7 @@ versionsuffix = '-multiple' homepage = 'https://easybuilders.github.io/easybuild' description = "Toy C program, 100% toy." -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM sources = [SOURCE_TAR_GZ] patches = ['toy-0.0_fix-silly-typo-in-printf-statement.patch'] diff --git a/test/framework/easyconfigs/test_ecs/t/toy/toy-0.0.eb b/test/framework/easyconfigs/test_ecs/t/toy/toy-0.0.eb index b8a1ad8c3d..c2a88616b1 100644 --- a/test/framework/easyconfigs/test_ecs/t/toy/toy-0.0.eb +++ b/test/framework/easyconfigs/test_ecs/t/toy/toy-0.0.eb @@ -4,7 +4,7 @@ version = '0.0' homepage = 'https://easybuilders.github.io/easybuild' description = "Toy C program, 100% toy." -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM sources = [SOURCE_TAR_GZ] checksums = [[ diff --git a/test/framework/easyconfigs/v1.0/g/GCC/GCC-4.6.3.eb b/test/framework/easyconfigs/v1.0/g/GCC/GCC-4.6.3.eb index cb4821dcd7..c709cc1f10 100644 --- a/test/framework/easyconfigs/v1.0/g/GCC/GCC-4.6.3.eb +++ b/test/framework/easyconfigs/v1.0/g/GCC/GCC-4.6.3.eb @@ -8,7 +8,7 @@ homepage = 'http://gcc.gnu.org/' description = """The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, and Ada, as well as libraries for these languages (libstdc++, libgcj,...).""" -toolchain = {'name': 'dummy', 'version': 'dummy'} +toolchain = SYSTEM sources = [ '%s-%s.tar.gz' % (name.lower(), version), diff --git a/test/framework/easyconfigs/v1.0/g/gzip/gzip-1.4.eb b/test/framework/easyconfigs/v1.0/g/gzip/gzip-1.4.eb index c1ac02b7d9..5126eff488 100644 --- a/test/framework/easyconfigs/v1.0/g/gzip/gzip-1.4.eb +++ b/test/framework/easyconfigs/v1.0/g/gzip/gzip-1.4.eb @@ -18,7 +18,7 @@ homepage = "http://www.%(namelower)s.org/" description = "%(name)s (GNU zip) is a popular data compression program as a replacement for compress" # test toolchain specification -toolchain = {'name':'dummy','version':'dummy'} +toolchain = SYSTEM # source tarball filename sources = [SOURCE_TAR_GZ] diff --git a/test/framework/easyconfigs/v2.0/GCC.eb b/test/framework/easyconfigs/v2.0/GCC.eb index b753004a6e..7cd846037d 100644 --- a/test/framework/easyconfigs/v2.0/GCC.eb +++ b/test/framework/easyconfigs/v2.0/GCC.eb @@ -43,5 +43,5 @@ moduleclass = 'compiler' [SUPPORTED] versions = 4.6.2, 4.6.3 -toolchains = dummy == dummy +toolchains = system == system diff --git a/test/framework/easyconfigs/v2.0/doesnotexist.eb b/test/framework/easyconfigs/v2.0/doesnotexist.eb index ddf0cb2430..31d9aa1ae0 100644 --- a/test/framework/easyconfigs/v2.0/doesnotexist.eb +++ b/test/framework/easyconfigs/v2.0/doesnotexist.eb @@ -27,10 +27,10 @@ sanity_check_paths = {'files': ["bin/gunzip", "bin/gzip"], 'dirs': []} [SUPPORTED] versions=1.0.0,>= 0.5.0 -toolchains=dummy > 5,GCC == 3.0.0,intel < 1.0 +toolchains=system > 5,GCC == 3.0.0,intel < 1.0 [foss > 1] versions=1.5.0 [2.0.0] -toolchains=dummy > 6,GCC > 4 +toolchains=system > 6,GCC > 4 diff --git a/test/framework/easyconfigs/v2.0/foss.eb b/test/framework/easyconfigs/v2.0/foss.eb index 17bc79a980..c271c796b4 100644 --- a/test/framework/easyconfigs/v2.0/foss.eb +++ b/test/framework/easyconfigs/v2.0/foss.eb @@ -20,7 +20,7 @@ moduleclass = toolchain [SUPPORTED] versions = 2018a -toolchains = dummy == dummy +toolchains = system == system [DEPENDENCIES] GCC = 6.4.0-2.28 diff --git a/test/framework/easyconfigs/v2.0/gzip.eb b/test/framework/easyconfigs/v2.0/gzip.eb index 4f8a7cc47c..65d6aa0fc6 100644 --- a/test/framework/easyconfigs/v2.0/gzip.eb +++ b/test/framework/easyconfigs/v2.0/gzip.eb @@ -38,7 +38,7 @@ sanity_check_commands = [True, ('gzip', '--version')] [SUPPORTED] versions = 1.4, 1.5 -toolchains = dummy == dummy, foss, GCC == 4.6.3, foss == 2018a, intel == 2018a +toolchains = system == system, foss, GCC == 4.6.3, foss == 2018a, intel == 2018a [DEFAULT] easyblock = ConfigureMake diff --git a/test/framework/easyconfigs/v2.0/toy-with-sections.eb b/test/framework/easyconfigs/v2.0/toy-with-sections.eb index a2ee96e929..34b9af0dcd 100644 --- a/test/framework/easyconfigs/v2.0/toy-with-sections.eb +++ b/test/framework/easyconfigs/v2.0/toy-with-sections.eb @@ -29,7 +29,7 @@ moduleclass = 'tools' [SUPPORTED] versions = 1.0, 0.0, 1.1, 1.5, 1.6, 2.0, 3.0 -toolchains = foss == 2018a, dummy == dummy +toolchains = foss == 2018a, system == system [> 1.0] # all 1.x versions and more recent are 'stable' diff --git a/test/framework/easyconfigs/v2.0/toy.eb b/test/framework/easyconfigs/v2.0/toy.eb index 2cff6c5cde..a1cdfaf6d8 100644 --- a/test/framework/easyconfigs/v2.0/toy.eb +++ b/test/framework/easyconfigs/v2.0/toy.eb @@ -29,7 +29,7 @@ moduleclass = 'tools' [SUPPORTED] versions = 1.0, 0.0 -toolchains = foss == 2018a, dummy == dummy +toolchains = foss == 2018a, system == system [DEFAULT] diff --git a/test/framework/easyconfigs/yeb/CrayCCE-5.1.29.yeb b/test/framework/easyconfigs/yeb/CrayCCE-5.1.29.yeb index 465216409c..7244848a78 100644 --- a/test/framework/easyconfigs/yeb/CrayCCE-5.1.29.yeb +++ b/test/framework/easyconfigs/yeb/CrayCCE-5.1.29.yeb @@ -6,7 +6,7 @@ version: 5.1.29 homepage: (none) description: Toolchain using Cray compiler wrapper, using PrgEnv-cray module. -toolchain: dummy, dummy +toolchain: system, system dependencies: # also loads cray-libsci diff --git a/test/framework/easyconfigs/yeb/foss-2018a.yeb b/test/framework/easyconfigs/yeb/foss-2018a.yeb index 8cc5801f7e..99de832ac9 100644 --- a/test/framework/easyconfigs/yeb/foss-2018a.yeb +++ b/test/framework/easyconfigs/yeb/foss-2018a.yeb @@ -22,7 +22,7 @@ description: | GNU Compiler Collection (GCC) based compiler toolchain, including OpenMPI for MPI support, OpenBLAS (BLAS and LAPACK support), FFTW and ScaLAPACK. -toolchain: {name: dummy, version: dummy} +toolchain: {name: system, version: system} # compiler toolchain dependencies # we need GCC and OpenMPI as explicit dependencies instead of gompi toolchain diff --git a/test/framework/easyconfigs/yeb/intel-2018a.yeb b/test/framework/easyconfigs/yeb/intel-2018a.yeb index b06e0ef5cb..5c9a2fd2bb 100644 --- a/test/framework/easyconfigs/yeb/intel-2018a.yeb +++ b/test/framework/easyconfigs/yeb/intel-2018a.yeb @@ -11,7 +11,7 @@ description: Intel Cluster Toolkit Compiler Edition provides Intel C/C++ and Fortran compilers, Intel MPI & Intel MKL. -toolchain: {name: dummy, version: dummy} +toolchain: {name: system, version: system} # fake intel toolchain easyconfig, no dependencies (good enough for testing) fake_dependencies: [ diff --git a/test/framework/easyconfigs/yeb/toy-0.0.yeb b/test/framework/easyconfigs/yeb/toy-0.0.yeb index 0b0b668ed3..2f5265ea6d 100644 --- a/test/framework/easyconfigs/yeb/toy-0.0.yeb +++ b/test/framework/easyconfigs/yeb/toy-0.0.yeb @@ -7,7 +7,7 @@ version: 0.0 homepage: 'https://easybuilders.github.io/easybuild' description: "Toy C program, 100% toy." -toolchain: dummy, dummy +toolchain: system, system sources: - *SOURCE_TAR_GZ diff --git a/test/framework/filetools.py b/test/framework/filetools.py index 96c3bf00db..3f18ebcfe3 100644 --- a/test/framework/filetools.py +++ b/test/framework/filetools.py @@ -812,14 +812,12 @@ def test_multidiff(self): self.assertTrue(lines[2].startswith("3 %s- versionsuffix = '-deps'%s (1/2) toy-0.0-" % (red, endcol))) self.assertTrue(lines[3].startswith("3 %s- versionsuffix = '-test'%s (1/2) toy-0.0-" % (red, endcol))) - # different toolchain in toy-0.0-gompi-1.3.12-test: '+' line (removed chars in toolchain name/version, in red) - expected = "7 %(endcol)s-%(endcol)s toolchain = {" - expected += "'name': '%(endcol)s%(red)sgo%(endcol)sm\x1b[0m%(red)spi%(endcol)s', " + # different toolchain in toy-0.0-gompi-1.3.12-test: '+' line (added line in green) + expected = "7 %(green)s+ toolchain = SYSTEM%(endcol)s" expected = expected % {'endcol': endcol, 'green': green, 'red': red} self.assertTrue(lines[7].startswith(expected)) - # different toolchain in toy-0.0-gompi-1.3.12-test: '+' line (added chars in toolchain name/version, in green) - expected = "7 %(endcol)s+%(endcol)s toolchain = {" - expected += "'name': '%(endcol)s%(green)sdu%(endcol)sm\x1b[0m%(green)smy%(endcol)s', " + # different toolchain in toy-0.0-gompi-1.3.12-test: '-' line (removed line in red) + expected = "8 %(red)s- toolchain = {'name': 'gompi', 'version': '2018a'}%(endcol)s" expected = expected % {'endcol': endcol, 'green': green, 'red': red} self.assertTrue(lines[8].startswith(expected)) @@ -838,16 +836,11 @@ def test_multidiff(self): self.assertTrue(lines[2].startswith("3 - versionsuffix = '-deps' (1/2) toy-0.0-")) self.assertTrue(lines[3].startswith("3 - versionsuffix = '-test' (1/2) toy-0.0-")) - # different toolchain in toy-0.0-gompi-2018a-test: '+' line with squigly line underneath to mark removed chars - expected = "7 - toolchain = {'name': 'gompi', 'version': '2018a'} (1/2) toy" + # different toolchain in toy-0.0-gompi-2018a-test: '+' added line, '-' removed line + expected = "7 + toolchain = SYSTEM (1/2) toy" self.assertTrue(lines[7].startswith(expected)) - expected = " ? ^^ ^^ " + expected = "8 - toolchain = {'name': 'gompi', 'version': '2018a'} (1/2) toy" self.assertTrue(lines[8].startswith(expected)) - # different toolchain in toy-0.0-gompi-2018a-test: '-' line with squigly line underneath to mark added chars - expected = "7 + toolchain = {'name': 'dummy', 'version': 'dummy'} (1/2) toy" - self.assertTrue(lines[9].startswith(expected)) - expected = " ? ^^ ^^ " - self.assertTrue(lines[10].startswith(expected)) # no postinstallcmds in toy-0.0-deps.eb expected = "29 + postinstallcmds = " diff --git a/test/framework/module_generator.py b/test/framework/module_generator.py index 0fe68ce86a..f0465ca31e 100644 --- a/test/framework/module_generator.py +++ b/test/framework/module_generator.py @@ -944,13 +944,13 @@ def test_mns(): init_config(build_options=build_options) # note: these checksums will change if another easyconfig parameter is added ec2mod_map = { - 'GCC-4.6.3.eb': 'GCC/5e4c8db5c005867c2aa9c1019500ed2cb1b4cf29', - 'gzip-1.4.eb': 'gzip/53d5c13e85cb6945bd43a58d1c8d4a4c02f3462d', + 'GCC-4.6.3.eb': 'GCC/355ab0c0b66cedfd6e87695ef152a0ebe45b8b28', + 'gzip-1.4.eb': 'gzip/c2e522ded75b05c2b2074042fc39b5562b9929c3', 'gzip-1.4-GCC-4.6.3.eb': 'gzip/585eba598f33c64ef01c6fa47af0fc37f3751311', 'gzip-1.5-foss-2018a.eb': 'gzip/65dc39f92bf634667c478c50e43f0cda96b093a9', 'gzip-1.5-intel-2018a.eb': 'gzip/0a4725f4720103eff8ffdadf8ffb187b988fb805', - 'toy-0.0.eb': 'toy/cb0859b7b15723c826cd8504e5fde2573ab7b687', - 'toy-0.0-multiple.eb': 'toy/cb0859b7b15723c826cd8504e5fde2573ab7b687', + 'toy-0.0.eb': 'toy/d3cd467f89ab0bce1f2bcd553315524a3a5c8b34', + 'toy-0.0-multiple.eb': 'toy/d3cd467f89ab0bce1f2bcd553315524a3a5c8b34', } test_mns() @@ -962,7 +962,7 @@ def test_mns(): 'name': 'GCC', 'version': '4.6.3', 'versionsuffix': '', - 'toolchain': {'name': 'dummy', 'version': 'dummy'}, + 'toolchain': {'name': 'system', 'version': 'system'}, 'hidden': False, }), ('gzip-1.5-foss-2018a.eb', { @@ -976,7 +976,7 @@ def test_mns(): 'name': 'toy', 'version': '0.0', 'versionsuffix': '-multiple', - 'toolchain': {'name': 'dummy', 'version': 'dummy'}, + 'toolchain': {'name': 'system', 'version': 'system'}, 'hidden': False, }), ]: @@ -985,7 +985,7 @@ def test_mns(): ec = EasyConfig(os.path.join(ecs_dir, 'g', 'gzip', 'gzip-1.5-foss-2018a.eb'), hidden=True) self.assertEqual(ec.full_mod_name, ec2mod_map['gzip-1.5-foss-2018a.eb']) - self.assertEqual(ec.toolchain.det_short_module_name(), 'foss/0c5d3fad1328e36c93258863f21234f4ff3f7a3f') + self.assertEqual(ec.toolchain.det_short_module_name(), 'foss/e69469ac250145c9e814e5dde93f5fde6d80375d') # restore default module naming scheme, and retest os.environ['EASYBUILD_MODULE_NAMING_SCHEME'] = self.orig_module_naming_scheme diff --git a/test/framework/options.py b/test/framework/options.py index a2e799395b..7ec20816b9 100644 --- a/test/framework/options.py +++ b/test/framework/options.py @@ -486,7 +486,7 @@ def test__list_toolchains(self): self.assertTrue(re.search(info_msg, logtxt), "Info message with list of known toolchains found in: %s" % logtxt) # toolchain elements should be in alphabetical order tcs = { - 'dummy': [], + 'system': [], 'goalf': ['ATLAS', 'BLACS', 'FFTW', 'GCC', 'OpenMPI', 'ScaLAPACK'], 'intel': ['icc', 'ifort', 'imkl', 'impi'], } @@ -1020,7 +1020,13 @@ def test_from_pr(self): '--tmpdir=%s' % tmpdir, ] try: + # PR #1239 includes easyconfigs that use 'dummy' toolchain, + # so we need to allow triggering deprecated behaviour + self.allow_deprecated_behaviour() + + self.mock_stderr(True) # just to capture deprecation warning outtxt = self.eb_main(args, logfile=dummylogfn, raise_error=True) + self.mock_stderr(False) modules = [ (tmpdir, 'FFTW/3.3.4-gompi-2015a'), (tmpdir, 'foss/2015a'), @@ -1084,7 +1090,13 @@ def test_from_pr_listed_ecs(self): '--tmpdir=%s' % tmpdir, ] try: + # PR #1239 includes easyconfigs that use 'dummy' toolchain, + # so we need to allow triggering deprecated behaviour + self.allow_deprecated_behaviour() + + self.mock_stderr(True) # just to capture deprecation warning outtxt = self.eb_main(args, logfile=dummylogfn, raise_error=True) + self.mock_stderr(False) modules = [ (test_ecs_path, 'toy/0.0'), # not included in PR (test_ecs_path, 'GCC/4.9.2'), # not included in PR, available locally @@ -1126,10 +1138,16 @@ def test_from_pr_x(self): '--extended-dry-run', ] try: + # PR #1239 includes easyconfigs that use 'dummy' toolchain, + # so we need to allow triggering deprecated behaviour + self.allow_deprecated_behaviour() + + self.mock_stderr(True) # just to capture deprecation warning self.mock_stdout(True) self.eb_main(args, do_build=True, raise_error=True, testing=False) stdout = self.get_stdout() self.mock_stdout(False) + self.mock_stderr(False) msg_regexs = [ re.compile(r"^== Build succeeded for 1 out of 1", re.M), @@ -1302,7 +1320,7 @@ def test_ignore_osdeps(self): 'version = "3.14"', 'homepage = "http://example.com"', 'description = "test easyconfig"', - 'toolchain = {"name":"dummy", "version": "dummy"}', + 'toolchain = SYSTEM', 'osdependencies = ["nosuchosdependency", ("nosuchdep_option1", "nosuchdep_option2")]', ]) fd, eb_file = tempfile.mkstemp(prefix='easyconfig_test_file_', suffix='.eb') @@ -1513,7 +1531,7 @@ def test_try(self): (['--try-software=foo,1.2.3', '--try-toolchain=gompi,2018a'], 'foo/1.2.3-gompi-2018a'), (['--try-toolchain-name=gompi', '--try-toolchain-version=2018a'], 'toy/0.0-GCC-6.4.0.2.28'), # --try-toolchain is overridden by --toolchain - (['--try-toolchain=gompi,2018a', '--toolchain=dummy,dummy'], 'toy/0.0'), + (['--try-toolchain=gompi,2018a', '--toolchain=system,system'], 'toy/0.0'), (['--try-software-name=foo', '--try-software-version=1.2.3'], 'foo/1.2.3'), (['--try-toolchain-name=gompi', '--try-toolchain-version=2018a'], 'toy/0.0-GCC-6.4.0.2.28'), # combining --try-toolchain with other build options is too complicated, in this case the code defaults back @@ -1522,7 +1540,7 @@ def test_try(self): (['--try-amend=versionsuffix=-test'], 'toy/0.0-test'), # --try-amend is overridden by --amend (['--amend=versionsuffix=', '--try-amend=versionsuffix=-test'], 'toy/0.0'), - (['--try-toolchain=gompi,2018a', '--toolchain=dummy,dummy'], 'toy/0.0'), + (['--try-toolchain=gompi,2018a', '--toolchain=system,system'], 'toy/0.0'), # tweak existing list-typed value (patches) (['--try-amend=versionsuffix=-test2', '--try-amend=patches=1.patch,2.patch'], 'toy/0.0-test2'), # append to existing list-typed value (patches) @@ -1634,7 +1652,7 @@ def test_recursive_try(self): def test_cleanup_builddir(self): """Test cleaning up of build dir and --disable-cleanup-builddir.""" toy_ec = os.path.join(os.path.dirname(__file__), 'easyconfigs', 'test_ecs', 't', 'toy', 'toy-0.0.eb') - toy_buildpath = os.path.join(self.test_buildpath, 'toy', '0.0', 'dummy-dummy') + toy_buildpath = os.path.join(self.test_buildpath, 'toy', '0.0', 'system-system') args = [ toy_ec, @@ -2901,14 +2919,14 @@ def test_new_pr_python(self): ] txt, _ = self._run_mock_eb(args, do_build=True, raise_error=True, testing=False) - regex = re.compile(r"^\* title: \"\{tools\}\[dummy/dummy\] toy v0.0 w/ Python 3.7.2\"$", re.M) + regex = re.compile(r"^\* title: \"\{tools\}\[system/system\] toy v0.0 w/ Python 3.7.2\"$", re.M) self.assertTrue(regex.search(txt), "Pattern '%s' found in: %s" % (regex.pattern, txt)) # also check with Python listed via multi_deps write_file(toy_ec, toy_ec_txt + "\nmulti_deps = {'Python': ['3.7.2', '2.7.15']}") txt, _ = self._run_mock_eb(args, do_build=True, raise_error=True, testing=False) - regex = re.compile(r"^\* title: \"\{tools\}\[dummy/dummy\] toy v0.0 w/ Python 3.7.2 \+ 2.7.15\"$", re.M) + regex = re.compile(r"^\* title: \"\{tools\}\[system/system\] toy v0.0 w/ Python 3.7.2 \+ 2.7.15\"$", re.M) self.assertTrue(regex.search(txt), "Pattern '%s' found in: %s" % (regex.pattern, txt)) def test_new_pr_delete(self): @@ -2949,7 +2967,7 @@ def test_new_pr_dependencies(self): 'version = "1.0"', 'homepage = "http://example.com"', 'description = "test easyconfig"', - 'toolchain = {"name":"dummy", "version": "dummy"}', + 'toolchain = SYSTEM', 'dependencies = [("bar", "2.0")]' ]) bar_eb = '\n'.join([ @@ -2958,7 +2976,7 @@ def test_new_pr_dependencies(self): 'version = "2.0"', 'homepage = "http://example.com"', 'description = "test easyconfig"', - 'toolchain = {"name":"dummy", "version": "dummy"}', + 'toolchain = SYSTEM', ]) write_file(os.path.join(self.test_prefix, 'foo-1.0.eb'), foo_eb) @@ -3067,7 +3085,7 @@ def test_empty_pr(self): # get file from develop branch full_url = URL_SEPARATOR.join([GITHUB_RAW, GITHUB_EB_MAIN, GITHUB_EASYCONFIGS_REPO, - 'develop/easybuild/easyconfigs/z/zlib/zlib-1.2.8.eb']) + 'develop/easybuild/easyconfigs/z/zlib/zlib-1.2.11-GCCcore-6.4.0.eb']) ec_fn = os.path.basename(full_url) ec = download_file(ec_fn, full_url, path=os.path.join(self.test_prefix, ec_fn)) @@ -3474,32 +3492,32 @@ def test_list_software(self): '--robot-paths=%s' % test_ecs, ] txt, _ = self._run_mock_eb(args, testing=False) - self.assertTrue(re.search('^\*GCC\*', txt, re.M)) - self.assertTrue(re.search('^``4.6.3``\s+``dummy``', txt, re.M)) - self.assertTrue(re.search('^\*gzip\*', txt, re.M)) - self.assertTrue(re.search('^``1.5``\s+``foss/2018a``,\s+``intel/2018a``', txt, re.M)) + self.assertTrue(re.search(r'^\*GCC\*', txt, re.M)) + self.assertTrue(re.search(r'^``4.6.3``\s+``system``', txt, re.M)) + self.assertTrue(re.search(r'^\*gzip\*', txt, re.M)) + self.assertTrue(re.search(r'^``1.5``\s+``foss/2018a``,\s+``intel/2018a``', txt, re.M)) args = [ '--list-installed-software', '--output-format=rst', '--robot-paths=%s' % test_ecs, ] - txt, _ = self._run_mock_eb(args, testing=False) - self.assertTrue(re.search('== Processed 5/5 easyconfigs...', txt, re.M)) - self.assertTrue(re.search('== Found 2 different software packages', txt, re.M)) - self.assertTrue(re.search('== Retained 1 installed software packages', txt, re.M)) - self.assertTrue(re.search('^\* GCC', txt, re.M)) - self.assertFalse(re.search('gzip', txt, re.M)) + txt, _ = self._run_mock_eb(args, testing=False, raise_error=True) + self.assertTrue(re.search(r'== Processed 5/5 easyconfigs...', txt, re.M)) + self.assertTrue(re.search(r'== Found 2 different software packages', txt, re.M)) + self.assertTrue(re.search(r'== Retained 1 installed software packages', txt, re.M)) + self.assertTrue(re.search(r'^\* GCC', txt, re.M)) + self.assertFalse(re.search(r'gzip', txt, re.M)) args = [ '--list-installed-software=detailed', '--robot-paths=%s' % test_ecs, ] txt, _ = self._run_mock_eb(args, testing=False) - self.assertTrue(re.search('^== Retained 1 installed software packages', txt, re.M)) - self.assertTrue(re.search('^\* GCC', txt, re.M)) - self.assertTrue(re.search('^\s+\* GCC v4.6.3: dummy', txt, re.M)) - self.assertFalse(re.search('gzip', txt, re.M)) + self.assertTrue(re.search(r'^== Retained 1 installed software packages', txt, re.M)) + self.assertTrue(re.search(r'^\* GCC', txt, re.M)) + self.assertTrue(re.search(r'^\s+\* GCC v4.6.3: system', txt, re.M)) + self.assertFalse(re.search(r'gzip', txt, re.M)) def test_parse_optarch(self): """Test correct parsing of optarch option.""" @@ -3680,8 +3698,9 @@ def test_verify_easyconfig_filenames(self): # when --verify-easyconfig-filenames is enabled, EB gets picky about the easyconfig filename args.append('--verify-easyconfig-filenames') - error_pattern = "Easyconfig filename 'test.eb' does not match with expected filename 'toy-0.0.eb' \(specs: " - error_pattern += "name: 'toy'; version: '0.0'; versionsuffix: ''; toolchain name, version: 'dummy', 'dummy'\)" + error_pattern = r"Easyconfig filename 'test.eb' does not match with expected filename 'toy-0.0.eb' \(specs: " + error_pattern += r"name: 'toy'; version: '0.0'; versionsuffix: ''; " + error_pattern += r"toolchain name, version: 'system', 'system'\)" self.assertErrorRegex(EasyBuildError, error_pattern, self.eb_main, args, logfile=dummylogfn, raise_error=True) write_file(self.logfile, '') diff --git a/test/framework/robot.py b/test/framework/robot.py index b73faf5dd6..3317caf223 100644 --- a/test/framework/robot.py +++ b/test/framework/robot.py @@ -158,7 +158,7 @@ def test_resolve_dependencies(self): 'name': 'foo', 'version': '1.2.3', 'versionsuffix': '', - 'toolchain': {'name': 'dummy', 'version': 'dummy'}, + 'toolchain': {'name': 'system', 'version': 'system'}, }, 'spec': '_', 'short_mod_name': 'foo/1.2.3', @@ -167,8 +167,8 @@ def test_resolve_dependencies(self): 'name': 'gzip', 'version': '1.4', 'versionsuffix': '', - 'toolchain': {'name': 'dummy', 'version': 'dummy'}, - 'dummy': True, + 'toolchain': {'name': 'system', 'version': 'system'}, + 'system': True, 'hidden': False, }], 'parsed': True, @@ -186,8 +186,8 @@ def test_resolve_dependencies(self): 'name': 'toy', 'version': '0.0', 'versionsuffix': '-deps', - 'toolchain': {'name': 'dummy', 'version': 'dummy'}, - 'dummy': True, + 'toolchain': {'name': 'system', 'version': 'system'}, + 'system': True, 'hidden': True, } easyconfig_moredeps = deepcopy(easyconfig_dep) @@ -229,7 +229,7 @@ def test_resolve_dependencies(self): 'version': '1.4', 'versionsuffix': '', 'toolchain': {'name': 'GCC', 'version': '4.6.3'}, - 'dummy': True, + 'system': True, 'hidden': False, }] ecs = [deepcopy(easyconfig_dep)] @@ -255,8 +255,8 @@ def test_resolve_dependencies(self): 'name': 'foss', 'version': '2018a', 'versionsuffix': '', - 'toolchain': {'name': 'dummy', 'version': 'dummy'}, - 'dummy': True, + 'toolchain': {'name': 'system', 'version': 'system'}, + 'system': True, 'hidden': False, }] ecs = [deepcopy(easyconfig_dep)] @@ -319,8 +319,8 @@ def test_resolve_dependencies(self): 'name': 'foss', 'version': '2018a', 'versionsuffix': '', - 'toolchain': {'name': 'dummy', 'version': 'dummy'}, - 'dummy': True, + 'toolchain': {'name': 'system', 'version': 'system'}, + 'system': True, 'hidden': False, }] ecs = [deepcopy(easyconfig_dep)] @@ -342,8 +342,8 @@ def mkdepspec(name, version): 'name': name, 'version': version, 'versionsuffix': '', - 'toolchain': {'name': 'dummy', 'version': 'dummy'}, - 'dummy': True, + 'toolchain': {'name': 'system', 'version': 'system'}, + 'system': True, 'hidden': False, 'short_mod_name': '%s/%s' % (name, version), 'full_mod_name': '%s/%s' % (name, version), @@ -357,7 +357,7 @@ def mkspec(name, version, deps): 'name': name, 'version': version, 'versionsuffix': '', - 'toolchain': {'name': 'dummy', 'version': 'dummy'}, + 'toolchain': {'name': 'system', 'version': 'system'}, }, 'spec': '_', 'short_mod_name': '%s/%s' % (name, version), @@ -496,7 +496,7 @@ def test_resolve_dependencies_minimal(self): self.assertTrue('SQLite/3.8.10.2-foss-2018a' in mods) self.assertFalse('SQLite/3.8.10.2-GCC-6.4.0-2.28' in mods) - # Check whether having 2 version of dummy toolchain is ok + # Check whether having 2 version of system toolchain is ok # Clear easyconfig and toolchain caches ecec._easyconfigs_cache.clear() get_toolchain_hierarchy.clear() @@ -504,7 +504,7 @@ def test_resolve_dependencies_minimal(self): init_config(build_options={ 'allow_modules_tool_mismatch': True, 'minimal_toolchains': True, - 'add_dummy_to_minimal_toolchains': True, + 'add_system_to_minimal_toolchains': True, 'external_modules_metadata': ConfigObj(), 'robot_path': test_easyconfigs, 'valid_module_classes': module_classes(), @@ -512,9 +512,9 @@ def test_resolve_dependencies_minimal(self): }) impi_txt = read_file(os.path.join(test_easyconfigs, 'i', 'impi', 'impi-5.1.2.150.eb')) - self.assertTrue(re.search("^toolchain = {'name': 'dummy', 'version': ''}", impi_txt, re.M)) + self.assertTrue(re.search("^toolchain = SYSTEM", impi_txt, re.M)) gzip_txt = read_file(os.path.join(test_easyconfigs, 'g', 'gzip', 'gzip-1.4.eb')) - self.assertTrue(re.search("^toolchain = {'name': 'dummy', 'version': 'dummy'}", gzip_txt, re.M)) + self.assertTrue(re.search("^toolchain = SYSTEM", gzip_txt, re.M)) barec = os.path.join(self.test_prefix, 'bar-1.2.3-foss-2018a.eb') barec_lines = [ @@ -527,8 +527,8 @@ def test_resolve_dependencies_minimal(self): # to test resolving of dependencies with minimal toolchain # for each of these, we know test easyconfigs are available (which are required here) "dependencies = [", - " ('impi', '5.1.2.150'),", # has toolchain ('dummy', '') - " ('gzip', '1.4'),", # has toolchain ('dummy', 'dummy') + " ('impi', '5.1.2.150'),", # has system toolchain + " ('gzip', '1.4'),", # has system toolchain "]", # toolchain as list line, for easy modification later "toolchain = {'name': 'foss', 'version': '2018a'}", @@ -556,7 +556,7 @@ def test_resolve_dependencies_missing(self): 'name': 'test', 'version': '123', 'versionsuffix': '', - 'toolchain': {'name': 'dummy', 'version': 'dummy'}, + 'toolchain': {'name': 'system', 'version': 'system'}, }, 'spec': '_', 'short_mod_name': 'test/123', @@ -566,8 +566,8 @@ def test_resolve_dependencies_missing(self): 'name': 'somedep', 'version': '4.5.6', 'versionsuffix': '', - 'toolchain': {'name': 'dummy', 'version': 'dummy'}, - 'dummy': True, + 'toolchain': {'name': 'system', 'version': 'system'}, + 'system': True, 'hidden': False, 'short_mod_name': 'somedep/4.5.6', 'full_mod_name': 'somedep/4.5.6', @@ -598,7 +598,7 @@ def test_resolve_dependencies_missing(self): "version = '4.5.6'", "homepage = 'https://example.com'", "description = 'some dep'", - "toolchain = {'name': 'dummy', 'version': ''}", + "toolchain = SYSTEM", ]) write_file(os.path.join(self.test_prefix, 'somedep-4.5.6.eb'), somedep_ectxt) @@ -706,7 +706,7 @@ def test_det_easyconfig_paths_from_pr(self): "versionsuffix = '-test'", "homepage = 'foo'", "description = 'bar'", - "toolchain = {'name': 'dummy', 'version': 'dummy'}", + "toolchain = SYSTEM", ]) write_file(os.path.join(self.test_prefix, 'gompi-2015a-test.eb'), gompi_2015a_txt) @@ -724,7 +724,13 @@ def test_det_easyconfig_paths_from_pr(self): '--github-user=%s' % GITHUB_TEST_ACCOUNT, # a GitHub token should be available for this user '--tmpdir=%s' % self.test_prefix, ] + + # need to allow deprecated because of hitting 'dummy' toolchain + self.allow_deprecated_behaviour() + + self.mock_stderr(True) outtxt = self.eb_main(args, logfile=dummylogfn, raise_error=True) + self.mock_stderr(False) modules = [ (test_ecs_path, 'toy/0.0'), # specified easyconfigs, available at given location @@ -888,9 +894,9 @@ def test_get_toolchain_hierarchy(self): ] self.assertEqual(iccifortcuda_hierarchy, expected) - # test also including dummy + # test also including system init_config(build_options={ - 'add_dummy_to_minimal_toolchains': True, + 'add_system_to_minimal_toolchains': True, 'valid_module_classes': module_classes(), 'robot_path': test_easyconfigs, }) @@ -898,7 +904,7 @@ def test_get_toolchain_hierarchy(self): get_toolchain_hierarchy.clear() gompi_hierarchy = get_toolchain_hierarchy({'name': 'gompi', 'version': '2018a'}) self.assertEqual(gompi_hierarchy, [ - {'name': 'dummy', 'version': ''}, + {'name': 'system', 'version': ''}, {'name': 'GCC', 'version': '6.4.0-2.28'}, {'name': 'gompi', 'version': '2018a'}, ]) @@ -907,7 +913,7 @@ def test_get_toolchain_hierarchy(self): # check whether GCCcore is considered as subtoolchain, even if it's only listed as a dep gcc_hierarchy = get_toolchain_hierarchy({'name': 'GCC', 'version': '4.9.3-2.25'}) self.assertEqual(gcc_hierarchy, [ - {'name': 'dummy', 'version': ''}, + {'name': 'system', 'version': ''}, {'name': 'GCCcore', 'version': '4.9.3'}, {'name': 'GCC', 'version': '4.9.3-2.25'}, ]) @@ -915,14 +921,14 @@ def test_get_toolchain_hierarchy(self): get_toolchain_hierarchy.clear() iccifort_hierarchy = get_toolchain_hierarchy({'name': 'iccifort', 'version': '2016.1.150-GCC-4.9.3-2.25'}) self.assertEqual(iccifort_hierarchy, [ - {'name': 'dummy', 'version': ''}, + {'name': 'system', 'version': ''}, {'name': 'GCCcore', 'version': '4.9.3'}, {'name': 'iccifort', 'version': '2016.1.150-GCC-4.9.3-2.25'}, ]) get_toolchain_hierarchy.clear() build_options = { - 'add_dummy_to_minimal_toolchains': True, + 'add_system_to_minimal_toolchains': True, 'external_modules_metadata': ConfigObj(), 'robot_path': test_easyconfigs, 'valid_module_classes': module_classes(), @@ -930,7 +936,7 @@ def test_get_toolchain_hierarchy(self): init_config(build_options=build_options) craycce_hierarchy = get_toolchain_hierarchy({'name': 'CrayCCE', 'version': '5.1.29'}) self.assertEqual(craycce_hierarchy, [ - {'name': 'dummy', 'version': ''}, + {'name': 'system', 'version': ''}, {'name': 'CrayCCE', 'version': '5.1.29'}, ]) @@ -938,7 +944,7 @@ def test_get_toolchain_hierarchy(self): # test case from https://github.com/eth-cscs/production/blob/master/easybuild/easyconfigs gmvapich2_hierarchy = get_toolchain_hierarchy({'name': 'gmvapich2', 'version': '15.11'}) self.assertEqual(gmvapich2_hierarchy, [ - {'name': 'dummy', 'version': ''}, + {'name': 'system', 'version': ''}, {'name': 'GCCcore', 'version': '4.9.3'}, {'name': 'GCC', 'version': '4.9.3-2.25'}, {'name': 'gmvapich2', 'version': '15.11'}, @@ -964,7 +970,7 @@ def test_find_resolved_modules(self): 'name': 'nodeps', 'version': '1.2.3', 'versionsuffix': '', - 'toolchain': {'name': 'dummy', 'version': 'dummy'}, + 'toolchain': {'name': 'system', 'version': 'system'}, 'dependencies': [], 'full_mod_name': 'nodeps/1.2.3', 'spec': 'nodeps-1.2.3.eb', @@ -1097,7 +1103,7 @@ def test_robot_find_subtoolchain_for_dep(self): new_gzip15_toolchain = robot_find_subtoolchain_for_dep(gzip15, self.modtool) self.assertEqual(new_gzip15_toolchain, gzip15['toolchain']) - # no easyconfig for gzip 1.4 with matching non-dummy (sub)toolchain + # no easyconfig for gzip 1.4 with matching non-system (sub)toolchain gzip14 = { 'name': 'gzip', 'version': '1.4', @@ -1110,10 +1116,10 @@ def test_robot_find_subtoolchain_for_dep(self): gzip14['toolchain'] = {'name': 'gompi', 'version': '2018a'} # - # Second test also including dummy toolchain + # Second test also including system toolchain # init_config(build_options={ - 'add_dummy_to_minimal_toolchains': True, + 'add_system_to_minimal_toolchains': True, 'robot_path': test_easyconfigs, }) # specify alternative parent toolchain @@ -1121,14 +1127,14 @@ def test_robot_find_subtoolchain_for_dep(self): get_toolchain_hierarchy.clear() new_gzip14_toolchain = robot_find_subtoolchain_for_dep(gzip14, self.modtool, parent_tc=gompi_1410) self.assertTrue(new_gzip14_toolchain != gzip14['toolchain']) - self.assertEqual(new_gzip14_toolchain, {'name': 'dummy', 'version': ''}) + self.assertEqual(new_gzip14_toolchain, {'name': 'system', 'version': ''}) # default: use toolchain from dependency gzip14['toolchain'] = gompi_1410 get_toolchain_hierarchy.clear() new_gzip14_toolchain = robot_find_subtoolchain_for_dep(gzip14, self.modtool) self.assertTrue(new_gzip14_toolchain != gzip14['toolchain']) - self.assertEqual(new_gzip14_toolchain, {'name': 'dummy', 'version': ''}) + self.assertEqual(new_gzip14_toolchain, {'name': 'system', 'version': ''}) # check reversed order (parent tc first) and skipping of parent tc itself dep = { @@ -1400,7 +1406,7 @@ def test_check_conflicts_wrapper_deps(self): "version = '0'", "homepage = 'https://example.com'", "description = 'Just A Wrapper'", - "toolchain = {'name': 'dummy', 'version': ''}", + "toolchain = SYSTEM", "dependencies = [('toy', '0.0')]", ]) wrapper_ec = os.path.join(self.test_prefix, 'toy-0.eb') @@ -1422,9 +1428,8 @@ def test_check_conflicts_multi_deps(self): test_ec = os.path.join(self.test_prefix, 'test.eb') test_ec_txt = read_file(toy_ec) - # we need to use empty dummy toolchain version to ensure dependencies are picked up... tc_regex = re.compile(r'^toolchain = .*', re.M) - test_ec_txt = tc_regex.sub("toolchain = {'name': 'dummy', 'version': ''}", test_ec_txt) + test_ec_txt = tc_regex.sub("toolchain = SYSTEM", test_ec_txt) test_ec_txt += "\nmulti_deps = {'GCC': ['4.9.2', '7.3.0-2.30']}\n" test_ec_txt += "dependencies = [('gzip', '1.4')]\n" diff --git a/test/framework/toolchain.py b/test/framework/toolchain.py index 8020158469..45f72de321 100644 --- a/test/framework/toolchain.py +++ b/test/framework/toolchain.py @@ -42,6 +42,7 @@ import easybuild.tools.modules as modules import easybuild.tools.toolchain.compiler from easybuild.framework.easyconfig.easyconfig import EasyConfig, ActiveMNS +from easybuild.toolchains.system import SystemToolchain from easybuild.tools import systemtools as st from easybuild.tools.build_log import EasyBuildError from easybuild.tools.environment import setvar @@ -95,23 +96,69 @@ def test_unknown_toolchain(self): self.assertEqual(tc, None) self.assertTrue(len(all_tcs) > 0) # list of available toolchains + def test_system_toolchain(self): + """Test for system toolchain.""" + for ver in ['system', '']: + tc = self.get_toolchain('system', version=ver) + self.assertTrue(isinstance(tc, SystemToolchain)) + def test_foss_toolchain(self): """Test for foss toolchain.""" self.get_toolchain("foss", version="2018a") - def test_get_variable_dummy_toolchain(self): - """Test get_variable on dummy toolchain""" - tc = self.get_toolchain('dummy', version='dummy') - tc.prepare() - self.assertEqual(tc.get_variable('CC'), '') - self.assertEqual(tc.get_variable('CXX', typ=str), '') - self.assertEqual(tc.get_variable('CFLAGS', typ=list), []) + def test_get_variable_system_toolchain(self): + """Test get_variable on system/dummy toolchain""" - tc = self.get_toolchain('dummy', version='') - tc.prepare() - self.assertEqual(tc.get_variable('CC'), '') - self.assertEqual(tc.get_variable('CXX', typ=str), '') - self.assertEqual(tc.get_variable('CFLAGS', typ=list), []) + # system toolchain version doesn't really matter, but fine... + for ver in ['system', '']: + tc = self.get_toolchain('system', version=ver) + tc.prepare() + self.assertEqual(tc.get_variable('CC'), '') + self.assertEqual(tc.get_variable('CXX', typ=str), '') + self.assertEqual(tc.get_variable('CFLAGS', typ=list), []) + + # dummy toolchain is deprecated, so we need to allow for it (and catch the warnings that get printed) + self.allow_deprecated_behaviour() + + for ver in ['dummy', '']: + self.mock_stderr(True) + tc = self.get_toolchain('dummy', version=ver) + self.mock_stderr(False) + tc.prepare() + self.assertEqual(tc.get_variable('CC'), '') + self.assertEqual(tc.get_variable('CXX', typ=str), '') + self.assertEqual(tc.get_variable('CFLAGS', typ=list), []) + + def test_is_system_toolchain(self): + """Test is_system_toolchain method.""" + for ver in ['system', '']: + tc = self.get_toolchain('system', version=ver) + self.assertTrue(tc.is_system_toolchain()) + + tc = self.get_toolchain('foss', version='2018a') + self.assertFalse(tc.is_system_toolchain()) + + self.setup_sandbox_for_intel_fftw(self.test_prefix) + self.modtool.prepend_module_path(self.test_prefix) + tc = self.get_toolchain('intel', version='2018a') + self.assertFalse(tc.is_system_toolchain()) + + # using dummy toolchain is deprecated, so to test for that we need to explicitely allow using deprecated stuff + error_pattern = "Use of 'dummy' toolchain is deprecated" + for ver in ['dummy', '']: + self.assertErrorRegex(EasyBuildError, error_pattern, self.get_toolchain, 'dummy', version=ver) + + dummy_depr_warning = "WARNING: Deprecated functionality, will no longer work in v5.0: Use of 'dummy' toolchain" + + self.allow_deprecated_behaviour() + + for ver in ['dummy', '']: + self.mock_stderr(True) + tc = self.get_toolchain('dummy', version=ver) + stderr = self.get_stderr() + self.mock_stderr(False) + self.assertTrue(tc.is_system_toolchain()) + self.assertTrue(dummy_depr_warning in stderr) def test_get_variable_compilers(self): """Test get_variable function to obtain compiler variables.""" diff --git a/test/framework/toy_build.py b/test/framework/toy_build.py index 3713a897b6..5b82e2ee29 100644 --- a/test/framework/toy_build.py +++ b/test/framework/toy_build.py @@ -316,7 +316,7 @@ def test_toy_build_formatv2(self): '--force', '--robot=%s' % os.pathsep.join([self.test_buildpath, os.path.dirname(__file__)]), '--software-version=0.0', - '--toolchain=dummy,dummy', + '--toolchain=system,system', '--experimental', ] outtxt = self.eb_main(args, logfile=self.dummylogfn, do_build=True, verbose=True) @@ -387,7 +387,7 @@ def test_toy_build_formatv2_sections(self): '--force', '--robot=%s' % os.pathsep.join([self.test_buildpath, os.path.dirname(__file__)]), '--software-version=%s' % version, - '--toolchain=dummy,dummy', + '--toolchain=system,system', '--experimental', ] outtxt = self.eb_main(args, logfile=self.dummylogfn, do_build=True, verbose=True, raise_error=True) @@ -795,9 +795,9 @@ def test_toy_hierarchical(self): self.assertTrue(False, "Unknown module syntax: %s" % get_module_syntax()) os.remove(toy_module_path) - # test module path with dummy/dummy build + # test module path with system/system build extra_args = [ - '--try-toolchain=dummy,dummy', + '--try-toolchain=system,system', ] self.eb_main(args + extra_args, logfile=self.dummylogfn, do_build=True, verbose=True, raise_error=True) @@ -812,9 +812,9 @@ def test_toy_hierarchical(self): self.assertFalse(re.search("module load", modtxt)) os.remove(toy_module_path) - # test module path with dummy/dummy build, pretend to be a compiler by setting moduleclass + # test module path with system/system build, pretend to be a compiler by setting moduleclass extra_args = [ - '--try-toolchain=dummy,dummy', + '--try-toolchain=system,system', '--try-amend=moduleclass=compiler', ] self.eb_main(args + extra_args, logfile=self.dummylogfn, do_build=True, verbose=True, raise_error=True) @@ -970,7 +970,7 @@ def test_toy_hierarchical_subdir_user_modules(self): "Pattern '%s' not found in: %s" % (regex.pattern, toy_modtxt)) def test_toy_advanced(self): - """Test toy build with extensions and non-dummy toolchain.""" + """Test toy build with extensions and non-system toolchain.""" test_dir = os.path.abspath(os.path.dirname(__file__)) os.environ['MODULEPATH'] = os.path.join(test_dir, 'modules') test_ec = os.path.join(test_dir, 'easyconfigs', 'test_ecs', 't', 'toy', 'toy-0.0-gompi-2018a-test.eb') diff --git a/test/framework/tweak.py b/test/framework/tweak.py index e619adac1a..7cc9d95fd8 100644 --- a/test/framework/tweak.py +++ b/test/framework/tweak.py @@ -40,7 +40,7 @@ from easybuild.framework.easyconfig.tweak import map_toolchain_hierarchies, map_easyconfig_to_target_tc_hierarchy from easybuild.tools.build_log import EasyBuildError from easybuild.tools.config import module_classes -from easybuild.tools.filetools import write_file +from easybuild.tools.filetools import change_dir, write_file class TweakTest(EnhancedTestCase): @@ -127,14 +127,14 @@ def test_obtain_ec_for(self): self.assertEqual(os.path.basename(ec_file), 'GCC-7.3.0-2.30.eb') # generate non-existing easyconfig - os.chdir(self.test_prefix) + change_dir(self.test_prefix) specs = { 'name': 'GCC', - 'version': '5.4.3', + 'version': '4.9.0', } (generated, ec_file) = obtain_ec_for(specs, [test_easyconfigs_path]) self.assertTrue(generated) - self.assertEqual(os.path.basename(ec_file), 'GCC-5.4.3.eb') + self.assertEqual(os.path.basename(ec_file), 'GCC-4.9.0.eb') def test_tweak_one_version(self): """Test tweak_one function"""