Only specified compiler flag propagates

This commit is contained in:
Kayla Butler 2023-08-29 13:18:12 -07:00
parent f0df745f54
commit 8897e1e11f
2 changed files with 11 additions and 1 deletions

View File

@ -1205,7 +1205,7 @@ attr("node_flag_propagate", Package, FlagType, Flag, Source) :-
attr("node_flag_possible_prop", Package, FlagType, Flag, Source) :-
same_compiler(Parent, Package),
attr("node_flag_possible_prop", Parent, _, _, Source),
attr("node_flag_possible_prop", Parent, FlagType, _, Source),
attr("node_flag", Source, FlagType, Flag),
flag_type(FlagType).

View File

@ -374,6 +374,16 @@ def test_concretize_propagate_compiler_flag_not_passed_to_dependent(self):
assert spec.satisfies("^dyninst cflags='-O3'")
assert spec.satisfies("^libelf cflags='-g'")
@pytest.mark.only_clingo(
"Optional compiler propagation isn't deprecated for original concretizer"
)
def test_concretize_propagate_specified_compiler_flag(self):
spec = Spec("callpath cflags=='-g' cxxflags='-O3'")
spec.concretize()
assert spec.satisfies("^dyninst cflags='-g'")
assert not spec.satisfies("^dyninst cxxflags='-O3'")
def test_mixing_compilers_only_affects_subdag(self):
spack.config.set("packages:all:compiler", ["clang", "gcc"])
spec = Spec("dt-diamond%gcc ^dt-diamond-bottom%clang").concretized()