summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/spack/solver/asp.py15
-rw-r--r--lib/spack/spack/test/cmd/install.py10
2 files changed, 23 insertions, 2 deletions
diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py
index 292d3a5a3f..9e37ab5cf8 100644
--- a/lib/spack/spack/solver/asp.py
+++ b/lib/spack/spack/solver/asp.py
@@ -1486,6 +1486,21 @@ class SpackSolverSetup(object):
else:
for clause in self.spec_clauses(dep):
self.gen.fact(clause)
+ # TODO: This might need to be moved somewhere else.
+ # TODO: It's needed to account for open-ended variants
+ # TODO: validated through a function. The rationale is
+ # TODO: that if a value is set from cli and validated
+ # TODO: then it's also a possible value.
+ if clause.name == 'variant_set':
+ variant_name = clause.args[1]
+ variant_def = dep.package.variants[variant_name]
+ variant_def.validate_or_raise(
+ dep.variants[variant_name],
+ dep.package
+ )
+ self.gen.fact(
+ fn.variant_possible_value(*clause.args)
+ )
self.gen.h1("Virtual Constraints")
self.define_virtual_constraints()
diff --git a/lib/spack/spack/test/cmd/install.py b/lib/spack/spack/test/cmd/install.py
index 93b1bc2eae..8e87f97c98 100644
--- a/lib/spack/spack/test/cmd/install.py
+++ b/lib/spack/spack/test/cmd/install.py
@@ -467,8 +467,14 @@ def test_cdash_report_concretization_error(tmpdir, mock_fetch, install_mockery,
report_file = report_dir.join('Update.xml')
assert report_file in report_dir.listdir()
content = report_file.open().read()
- assert '<UpdateReturnStatus>Conflicts in concretized spec' \
- in content
+ assert '<UpdateReturnStatus>' in content
+ # The message is different based on using the
+ # new or the old concretizer
+ expected_messages = (
+ 'Conflicts in concretized spec',
+ 'does not satisfy'
+ )
+ assert any(x in content for x in expected_messages)
@pytest.mark.disable_clean_stage_check