Skip to content
Snippets Groups Projects
Commit 3ecf4ef8 authored by Massimiliano Culpo's avatar Massimiliano Culpo Committed by Todd Gamblin
Browse files

resources : added docs fixes #1551 (#1627)

parent 8ab47537
No related branches found
No related tags found
No related merge requests found
...@@ -759,6 +759,26 @@ Fetching a revision ...@@ -759,6 +759,26 @@ Fetching a revision
Subversion branches are handled as part of the directory structure, so Subversion branches are handled as part of the directory structure, so
you can check out a branch or tag by changing the ``url``. you can check out a branch or tag by changing the ``url``.
Expanding additional resources in the source tree
-------------------------------------------------
Some packages (most notably compilers) provide optional features if additional
resources are expanded within their source tree before building. In Spack it is
possible to describe such a need with the ``resource`` directive :
.. code-block:: python
resource(
name='cargo',
git='https://github.com/rust-lang/cargo.git',
tag='0.10.0',
destination='cargo'
)
Based on the keywords present among the arguments the appropriate ``FetchStrategy``
will be used for the resource. The keyword ``destination`` is relative to the source
root of the package and should point to where the resource is to be expanded.
Automatic caching of files fetched during installation Automatic caching of files fetched during installation
------------------------------------------------------ ------------------------------------------------------
......
...@@ -292,17 +292,17 @@ def resource(pkg, **kwargs): ...@@ -292,17 +292,17 @@ def resource(pkg, **kwargs):
Define an external resource to be fetched and staged when building the Define an external resource to be fetched and staged when building the
package. Based on the keywords present in the dictionary the appropriate package. Based on the keywords present in the dictionary the appropriate
FetchStrategy will be used for the resource. Resources are fetched and FetchStrategy will be used for the resource. Resources are fetched and
staged in their own folder inside spack stage area, and then linked into staged in their own folder inside spack stage area, and then moved into
the stage area of the package that needs them. the stage area of the package that needs them.
List of recognized keywords: List of recognized keywords:
* 'when' : (optional) represents the condition upon which the resource is * 'when' : (optional) represents the condition upon which the resource is
needed needed
* 'destination' : (optional) path where to link the resource. This path * 'destination' : (optional) path where to move the resource. This path
must be relative to the main package stage area. must be relative to the main package stage area.
* 'placement' : (optional) gives the possibility to fine tune how the * 'placement' : (optional) gives the possibility to fine tune how the
resource is linked into the main package stage area. resource is moved into the main package stage area.
""" """
when = kwargs.get('when', pkg.name) when = kwargs.get('when', pkg.name)
destination = kwargs.get('destination', "") destination = kwargs.get('destination', "")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment