concretizer: require at least a dependency type to say the dependency holds
fixes #20784 Similarly to the previous bug, here we were deducing conditions to be imposed on nodes that were not part of the DAG.
This commit is contained in:
parent
7162e15531
commit
488a08b464
@ -88,6 +88,9 @@ dependency_conditions_hold(ID, Parent, Dependency) :-
|
|||||||
attr(Name, Arg1, Arg2) : required_dependency_condition(ID, Name, Arg1, Arg2);
|
attr(Name, Arg1, Arg2) : required_dependency_condition(ID, Name, Arg1, Arg2);
|
||||||
attr(Name, Arg1, Arg2, Arg3) : required_dependency_condition(ID, Name, Arg1, Arg2, Arg3);
|
attr(Name, Arg1, Arg2, Arg3) : required_dependency_condition(ID, Name, Arg1, Arg2, Arg3);
|
||||||
dependency_condition(ID, Parent, Dependency);
|
dependency_condition(ID, Parent, Dependency);
|
||||||
|
% There must be at least a dependency type declared,
|
||||||
|
% otherwise the dependency doesn't hold
|
||||||
|
dependency_type(ID, _);
|
||||||
node(Parent);
|
node(Parent);
|
||||||
not external(Parent).
|
not external(Parent).
|
||||||
|
|
||||||
|
@ -1089,3 +1089,11 @@ def test_reuse_installed_packages(
|
|||||||
).concretized()
|
).concretized()
|
||||||
|
|
||||||
assert root.dag_hash() == new_root.dag_hash()
|
assert root.dag_hash() == new_root.dag_hash()
|
||||||
|
|
||||||
|
@pytest.mark.regression('20784')
|
||||||
|
def test_concretization_of_test_dependencies(self):
|
||||||
|
# With clingo we emit dependency_conditions regardless of the type
|
||||||
|
# of the dependency. We need to ensure that there's at least one
|
||||||
|
# dependency type declared to infer that the dependency holds.
|
||||||
|
s = Spec('test-dep-with-imposed-conditions').concretized()
|
||||||
|
assert 'c' not in s
|
||||||
|
@ -0,0 +1,17 @@
|
|||||||
|
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
|
||||||
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
from spack import *
|
||||||
|
|
||||||
|
|
||||||
|
class TestDepWithImposedConditions(Package):
|
||||||
|
"""Simple package with no dependencies"""
|
||||||
|
|
||||||
|
homepage = "http://www.example.com"
|
||||||
|
url = "http://www.example.com/e-1.0.tar.gz"
|
||||||
|
|
||||||
|
version('1.0', '0123456789abcdef0123456789abcdef')
|
||||||
|
|
||||||
|
depends_on('c@1.0', type='test')
|
Loading…
Reference in New Issue
Block a user