summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin.mock/packages/a/package.py
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2019-01-05 04:02:34 +0100
committerPeter Scheibel <scheibel1@llnl.gov>2019-01-04 19:02:34 -0800
commitc4521535e718ec9c0367b3825938dc06f1bc8aad (patch)
treed395ac3c8e6be8d2488bec431062519d7e6d04b0 /var/spack/repos/builtin.mock/packages/a/package.py
parent051057caa3e4585ece655ad2974b2c6c29b97d6d (diff)
downloadspack-c4521535e718ec9c0367b3825938dc06f1bc8aad.tar.gz
spack-c4521535e718ec9c0367b3825938dc06f1bc8aad.tar.bz2
spack-c4521535e718ec9c0367b3825938dc06f1bc8aad.tar.xz
spack-c4521535e718ec9c0367b3825938dc06f1bc8aad.zip
Multi-valued variants: better support for combinations (#9481)
This enforces conventions that allow for correct handling of multi-valued variants where specifying no value is an option, and adds convenience functionality for specifying multi-valued variants with conflicting sets of values. This also adds a notion of "feature values" for variants, which are those that are understood by the build system (e.g. those that would appear as configure options). In more detail: * Add documentation on variants to the packaging guide * Forbid usage of '' or None as a possible variant value, in particular as a default. To indicate choosing no value, the user must explicitly define an option like 'none'. Without this, multi-valued variants with default set to None were not parsable from the command line (Fixes #6314) * Add "disjoint_sets" function to support the declaration of multi-valued variants with conflicting sets of options. For example a variant "foo" with possible values "a", "b", and "c" where "c" is exclusive of the other values ("foo=a,b" and "foo=c" are valid but "foo=a,c" is not). * Add "any_combination_of" function to support the declaration of multi-valued variants where it is valid to choose none of the values. This automatically defines "none" as an option (exclusive with all other choices); this value does not appear when iterating over the variant's values, for example in "with_or_without" (which constructs autotools option strings from variant values). * The "disjoint_sets" and "any_combination_of" methods return an object which tracks the possible values. It is also possible to indicate that some of these values do not correspond to options understood by the package's build system, such that methods like "with_or_without" will not define options for those values (this occurs automatically for "none") * Add documentation for usage of new functions for specifying multi-valued variants
Diffstat (limited to 'var/spack/repos/builtin.mock/packages/a/package.py')
-rw-r--r--var/spack/repos/builtin.mock/packages/a/package.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/var/spack/repos/builtin.mock/packages/a/package.py b/var/spack/repos/builtin.mock/packages/a/package.py
index 2474c0f61b..7e5a6f72e6 100644
--- a/var/spack/repos/builtin.mock/packages/a/package.py
+++ b/var/spack/repos/builtin.mock/packages/a/package.py
@@ -16,11 +16,8 @@ class A(AutotoolsPackage):
version('2.0', '2.0_a_hash')
variant(
- 'foo',
- values=('bar', 'baz', 'fee'),
- default='bar',
- description='',
- multi=True
+ 'foo', description='',
+ values=any_combination_of('bar', 'baz', 'fee').with_default('bar'),
)
variant(