diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2021-04-21 09:09:18 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2021-04-22 09:02:03 +0200 |
commit | 35c1c44bc5f75a327f5d879373a9683af2072a1a (patch) | |
tree | ac61394ad33284a0d772d4c62f90456c05e82eac /doc | |
parent | 09c231965f9f8e8f1e86f127a22f112d63ef4d9b (diff) |
Document use of depdb-env for manually tracking changes to environment
Diffstat (limited to 'doc')
-rw-r--r-- | doc/manual.cli | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/manual.cli b/doc/manual.cli index af9699e..3ee3016 100644 --- a/doc/manual.cli +++ b/doc/manual.cli @@ -5741,6 +5741,24 @@ if ($foo != [null]) cxx.poptions += \"-DUSE_FOO=$foo\" \ +Additionally, if invoking a program in an ad hoc recipe that either does not +provide the metadata or does not report the environment as part of it, then we +additionally should track the changes to the relevant environment variables +manually using the \c{depdb env} builtin. For example: + +\ +import! foo = foo%exe{foo} # Uses FOO and BAR environment variables. + +config.environment FOO BAR + +file{output}: file{input} $foo +{{ + diag foo $> + depdb env FOO BAR + $foo $path($<[0]) >$path($>) +}} +\ + \N|Normally, we would want to report variables that affect the build result rather than build byproducts (for example, diagnostics). This is, for example, the reason why locale-related environment variables are not saved by default. |