concretizer: handle "none" value and '*' wildcard
The "none" variant value cannot be combined with other values. The '*' wildcard matches anything, including "none". It's thus relevant in queries, but disregarded in concretization.
This commit is contained in:
		 Massimiliano Culpo
					Massimiliano Culpo
				
			
				
					committed by
					
						 Todd Gamblin
						Todd Gamblin
					
				
			
			
				
	
			
			
			 Todd Gamblin
						Todd Gamblin
					
				
			
						parent
						
							8b055ac8d8
						
					
				
				
					commit
					3e4fd64169
				
			| @@ -1150,8 +1150,10 @@ class Body(object): | |||||||
|             value = variant.value |             value = variant.value | ||||||
|             if isinstance(value, tuple): |             if isinstance(value, tuple): | ||||||
|                 for v in value: |                 for v in value: | ||||||
|  |                     if v == '*': | ||||||
|  |                         continue | ||||||
|                     clauses.append(f.variant(spec.name, vname, v)) |                     clauses.append(f.variant(spec.name, vname, v)) | ||||||
|             else: |             elif value != '*': | ||||||
|                 clauses.append(f.variant(spec.name, vname, variant.value)) |                 clauses.append(f.variant(spec.name, vname, variant.value)) | ||||||
| 
 | 
 | ||||||
|         # compiler and compiler version |         # compiler and compiler version | ||||||
| @@ -1424,7 +1426,7 @@ def setup(self, driver, specs): | |||||||
|         possible = spack.package.possible_dependencies( |         possible = spack.package.possible_dependencies( | ||||||
|             *specs, |             *specs, | ||||||
|             virtuals=self.possible_virtuals, |             virtuals=self.possible_virtuals, | ||||||
|             deptype=("build", "link", "run") |             deptype=("build", "link", "run", "test") | ||||||
|         ) |         ) | ||||||
|         pkgs = set(possible) |         pkgs = set(possible) | ||||||
| 
 | 
 | ||||||
|   | |||||||
| @@ -194,6 +194,11 @@ variant_default_value(Package, Variant, Value) | |||||||
| variant_default_value(Package, Variant, Value) | variant_default_value(Package, Variant, Value) | ||||||
|  :- variant_default_value_from_packages_yaml(Package, Variant, Value). |  :- variant_default_value_from_packages_yaml(Package, Variant, Value). | ||||||
|  |  | ||||||
|  | % Treat 'none' in a special way - it cannot be combined with other | ||||||
|  | % values even if the variant is multi-valued | ||||||
|  | :- 2 {variant_value(Package, Variant, Value): variant_possible_value(Package, Variant, Value)}, | ||||||
|  |    variant_value(Package, Variant, "none"). | ||||||
|  |  | ||||||
| % suppress warnings about this atom being unset.  It's only set if some | % suppress warnings about this atom being unset.  It's only set if some | ||||||
| % spec or some package sets it, and without this, clingo will give | % spec or some package sets it, and without this, clingo will give | ||||||
| % warnings like 'info: atom does not occur in any rule head'. | % warnings like 'info: atom does not occur in any rule head'. | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user