Add a "sticky" property to variants (#28630)
* Add sticky variants
* Add unit tests for sticky variants
* Add documentation for sticky variants
* Revert "Revert 19736 because conflicts are avoided by clingo by default (#26721)"
This reverts commit 33ef7d57c1
.
* Add stickiness to "allow-unsupported-compiler"
This commit is contained in:

committed by
GitHub

parent
dd7acecf3d
commit
cd04109e17
@@ -1441,6 +1441,32 @@ The ``when`` clause follows the same syntax and accepts the same
|
||||
values as the ``when`` argument of
|
||||
:py:func:`spack.directives.depends_on`
|
||||
|
||||
^^^^^^^^^^^^^^^
|
||||
Sticky Variants
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
The variant directive can be marked as ``sticky`` by setting to ``True`` the
|
||||
corresponding argument:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
variant('bar', default=False, sticky=True)
|
||||
|
||||
A ``sticky`` variant differs from a regular one in that it is always set
|
||||
to either:
|
||||
|
||||
#. An explicit value appearing in a spec literal or
|
||||
#. Its default value
|
||||
|
||||
The concretizer thus is not free to pick an alternate value to work
|
||||
around conflicts, but will error out instead.
|
||||
Setting this property on a variant is useful in cases where the
|
||||
variant allows some dangerous or controversial options (e.g. using unsupported versions
|
||||
of a compiler for a library) and the packager wants to ensure that
|
||||
allowing these options is done on purpose by the user, rather than
|
||||
automatically by the solver.
|
||||
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
Overriding Variants
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
Reference in New Issue
Block a user