concretizer: don't optimize emitting version_satisfies() (#20128)
When all versions were allowed a version_satisfies rule was not emitted, and this caused conditional directives to fail.
This commit is contained in:
		| @@ -1394,10 +1394,6 @@ def define_version_constraints(self): | |||||||
|             if exact_match: |             if exact_match: | ||||||
|                 allowed_versions = exact_match |                 allowed_versions = exact_match | ||||||
| 
 | 
 | ||||||
|             # don't bother restricting anything if all versions are allowed |  | ||||||
|             if len(allowed_versions) == len(self.possible_versions[pkg_name]): |  | ||||||
|                 continue |  | ||||||
| 
 |  | ||||||
|             predicates = [fn.version(pkg_name, v) for v in allowed_versions] |             predicates = [fn.version(pkg_name, v) for v in allowed_versions] | ||||||
| 
 | 
 | ||||||
|             # version_satisfies(pkg, constraint) is true if and only if a |             # version_satisfies(pkg, constraint) is true if and only if a | ||||||
|   | |||||||
| @@ -501,6 +501,11 @@ def test_conflicts_in_spec(self, conflict_spec): | |||||||
|         with pytest.raises(spack.error.SpackError): |         with pytest.raises(spack.error.SpackError): | ||||||
|             s.concretize() |             s.concretize() | ||||||
| 
 | 
 | ||||||
|  |     def test_conflict_in_all_directives_true(self): | ||||||
|  |         s = Spec('when-directives-true') | ||||||
|  |         with pytest.raises(spack.error.SpackError): | ||||||
|  |             s.concretize() | ||||||
|  | 
 | ||||||
|     @pytest.mark.parametrize('spec_str', [ |     @pytest.mark.parametrize('spec_str', [ | ||||||
|         'conflict@10.0%clang+foo' |         'conflict@10.0%clang+foo' | ||||||
|     ]) |     ]) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Andrew W Elble
					Andrew W Elble