delete redundant spack.concretize.CHECK_COMPILER_EXISTENCE

This commit is contained in:
Harmen Stoppels 2024-12-09 10:02:51 +01:00 committed by Massimiliano Culpo
parent 0bd8ca4e08
commit c3ddea9061
No known key found for this signature in database
GPG Key ID: 3E52BB992233066C
5 changed files with 14 additions and 41 deletions

View File

@ -24,7 +24,6 @@
import spack import spack
import spack.binary_distribution as bindist import spack.binary_distribution as bindist
import spack.builder import spack.builder
import spack.concretize
import spack.config as cfg import spack.config as cfg
import spack.environment as ev import spack.environment as ev
import spack.error import spack.error
@ -380,7 +379,6 @@ def generate_pipeline(env: ev.Environment, args) -> None:
args: (spack.main.SpackArgumentParser): Parsed arguments from the command args: (spack.main.SpackArgumentParser): Parsed arguments from the command
line. line.
""" """
with spack.concretize.disable_compiler_existence_check():
with env.write_transaction(): with env.write_transaction():
env.concretize() env.concretize()
env.write() env.write()

View File

@ -209,10 +209,8 @@ def build_name(self, spec: Optional[spack.spec.Spec] = None) -> Optional[str]:
Returns: (str) given spec's CDash build name.""" Returns: (str) given spec's CDash build name."""
if spec: if spec:
build_name = ( spec_str = spec.format("{name}{@version}{%compiler} hash={hash} arch={architecture}")
f"{spec.name}@{spec.version}%{spec.compiler} " build_name = f"{spec_str} ({self.build_group})"
f"hash={spec.dag_hash()} arch={spec.architecture} ({self.build_group})"
)
tty.debug(f"Generated CDash build name ({build_name}) from the {spec.name}") tty.debug(f"Generated CDash build name ({build_name}) from the {spec.name}")
return build_name return build_name

View File

@ -515,7 +515,6 @@ def extend_with_dependencies(specs):
def concrete_specs_from_cli_or_file(args): def concrete_specs_from_cli_or_file(args):
tty.msg("Concretizing input specs") tty.msg("Concretizing input specs")
with spack.concretize.disable_compiler_existence_check():
if args.specs: if args.specs:
specs = spack.cmd.parse_specs(args.specs, concretize=True) specs = spack.cmd.parse_specs(args.specs, concretize=True)
if not specs: if not specs:

View File

@ -4,7 +4,6 @@
"""High-level functions to concretize list of specs""" """High-level functions to concretize list of specs"""
import sys import sys
import time import time
from contextlib import contextmanager
from typing import Iterable, List, Optional, Sequence, Tuple, Union from typing import Iterable, List, Optional, Sequence, Tuple, Union
import llnl.util.tty as tty import llnl.util.tty as tty
@ -17,25 +16,6 @@
import spack.util.parallel import spack.util.parallel
from spack.spec import ArchSpec, CompilerSpec, Spec 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]] SpecPairInput = Tuple[Spec, Optional[Spec]]
SpecPair = Tuple[Spec, Spec] SpecPair = Tuple[Spec, Spec]
TestsType = Union[bool, Iterable[str]] TestsType = Union[bool, Iterable[str]]

View File

@ -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" 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): 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}" 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 assert spec.target == spec["pkg-b"].target == result