diff --git a/lib/spack/spack/ci/__init__.py b/lib/spack/spack/ci/__init__.py index 408abc85187..8407b9cf0e9 100644 --- a/lib/spack/spack/ci/__init__.py +++ b/lib/spack/spack/ci/__init__.py @@ -24,7 +24,6 @@ import spack import spack.binary_distribution as bindist import spack.builder -import spack.concretize import spack.config as cfg import spack.environment as ev import spack.error @@ -375,10 +374,9 @@ def generate_pipeline(env: ev.Environment, args) -> None: args: (spack.main.SpackArgumentParser): Parsed arguments from the command line. """ - with spack.concretize.disable_compiler_existence_check(): - with env.write_transaction(): - env.concretize() - env.write() + with env.write_transaction(): + env.concretize() + env.write() options = collect_pipeline_options(env, args) diff --git a/lib/spack/spack/ci/common.py b/lib/spack/spack/ci/common.py index ca2bffd753c..c966d67c8a0 100644 --- a/lib/spack/spack/ci/common.py +++ b/lib/spack/spack/ci/common.py @@ -232,10 +232,8 @@ def build_name(self, spec: Optional[spack.spec.Spec] = None) -> Optional[str]: Returns: (str) given spec's CDash build name.""" if spec: - build_name = ( - f"{spec.name}@{spec.version}%{spec.compiler} " - f"hash={spec.dag_hash()} arch={spec.architecture} ({self.build_group})" - ) + spec_str = spec.format("{name}{@version}{%compiler} hash={hash} arch={architecture}") + build_name = f"{spec_str} ({self.build_group})" tty.debug(f"Generated CDash build name ({build_name}) from the {spec.name}") return build_name diff --git a/lib/spack/spack/cmd/mirror.py b/lib/spack/spack/cmd/mirror.py index 677549ef454..779b5fa8acb 100644 --- a/lib/spack/spack/cmd/mirror.py +++ b/lib/spack/spack/cmd/mirror.py @@ -10,7 +10,6 @@ import spack.caches import spack.cmd -import spack.concretize import spack.config import spack.environment as ev import spack.mirrors.mirror @@ -515,16 +514,15 @@ def extend_with_dependencies(specs): def concrete_specs_from_cli_or_file(args): tty.msg("Concretizing input specs") - with spack.concretize.disable_compiler_existence_check(): - if args.specs: - specs = spack.cmd.parse_specs(args.specs, concretize=True) - if not specs: - raise SpackError("unable to parse specs from command line") + if args.specs: + specs = spack.cmd.parse_specs(args.specs, concretize=True) + if not specs: + raise SpackError("unable to parse specs from command line") - if args.file: - specs = specs_from_text_file(args.file, concretize=True) - if not specs: - raise SpackError("unable to parse specs from file '{}'".format(args.file)) + if args.file: + specs = specs_from_text_file(args.file, concretize=True) + if not specs: + raise SpackError("unable to parse specs from file '{}'".format(args.file)) return specs diff --git a/lib/spack/spack/concretize.py b/lib/spack/spack/concretize.py index ad925ee1033..f3431a7e7b0 100644 --- a/lib/spack/spack/concretize.py +++ b/lib/spack/spack/concretize.py @@ -4,7 +4,6 @@ """High-level functions to concretize list of specs""" import sys import time -from contextlib import contextmanager from typing import Iterable, List, Optional, Sequence, Tuple, Union import llnl.util.tty as tty @@ -17,25 +16,6 @@ import spack.util.parallel from spack.spec import ArchSpec, CompilerSpec, Spec -CHECK_COMPILER_EXISTENCE = True - - -@contextmanager -def disable_compiler_existence_check(): - global CHECK_COMPILER_EXISTENCE - CHECK_COMPILER_EXISTENCE, saved = False, CHECK_COMPILER_EXISTENCE - yield - CHECK_COMPILER_EXISTENCE = saved - - -@contextmanager -def enable_compiler_existence_check(): - global CHECK_COMPILER_EXISTENCE - CHECK_COMPILER_EXISTENCE, saved = True, CHECK_COMPILER_EXISTENCE - yield - CHECK_COMPILER_EXISTENCE = saved - - SpecPairInput = Tuple[Spec, Optional[Spec]] SpecPair = Tuple[Spec, Spec] SpecLike = Union[Spec, str] diff --git a/lib/spack/spack/test/architecture.py b/lib/spack/spack/test/architecture.py index 991cc3f8cb9..7d4df65646c 100644 --- a/lib/spack/spack/test/architecture.py +++ b/lib/spack/spack/test/architecture.py @@ -7,7 +7,6 @@ import archspec.cpu -import spack.concretize import spack.operating_systems import spack.platforms from spack.spec import ArchSpec, Spec @@ -132,6 +131,5 @@ def test_concretize_target_ranges(root_target_range, dep_target_range, result, m spec = Spec( f"pkg-a %gcc@10 foobar=bar target={root_target_range} ^pkg-b target={dep_target_range}" ) - with spack.concretize.disable_compiler_existence_check(): - spec.concretize() + spec.concretize() assert spec.target == spec["pkg-b"].target == result