summaryrefslogtreecommitdiff
path: root/lib/spack/docs/environments.rst
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2022-03-09 21:35:26 +0100
committerGitHub <noreply@github.com>2022-03-09 12:35:26 -0800
commitdc78f4c58abba2bd1bb1e9f481c506f98d060ca2 (patch)
tree2896bef831e0e9bafa7ac9f97c36be35f73a3240 /lib/spack/docs/environments.rst
parentbedc9fe665c4db2059beacb8117bc81595019343 (diff)
downloadspack-dc78f4c58abba2bd1bb1e9f481c506f98d060ca2.tar.gz
spack-dc78f4c58abba2bd1bb1e9f481c506f98d060ca2.tar.bz2
spack-dc78f4c58abba2bd1bb1e9f481c506f98d060ca2.tar.xz
spack-dc78f4c58abba2bd1bb1e9f481c506f98d060ca2.zip
environment.py: allow link:run (#29336)
* environment.py: allow link:run Some users want minimal views, excluding run-type dependencies, since those type of dependencies are covered by rpaths and the symlinked libraries in the view aren't used anyways. With this change, an environment like this: ``` spack: specs: ['py-flake8'] view: default: root: view link: run ``` includes python packages and python, but no link type deps of python.
Diffstat (limited to 'lib/spack/docs/environments.rst')
-rw-r--r--lib/spack/docs/environments.rst26
1 files changed, 20 insertions, 6 deletions
diff --git a/lib/spack/docs/environments.rst b/lib/spack/docs/environments.rst
index ed8e36c9ff..4e4a75b88c 100644
--- a/lib/spack/docs/environments.rst
+++ b/lib/spack/docs/environments.rst
@@ -740,9 +740,10 @@ file snippet we define a view named ``mpis``, rooted at
version, and compiler name to determine the path for a given
package. This view selects all packages that depend on MPI, and
excludes those built with the PGI compiler at version 18.5.
-All the dependencies of each root spec in the environment will be linked
-in the view due to the command ``link: all`` and the files in the view will
-be symlinks to the spack install directories.
+The root specs with their (transitive) link and run type dependencies
+will be put in the view due to the ``link: all`` option,
+and the files in the view will be symlinks to the spack install
+directories.
.. code-block:: yaml
@@ -762,9 +763,22 @@ For more information on using view projections, see the section on
:ref:`adding_projections_to_views`. The default for the ``select`` and
``exclude`` values is to select everything and exclude nothing. The
default projection is the default view projection (``{}``). The ``link``
-defaults to ``all`` but can also be ``roots`` when only the root specs
-in the environment are desired in the view. The ``link_type`` defaults
-to ``symlink`` but can also take the value of ``hardlink`` or ``copy``.
+attribute allows the following values:
+
+#. ``link: all`` include root specs with their transitive run and link type
+ dependencies (default);
+#. ``link: run`` include root specs with their transitive run type dependencies;
+#. ``link: roots`` include root specs without their dependencies.
+
+The ``link_type`` defaults to ``symlink`` but can also take the value
+of ``hardlink`` or ``copy``.
+
+.. tip::
+
+ The option ``link: run`` can be used to create small environment views for
+ Python packages. Python will be able to import packages *inside* of the view even
+ when the environment is not activated, and linked libraries will be located
+ *outside* of the view thanks to rpaths.
Any number of views may be defined under the ``view`` heading in a
Spack Environment.