solver: test that we can build llvm%gcc

This commit is contained in:
Massimiliano Culpo 2025-02-04 23:34:21 +01:00
parent da916a944e
commit 922b9b0e50
No known key found for this signature in database
GPG Key ID: 3E52BB992233066C
5 changed files with 14 additions and 2 deletions

View File

@ -748,6 +748,7 @@ do_not_impose(EffectID, node(X, Package))
explicitly_requested_root(PossibleProvider),
not self_build_requirement(PossibleProvider, ProviderNode),
not explicitly_requested_root(ProviderNode),
not language(Virtual),
internal_error("If a root can provide a virtual, it must be the provider").
% A package cannot be the actual provider for a virtual if it does not

View File

@ -3214,3 +3214,13 @@ def test_compiler_attribute_is_tolerated_in_externals(mutable_config, mock_packa
mutable_config.set("packages", packages_yaml["packages"])
s = spack.concretize.concretize_one("cmake")
assert s.external and s.external_path == str(tmp_path)
def test_compiler_can_be_built_with_other_compilers(config, mock_packages):
"""Tests that a compiler can be built also with another compiler."""
s = Spec("llvm@18 +clang %gcc").concretized()
print(s.tree())
assert s.satisfies("llvm@18")
c_compiler = s.dependencies(virtuals=("c",))
assert len(c_compiler) == 1 and c_compiler[0].satisfies("gcc@10")

View File

@ -80,7 +80,6 @@ packages:
cxx: /path/bin/g++-10
fortran: /path/bin/gfortran-10
llvm:
buildable: false
externals:
- spec: "llvm@15.0.0 +clang os={linux_os.name}{linux_os.version} target={target}"
prefix: /path

View File

@ -45,7 +45,7 @@ def mpileaks_possible_deps(mock_packages, mpi_names, compiler_names):
"intel-parallel-studio": set(),
"libdwarf": set(["libelf"] + compiler_names),
"libelf": set(compiler_names),
"llvm": set(),
"llvm": {"gcc", "llvm"},
"mpich": set(compiler_names),
"mpich2": set(compiler_names),
"mpileaks": set(["callpath"] + mpi_names + compiler_names),

View File

@ -19,6 +19,8 @@ class Llvm(Package, CompilerPackage):
provides("c", "cxx", when="+clang")
depends_on("c")
c_names = ["clang"]
cxx_names = ["clang++"]
fortran_names = ["flang"]