diff --git a/lib/spack/spack/ci/__init__.py b/lib/spack/spack/ci/__init__.py index c084989ab01..c796a79a18d 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 @@ -380,10 +379,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 43481679c66..68e0d91c17e 100644 --- a/lib/spack/spack/ci/common.py +++ b/lib/spack/spack/ci/common.py @@ -209,10 +209,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 b13a9ee8b52..512931e11b4 100644 --- a/lib/spack/spack/cmd/mirror.py +++ b/lib/spack/spack/cmd/mirror.py @@ -515,16 +515,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 b6e10c1766b..8bd561acb88 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] TestsType = Union[bool, Iterable[str]] diff --git a/lib/spack/spack/test/architecture.py b/lib/spack/spack/test/architecture.py index 8562be992f1..c94010c4c87 100644 --- a/lib/spack/spack/test/architecture.py +++ b/lib/spack/spack/test/architecture.py @@ -128,9 +128,7 @@ def test_satisfy_strict_constraint_when_not_concrete(architecture_tuple, constra str(archspec.cpu.host().family) != "x86_64", reason="tests are for x86_64 uarch ranges" ) def test_concretize_target_ranges(root_target_range, dep_target_range, result, monkeypatch): - spec = Spec( + spec = spack.concretize.concretize_one( 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 = spack.concretize.concretize_one(spec) assert spec.target == spec["pkg-b"].target == result