summaryrefslogtreecommitdiff
path: root/lib/spack/docs/configuration.rst
diff options
context:
space:
mode:
Diffstat (limited to 'lib/spack/docs/configuration.rst')
-rw-r--r--lib/spack/docs/configuration.rst49
1 files changed, 49 insertions, 0 deletions
diff --git a/lib/spack/docs/configuration.rst b/lib/spack/docs/configuration.rst
index 563351dfae..c6355d8373 100644
--- a/lib/spack/docs/configuration.rst
+++ b/lib/spack/docs/configuration.rst
@@ -227,6 +227,9 @@ You can get the name to use for ``<platform>`` by running ``spack arch
--platform``. The system config scope has a ``<platform>`` section for
sites at which ``/etc`` is mounted on multiple heterogeneous machines.
+
+.. _config-scope-precedence:
+
----------------
Scope Precedence
----------------
@@ -239,6 +242,11 @@ lower-precedence settings. Completely ignoring higher-level configuration
options is supported with the ``::`` notation for keys (see
:ref:`config-overrides` below).
+There are also special notations for string concatenation and precendense override.
+Using the ``+:`` notation can be used to force *prepending* strings or lists. For lists, this is identical
+to the default behavior. Using the ``-:`` works similarly, but for *appending* values.
+:ref:`config-prepend-append`
+
^^^^^^^^^^^
Simple keys
^^^^^^^^^^^
@@ -279,6 +287,47 @@ command:
- ~/.spack/stage
+.. _config-prepend-append:
+
+^^^^^^^^^^^^^^^^^^^^
+String Concatenation
+^^^^^^^^^^^^^^^^^^^^
+
+Above, the user ``config.yaml`` *completely* overrides specific settings in the
+default ``config.yaml``. Sometimes, it is useful to add a suffix/prefix
+to a path or name. To do this, you can use the ``-:`` notation for *append*
+string concatentation at the end of a key in a configuration file. For example:
+
+.. code-block:: yaml
+ :emphasize-lines: 1
+ :caption: ~/.spack/config.yaml
+
+ config:
+ install_tree-: /my/custom/suffix/
+
+Spack will then append to the lower-precedence configuration under the
+``install_tree-:`` section:
+
+.. code-block:: console
+
+ $ spack config get config
+ config:
+ install_tree: /some/other/directory/my/custom/suffix
+ build_stage:
+ - $tempdir/$user/spack-stage
+ - ~/.spack/stage
+
+
+Similarly, ``+:`` can be used to *prepend* to a path or name:
+
+.. code-block:: yaml
+ :emphasize-lines: 1
+ :caption: ~/.spack/config.yaml
+
+ config:
+ install_tree+: /my/custom/suffix/
+
+
.. _config-overrides:
^^^^^^^^^^^^^^^^^^^^^^^^^^