directives: remove workaround for the c, cxx and fortran language

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
This commit is contained in:
Massimiliano Culpo 2024-09-02 11:15:02 +02:00
parent f0b23c5614
commit 666f7e6055
No known key found for this signature in database
GPG Key ID: 3E52BB992233066C

View File

@ -36,7 +36,6 @@ class OpenMpi(Package):
import re import re
from typing import Any, Callable, List, Optional, Tuple, Union from typing import Any, Callable, List, Optional, Tuple, Union
import llnl.util.lang
import llnl.util.tty.color import llnl.util.tty.color
import spack.deptypes as dt import spack.deptypes as dt
@ -86,9 +85,6 @@ class OpenMpi(Package):
PatchesType = Optional[Union[Patcher, str, List[Union[Patcher, str]]]] PatchesType = Optional[Union[Patcher, str, List[Union[Patcher, str]]]]
SUPPORTED_LANGUAGES = ("fortran", "cxx", "c")
def _make_when_spec(value: WhenType) -> Optional[spack.spec.Spec]: def _make_when_spec(value: WhenType) -> Optional[spack.spec.Spec]:
"""Create a ``Spec`` that indicates when a directive should be applied. """Create a ``Spec`` that indicates when a directive should be applied.
@ -367,9 +363,6 @@ def depends_on(
""" """
dep_spec = spack.spec.Spec(spec) dep_spec = spack.spec.Spec(spec)
if dep_spec.name in SUPPORTED_LANGUAGES:
assert type == "build", "languages must be of 'build' type"
return _language(lang_spec_str=spec, when=when)
def _execute_depends_on(pkg: spack.package_base.PackageBase): def _execute_depends_on(pkg: spack.package_base.PackageBase):
_depends_on(pkg, dep_spec, when=when, type=type, patches=patches) _depends_on(pkg, dep_spec, when=when, type=type, patches=patches)
@ -903,21 +896,6 @@ def _execute_requires(pkg: spack.package_base.PackageBase):
return _execute_requires return _execute_requires
@directive("languages")
def _language(lang_spec_str: str, *, when: Optional[Union[str, bool]] = None):
"""Temporary implementation of language virtuals, until compilers are proper dependencies."""
def _execute_languages(pkg: spack.package_base.PackageBase):
when_spec = _make_when_spec(when)
if not when_spec:
return
languages = pkg.languages.setdefault(when_spec, set())
languages.add(lang_spec_str)
return _execute_languages
class DependencyError(DirectiveError): class DependencyError(DirectiveError):
"""This is raised when a dependency specification is invalid.""" """This is raised when a dependency specification is invalid."""