concretizer: impose() for concrete specs should use body facts.

The concretizer doesn't get a say in whether constraints from
concrete specs are imposed, so use body facts for them.
This commit is contained in:
Todd Gamblin 2021-08-02 21:42:56 -07:00
parent 3866b3e7d3
commit 9c70d51a4f

View file

@ -821,9 +821,9 @@ def condition(self, required_spec, imposed_spec=None, name=None):
return condition_id
def impose(self, condition_id, imposed_spec, node=True, name=None):
def impose(self, condition_id, imposed_spec, node=True, name=None, body=False):
imposed_constraints = self.spec_clauses(
imposed_spec, body=False, required_from=name)
imposed_spec, body=body, required_from=name)
for pred in imposed_constraints:
# imposed "node"-like conditions are no-ops
if not node and pred.name in ("node", "virtual_node"):
@ -1505,7 +1505,7 @@ def define_installed_packages(self, possible):
self.gen.fact(fn.installed_hash(spec.name, h))
# this describes what constraints it imposes on the solve
self.impose(h, spec)
self.impose(h, spec, body=True)
self.gen.newline()
def setup(self, driver, specs, tests=False, reuse=False):