From d862507bcf41a80ecb98493aef5d5bcd7d2a0518 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Fri, 12 Nov 2021 08:34:18 +0100 Subject: Fix overloaded argparse keys (#27379) Commands should not reuse option names defined in main. --- share/spack/spack-completion.bash | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'share') diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash index e9022d47bb..fa3ebd3c3e 100755 --- a/share/spack/spack-completion.bash +++ b/share/spack/spack-completion.bash @@ -969,12 +969,7 @@ _spack_env_st() { } _spack_env_loads() { - if $list_options - then - SPACK_COMPREPLY="-h --help -n --module-set-name -m --module-type --input-only -p --prefix -x --exclude -r --dependencies" - else - _environments - fi + SPACK_COMPREPLY="-h --help -n --module-set-name -m --module-type --input-only -p --prefix -x --exclude -r --dependencies" } _spack_env_view() { -- cgit v1.2.3-70-g09d2 From 654f6839ebe33d64710b5e7f3c388539e84f8e35 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Thu, 18 Nov 2021 13:00:39 +0100 Subject: ci: run style unit tests only if we target develop (#27472) Some tests assume the base branch is develop, but this branch may not have been checked out. --- .github/workflows/setup_git.sh | 9 ++++----- .github/workflows/unit_tests.yaml | 2 ++ lib/spack/spack/test/cmd/style.py | 13 ++++++++++++- lib/spack/spack/test/package_sanity.py | 6 +++++- share/spack/qa/run-style-tests | 10 +++++----- 5 files changed, 28 insertions(+), 12 deletions(-) (limited to 'share') diff --git a/.github/workflows/setup_git.sh b/.github/workflows/setup_git.sh index bd79daf268..e319e07512 100755 --- a/.github/workflows/setup_git.sh +++ b/.github/workflows/setup_git.sh @@ -1,9 +1,8 @@ #!/usr/bin/env sh git config --global user.email "spack@example.com" git config --global user.name "Test User" -# With fetch-depth: 0 we have a remote develop -# but not a local branch. Don't do this on develop -if [ "$(git branch --show-current)" != "develop" ] -then - git branch develop origin/develop + +# create a local pr base branch +if [[ -n $GITHUB_BASE_REF ]]; then + git fetch origin "${GITHUB_BASE_REF}:${GITHUB_BASE_REF}" fi diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml index 35722b9137..764a9cdcf0 100644 --- a/.github/workflows/unit_tests.yaml +++ b/.github/workflows/unit_tests.yaml @@ -211,6 +211,7 @@ jobs: git clone "${{ github.server_url }}/${{ github.repository }}.git" && cd spack git fetch origin "${{ github.ref }}:test-branch" git checkout test-branch + . .github/workflows/setup_git.sh bin/spack unit-test -x - name: Run unit tests (only package tests) if: ${{ needs.changes.outputs.with_coverage == 'false' }} @@ -223,6 +224,7 @@ jobs: git clone "${{ github.server_url }}/${{ github.repository }}.git" && cd spack git fetch origin "${{ github.ref }}:test-branch" git checkout test-branch + . .github/workflows/setup_git.sh bin/spack unit-test -x -m "not maybeslow" -k "package_sanity" # Test RHEL8 UBI with platform Python. This job is run diff --git a/lib/spack/spack/test/cmd/style.py b/lib/spack/spack/test/cmd/style.py index af0fc47d24..29cde14400 100644 --- a/lib/spack/spack/test/cmd/style.py +++ b/lib/spack/spack/test/cmd/style.py @@ -24,8 +24,19 @@ style_data = os.path.join(spack.paths.test_path, 'data', 'style') style = spack.main.SpackCommand("style") + +def has_develop_branch(): + git = which('git') + if not git: + return False + git("show-ref", "--verify", "--quiet", + "refs/heads/develop", fail_on_error=False) + return git.returncode == 0 + + # spack style requires git to run -- skip the tests if it's not there -pytestmark = pytest.mark.skipif(not which('git'), reason='requires git') +pytestmark = pytest.mark.skipif(not has_develop_branch(), + reason='requires git with develop branch') # The style tools have requirements to use newer Python versions. We simplify by # requiring Python 3.6 or higher to run spack style. diff --git a/lib/spack/spack/test/package_sanity.py b/lib/spack/spack/test/package_sanity.py index 35840d85da..dd2f4b425f 100644 --- a/lib/spack/spack/test/package_sanity.py +++ b/lib/spack/spack/test/package_sanity.py @@ -206,8 +206,12 @@ def test_prs_update_old_api(): """Ensures that every package modified in a PR doesn't contain deprecated calls to any method. """ + ref = os.getenv("GITHUB_BASE_REF") + if not ref: + pytest.skip("No base ref found") + changed_package_files = [ - x for x in style.changed_files() if style.is_package(x) + x for x in style.changed_files(base=ref) if style.is_package(x) ] failing = [] for file in changed_package_files: diff --git a/share/spack/qa/run-style-tests b/share/spack/qa/run-style-tests index 72c47ff055..9f0cbdb266 100755 --- a/share/spack/qa/run-style-tests +++ b/share/spack/qa/run-style-tests @@ -14,15 +14,15 @@ # Usage: # run-flake8-tests # -. "$(dirname $0)/setup.sh" +. "$(dirname "$0")/setup.sh" -BASE="" -if [ -n "$GITHUB_BASE_REF" ]; then - BASE="--base ${GITHUB_BASE_REF}" +args=() +if [[ -n $GITHUB_BASE_REF ]]; then + args+=("--base" "${GITHUB_BASE_REF}") fi # verify that the code style is correct -spack style --root-relative $BASE +spack style --root-relative "${args[@]}" # verify that the license headers are present spack license verify -- cgit v1.2.3-70-g09d2 From 9345bf81b95641a4e9728664f87777ed05f56b8f Mon Sep 17 00:00:00 2001 From: Greg Becker Date: Tue, 14 Dec 2021 23:52:53 -0800 Subject: Add option to minimize full debug cores. include warning message about performance (#27970) Co-authored-by: Harmen Stoppels --- lib/spack/spack/error.py | 17 ++++-------- lib/spack/spack/main.py | 18 +++++++++++++ lib/spack/spack/solver/asp.py | 53 +++++++++++++++++++++++++++++++++----- lib/spack/spack/test/concretize.py | 6 +++-- share/spack/spack-completion.bash | 2 +- 5 files changed, 74 insertions(+), 22 deletions(-) (limited to 'share') diff --git a/lib/spack/spack/error.py b/lib/spack/spack/error.py index be49656c07..700f4ea1d8 100644 --- a/lib/spack/spack/error.py +++ b/lib/spack/spack/error.py @@ -123,18 +123,11 @@ class UnsatisfiableSpecError(SpecError): For original concretizer, provide the requirement that was violated when raising. """ - def __init__(self, provided, required=None, constraint_type=None, conflicts=None): - # required is only set by the original concretizer. - # clingo concretizer handles error messages differently. - if required is not None: - assert not conflicts # can't mix formats - super(UnsatisfiableSpecError, self).__init__( - "%s does not satisfy %s" % (provided, required)) - else: - indented = [' %s\n' % conflict for conflict in conflicts] - conflict_msg = ''.join(indented) - msg = '%s is unsatisfiable, conflicts are:\n%s' % (provided, conflict_msg) - super(UnsatisfiableSpecError, self).__init__(msg) + def __init__(self, provided, required, constraint_type): + # This is only the entrypoint for old concretizer errors + super(UnsatisfiableSpecError, self).__init__( + "%s does not satisfy %s" % (provided, required)) + self.provided = provided self.required = required self.constraint_type = constraint_type diff --git a/lib/spack/spack/main.py b/lib/spack/spack/main.py index 86f5c76002..f41423fa1e 100644 --- a/lib/spack/spack/main.py +++ b/lib/spack/spack/main.py @@ -41,6 +41,7 @@ import spack.modules import spack.paths import spack.platforms import spack.repo +import spack.solver.asp import spack.spec import spack.store import spack.util.debug @@ -380,6 +381,13 @@ def make_argument_parser(**kwargs): # stat names in groups of 7, for nice wrapping. stat_lines = list(zip(*(iter(stat_names),) * 7)) + # help message for --show-cores + show_cores_help = 'provide additional information on concretization failures\n' + show_cores_help += 'off (default): show only the violated rule\n' + show_cores_help += 'full: show raw unsat cores from clingo\n' + show_cores_help += 'minimized: show subset-minimal unsat cores ' + show_cores_help += '(Warning: this may take hours for some specs)' + parser.add_argument( '-h', '--help', dest='help', action='store_const', const='short', default=None, @@ -403,6 +411,9 @@ def make_argument_parser(**kwargs): '-d', '--debug', action='count', default=0, help="write out debug messages " "(more d's for more verbosity: -d, -dd, -ddd, etc.)") + parser.add_argument( + '--show-cores', choices=["off", "full", "minimized"], default="off", + help=show_cores_help) parser.add_argument( '--timestamp', action='store_true', help="Add a timestamp to tty output") @@ -486,6 +497,13 @@ def setup_main_options(args): spack.config.set('config:debug', True, scope='command_line') spack.util.environment.tracing_enabled = True + if args.show_cores != "off": + # minimize_cores defaults to true, turn it off if we're showing full core + # but don't want to wait to minimize it. + spack.solver.asp.full_cores = True + if args.show_cores == 'full': + spack.solver.asp.minimize_cores = False + if args.timestamp: tty.set_timestamp(True) diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py index 4ad05cd9bf..957f363960 100644 --- a/lib/spack/spack/solver/asp.py +++ b/lib/spack/spack/solver/asp.py @@ -59,6 +59,14 @@ ASTType = None parse_files = None +#: whether we should write ASP unsat cores quickly in debug mode when the cores +#: may be very large or take the time (sometimes hours) to minimize them +minimize_cores = True + +#: whether we should include all facts in the unsat cores or only error messages +full_cores = False + + # backward compatibility functions for clingo ASTs def ast_getter(*names): def getter(node): @@ -393,10 +401,12 @@ class Result(object): if len(constraints) == 1: constraints = constraints[0] - debug = spack.config.get('config:debug', False) - conflicts = self.format_cores() if debug else self.format_minimal_cores() + if minimize_cores: + conflicts = self.format_minimal_cores() + else: + conflicts = self.format_cores() - raise spack.error.UnsatisfiableSpecError(constraints, conflicts=conflicts) + raise UnsatisfiableSpecError(constraints, conflicts=conflicts) @property def specs(self): @@ -512,10 +522,9 @@ class PyclingoDriver(object): atom = self.backend.add_atom(symbol) - # in debug mode, make all facts choices/assumptions - # otherwise, only if we're generating cores and assumption=True - debug = spack.config.get('config:debug', False) - choice = debug or (self.cores and assumption) + # with `--show-cores=full or --show-cores=minimized, make all facts + # choices/assumptions, otherwise only if assumption=True + choice = self.cores and (full_cores or assumption) self.backend.add_rule([atom], [], choice=choice) if choice: @@ -2044,3 +2053,33 @@ def solve(specs, dump=(), models=0, timers=False, stats=False, tests=False, return driver.solve( setup, specs, dump, models, timers, stats, tests, reuse ) + + +class UnsatisfiableSpecError(spack.error.UnsatisfiableSpecError): + """ + Subclass for new constructor signature for new concretizer + """ + def __init__(self, provided, conflicts): + indented = [' %s\n' % conflict for conflict in conflicts] + conflict_msg = ''.join(indented) + issue = 'conflicts' if full_cores else 'errors' + msg = '%s is unsatisfiable, %s are:\n%s' % (provided, issue, conflict_msg) + + newline_indent = '\n ' + if not full_cores: + msg += newline_indent + 'To see full clingo unsat cores, ' + msg += 're-run with `spack --show-cores=full`' + if not minimize_cores or not full_cores: + # not solver.minimalize_cores and not solver.full_cores impossible + msg += newline_indent + 'For full, subset-minimal unsat cores, ' + msg += 're-run with `spack --show-cores=minimized' + msg += newline_indent + msg += 'Warning: This may take (up to) hours for some specs' + + super(spack.error.UnsatisfiableSpecError, self).__init__(msg) + + self.provided = provided + + # Add attribute expected of the superclass interface + self.required = None + self.constraint_type = None diff --git a/lib/spack/spack/test/concretize.py b/lib/spack/spack/test/concretize.py index 5e9188b888..179a4e26d8 100644 --- a/lib/spack/spack/test/concretize.py +++ b/lib/spack/spack/test/concretize.py @@ -557,11 +557,13 @@ class TestConcretize(object): with pytest.raises(spack.error.SpackError): s.concretize() - def test_conflicts_new_concretizer_debug(self, conflict_spec, mutable_config): + def test_conflicts_show_cores(self, conflict_spec, monkeypatch): if spack.config.get('config:concretizer') == 'original': pytest.skip('Testing debug statements specific to new concretizer') - spack.config.set('config:debug', True) + monkeypatch.setattr(spack.solver.asp, 'full_cores', True) + monkeypatch.setattr(spack.solver.asp, 'minimize_cores', False) + s = Spec(conflict_spec) with pytest.raises(spack.error.SpackError) as e: s.concretize() diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash index fa3ebd3c3e..c7e4d10197 100755 --- a/share/spack/spack-completion.bash +++ b/share/spack/spack-completion.bash @@ -335,7 +335,7 @@ _spacktivate() { _spack() { if $list_options then - SPACK_COMPREPLY="-h --help -H --all-help --color -c --config -C --config-scope -d --debug --timestamp --pdb -e --env -D --env-dir -E --no-env --use-env-repo -k --insecure -l --enable-locks -L --disable-locks -m --mock -p --profile --sorted-profile --lines -v --verbose --stacktrace -V --version --print-shell-vars" + SPACK_COMPREPLY="-h --help -H --all-help --color -c --config -C --config-scope -d --debug --show-cores --timestamp --pdb -e --env -D --env-dir -E --no-env --use-env-repo -k --insecure -l --enable-locks -L --disable-locks -m --mock -p --profile --sorted-profile --lines -v --verbose --stacktrace -V --version --print-shell-vars" else SPACK_COMPREPLY="activate add analyze arch audit blame bootstrap build-env buildcache cd checksum ci clean clone commands compiler compilers concretize config containerize create deactivate debug dependencies dependents deprecate dev-build develop diff docs edit env extensions external fetch find flake8 gc gpg graph help info install license list load location log-parse maintainers mark mirror module monitor patch pkg providers pydoc python reindex remove rm repo resource restage solve spec stage style tags test test-env tutorial undevelop uninstall unit-test unload url verify versions view" fi -- cgit v1.2.3-70-g09d2 From 37fbe30c4a5b6b9c453078270f7511cc5a1eb146 Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Thu, 16 Dec 2021 10:47:15 +0100 Subject: Added opensuse/leap:15 to spack containerize (#27837) Co-authored-by: Massimiliano Culpo --- lib/spack/docs/containers.rst | 3 +++ lib/spack/spack/container/images.json | 18 ++++++++++++++++++ share/spack/docker/leap-15.dockerfile | 21 ++++++++++++++++----- share/spack/templates/container/leap-15.dockerfile | 21 +++++++++++++++++++++ 4 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 share/spack/templates/container/leap-15.dockerfile (limited to 'share') diff --git a/lib/spack/docs/containers.rst b/lib/spack/docs/containers.rst index 3d32de0841..57a9cad189 100644 --- a/lib/spack/docs/containers.rst +++ b/lib/spack/docs/containers.rst @@ -129,6 +129,9 @@ are currently supported are summarized in the table below: * - CentOS 7 - ``centos:7`` - ``spack/centos7`` + * - openSUSE Leap + - ``opensuse/leap`` + - ``spack/leap15`` All the images are tagged with the corresponding release of Spack: diff --git a/lib/spack/spack/container/images.json b/lib/spack/spack/container/images.json index ee4e5a2caa..b82596f20c 100644 --- a/lib/spack/spack/container/images.json +++ b/lib/spack/spack/container/images.json @@ -28,6 +28,19 @@ "develop": "latest" } }, + "opensuse/leap:15": { + "bootstrap": { + "template": "container/leap-15.dockerfile" + }, + "os_package_manager": "zypper", + "build": "spack/leap15", + "build_tags": { + "develop": "latest" + }, + "final": { + "image": "opensuse/leap:latest" + } + }, "nvidia/cuda:11.2.1": { "bootstrap": { "template": "container/cuda_11_2_1.dockerfile", @@ -85,6 +98,11 @@ "update": "yum update -y && amazon-linux-extras install epel -y", "install": "yum install -y", "clean": "rm -rf /var/cache/yum && yum clean all" + }, + "zypper": { + "update": "zypper update -y", + "install": "zypper install -y", + "clean": "rm -rf /var/cache/zypp && zypper clean -a" } } } diff --git a/share/spack/docker/leap-15.dockerfile b/share/spack/docker/leap-15.dockerfile index 65375c359b..1bf41c6149 100644 --- a/share/spack/docker/leap-15.dockerfile +++ b/share/spack/docker/leap-15.dockerfile @@ -2,7 +2,7 @@ FROM opensuse/leap:15.3 MAINTAINER Christian Goll ENV DOCKERFILE_BASE=opensuse \ - DOCKERFILE_DISTRO=opensuse_leap \ + DOCKERFILE_DISTRO=leap \ DOCKERFILE_DISTRO_VERSION=15.3 \ SPACK_ROOT=/opt/spack \ DEBIAN_FRONTEND=noninteractive \ @@ -11,10 +11,21 @@ ENV DOCKERFILE_BASE=opensuse \ RUN zypper ref && \ zypper up -y && \ - zypper in -y python3-base python3-boto3 \ - xz gzip tar bzip2 curl patch patchelf file \ - gcc-c++ gcc-fortran make cmake automake && \ - zypper clean + zypper in -y \ + bzip2\ + curl\ + file\ + gcc-c++\ + gcc-fortran\ + make\ + gzip\ + patch\ + patchelf\ + python3-base \ + python3-boto3\ + tar\ + xz\ +&& zypper clean # clean up manpages RUN rm -rf /var/cache/zypp/* \ diff --git a/share/spack/templates/container/leap-15.dockerfile b/share/spack/templates/container/leap-15.dockerfile new file mode 100644 index 0000000000..38e4f1c009 --- /dev/null +++ b/share/spack/templates/container/leap-15.dockerfile @@ -0,0 +1,21 @@ +{% extends "container/bootstrap-base.dockerfile" %} +{% block install_os_packages %} +RUN zypper ref && \ + zypper up -y && \ + zypper in -y \ + bzip2\ + curl\ + file\ + gcc-c++\ + gcc-fortran\ + make\ + git\ + gzip\ + patch\ + patchelf\ + python3-base \ + python3-boto3\ + tar\ + xz\ +&& zypper clean +{% endblock %} -- cgit v1.2.3-70-g09d2 From 17edf1ae90a9b56eb50ec002027a424bef58d97d Mon Sep 17 00:00:00 2001 From: victorusu Date: Fri, 17 Dec 2021 10:05:32 +0100 Subject: Add setdefault option to tcl module (#14686) This commit introduces the command spack module tcl setdefault similar to the one already available for lmod Co-authored-by: Massimiliano Culpo --- lib/spack/spack/cmd/modules/lmod.py | 30 +++++++++++++++++----------- lib/spack/spack/cmd/modules/tcl.py | 40 ++++++++++++++++++++++++++++++++++--- lib/spack/spack/modules/common.py | 3 +++ lib/spack/spack/test/cmd/module.py | 14 ++++++++++--- share/spack/spack-completion.bash | 11 +++++++++- 5 files changed, 79 insertions(+), 19 deletions(-) (limited to 'share') diff --git a/lib/spack/spack/cmd/modules/lmod.py b/lib/spack/spack/cmd/modules/lmod.py index d28ccb3eaf..1920f8ec66 100644 --- a/lib/spack/spack/cmd/modules/lmod.py +++ b/lib/spack/spack/cmd/modules/lmod.py @@ -4,12 +4,11 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import functools -import os - -import llnl.util.filesystem import spack.cmd.common.arguments import spack.cmd.modules +import spack.config +import spack.modules.lmod def add_command(parser, command_dict): @@ -41,12 +40,19 @@ def setdefault(module_type, specs, args): # https://lmod.readthedocs.io/en/latest/060_locating.html#marking-a-version-as-default # spack.cmd.modules.one_spec_or_raise(specs) - writer = spack.modules.module_types['lmod']( - specs[0], args.module_set_name) - - module_folder = os.path.dirname(writer.layout.filename) - module_basename = os.path.basename(writer.layout.filename) - with llnl.util.filesystem.working_dir(module_folder): - if os.path.exists('default') and os.path.islink('default'): - os.remove('default') - os.symlink(module_basename, 'default') + spec = specs[0] + data = { + 'modules': { + args.module_set_name: { + 'lmod': { + 'defaults': [str(spec)] + } + } + } + } + # Need to clear the cache if a SpackCommand is called during scripting + spack.modules.lmod.configuration_registry = {} + scope = spack.config.InternalConfigScope('lmod-setdefault', data) + with spack.config.override(scope): + writer = spack.modules.module_types['lmod'](spec, args.module_set_name) + writer.update_module_defaults() diff --git a/lib/spack/spack/cmd/modules/tcl.py b/lib/spack/spack/cmd/modules/tcl.py index a9486b9de4..5a29bc6df5 100644 --- a/lib/spack/spack/cmd/modules/tcl.py +++ b/lib/spack/spack/cmd/modules/tcl.py @@ -2,18 +2,52 @@ # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) - import functools +import spack.cmd.common.arguments import spack.cmd.modules +import spack.config +import spack.modules.tcl def add_command(parser, command_dict): tcl_parser = parser.add_parser( 'tcl', help='manipulate non-hierarchical module files' ) - spack.cmd.modules.setup_parser(tcl_parser) + sp = spack.cmd.modules.setup_parser(tcl_parser) + + # Set default module file for a package + setdefault_parser = sp.add_parser( + 'setdefault', help='set the default module file for a package' + ) + spack.cmd.common.arguments.add_common_arguments( + setdefault_parser, ['constraint'] + ) + + callbacks = dict(spack.cmd.modules.callbacks.items()) + callbacks['setdefault'] = setdefault command_dict['tcl'] = functools.partial( - spack.cmd.modules.modules_cmd, module_type='tcl' + spack.cmd.modules.modules_cmd, module_type='tcl', callbacks=callbacks ) + + +def setdefault(module_type, specs, args): + """Set the default module file, when multiple are present""" + # Currently, accepts only a single matching spec + spack.cmd.modules.one_spec_or_raise(specs) + spec = specs[0] + data = { + 'modules': { + args.module_set_name: { + 'tcl': { + 'defaults': [str(spec)] + } + } + } + } + spack.modules.tcl.configuration_registry = {} + scope = spack.config.InternalConfigScope('tcl-setdefault', data) + with spack.config.override(scope): + writer = spack.modules.module_types['tcl'](spec, args.module_set_name) + writer.update_module_defaults() diff --git a/lib/spack/spack/modules/common.py b/lib/spack/spack/modules/common.py index 8855e57e64..aee1c1cc17 100644 --- a/lib/spack/spack/modules/common.py +++ b/lib/spack/spack/modules/common.py @@ -906,6 +906,9 @@ class BaseModuleFileWriter(object): fp.set_permissions_by_spec(self.layout.filename, self.spec) # Symlink defaults if needed + self.update_module_defaults() + + def update_module_defaults(self): if any(self.spec.satisfies(default) for default in self.conf.defaults): # This spec matches a default, it needs to be symlinked to default # Symlink to a tmp location first and move, so that existing diff --git a/lib/spack/spack/test/cmd/module.py b/lib/spack/spack/test/cmd/module.py index 3bced1d335..b157e1be6b 100644 --- a/lib/spack/spack/test/cmd/module.py +++ b/lib/spack/spack/test/cmd/module.py @@ -178,10 +178,18 @@ writer_cls = spack.modules.lmod.LmodModulefileWriter @pytest.mark.db def test_setdefault_command( - mutable_database, module_configuration + mutable_database, mutable_config ): - module_configuration('autoload_direct') - + data = { + 'default': { + 'enable': ['lmod'], + 'lmod': { + 'core_compilers': ['clang@3.3'], + 'hierarchy': ['mpi'] + } + } + } + spack.config.set('modules', data) # Install two different versions of a package other_spec, preferred = 'a@1.0', 'a@2.0' diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash index c7e4d10197..b41a21946c 100755 --- a/share/spack/spack-completion.bash +++ b/share/spack/spack-completion.bash @@ -1382,7 +1382,7 @@ _spack_module_tcl() { then SPACK_COMPREPLY="-h --help -n --name" else - SPACK_COMPREPLY="refresh find rm loads" + SPACK_COMPREPLY="refresh find rm loads setdefault" fi } @@ -1422,6 +1422,15 @@ _spack_module_tcl_loads() { fi } +_spack_module_tcl_setdefault() { + if $list_options + then + SPACK_COMPREPLY="-h --help" + else + _installed_packages + fi +} + _spack_monitor() { SPACK_COMPREPLY="-h --help --monitor --monitor-save-local --monitor-no-auth --monitor-tags --monitor-keep-going --monitor-host --monitor-prefix" } -- cgit v1.2.3-70-g09d2 From e974b44e8673ded449ce4a3ed5844398b68e81a2 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Thu, 23 Dec 2021 16:34:31 +0100 Subject: Fix execution of style tests --- share/spack/qa/run-style-tests | 2 ++ 1 file changed, 2 insertions(+) (limited to 'share') diff --git a/share/spack/qa/run-style-tests b/share/spack/qa/run-style-tests index 9f0cbdb266..df3d441c75 100755 --- a/share/spack/qa/run-style-tests +++ b/share/spack/qa/run-style-tests @@ -19,6 +19,8 @@ args=() if [[ -n $GITHUB_BASE_REF ]]; then args+=("--base" "${GITHUB_BASE_REF}") +else + args+=("--base" "${GITHUB_REF_NAME}") fi # verify that the code style is correct -- cgit v1.2.3-70-g09d2