Skip to content

Commit 9588425

Browse files
committed
buildelement.py: Document digest-environment
1 parent 425c653 commit 9588425

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/buildstream/buildelement.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,31 @@
7676
directories before subdirectories.
7777
7878
79+
`digest-environment` for dependencies
80+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
81+
The BuildElement supports the ``digest-environment`` :term:`dependency configuration <Dependency configuration>`,
82+
which sets the specified environment variable in the build sandbox to the CAS digest
83+
corresponding to a directory that contains all dependencies that are configured
84+
with the same ``digest-environment``.
85+
86+
This is useful for REAPI clients in the sandbox such as `recc <https://buildgrid.gitlab.io/recc>`_,
87+
see ``remote-apis-socket`` in the :ref:`sandbox configuration <format_sandbox>`.
88+
89+
**Example:**
90+
91+
Here is an example of how to set the environment variable `GCC_DIGEST` to the
92+
CAS digest of a directory that contains ``gcc.bst`` and its runtime dependencies.
93+
The ``libpony.bst`` dependency will not be included in that CAS directory.
94+
95+
.. code:: yaml
96+
97+
build-depends:
98+
- baseproject.bst:gcc.bst
99+
config:
100+
digest-environment: GCC_DIGEST
101+
- libpony.bst
102+
103+
79104
Location for running commands
80105
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
81106
The ``command-subdir`` variable sets where commands will be executed,

0 commit comments

Comments
 (0)