aboutsummaryrefslogtreecommitdiffhomepage
path: root/site
diff options
context:
space:
mode:
authorGravatar Klaus Aehlig <aehlig@google.com>2016-10-06 14:32:37 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2016-10-07 08:05:34 +0000
commit651b190d1f146b4a211cf4443319ed598157e229 (patch)
tree38499190f7a95321940459d5e9a479caa8aad28b /site
parent3a3c4833dc24b90b203c637b36b0d4901a5b1e81 (diff)
Update environment design document
- Instead of a script for freezing the client environment, an info key was added. - Mark as implemented. -- Change-Id: I1928031bbe535fef2ffdedba4485fa9a37f4c1ec Reviewed-on: https://bazel-review.googlesource.com/#/c/6494 MOS_MIGRATED_REVID=135356539
Diffstat (limited to 'site')
-rw-r--r--site/designs/_posts/2016-06-21-environment.md31
1 files changed, 9 insertions, 22 deletions
diff --git a/site/designs/_posts/2016-06-21-environment.md b/site/designs/_posts/2016-06-21-environment.md
index 82faa3f08d..5f5717788d 100644
--- a/site/designs/_posts/2016-06-21-environment.md
+++ b/site/designs/_posts/2016-06-21-environment.md
@@ -5,8 +5,9 @@ title: Specifying environment variables
# Specifying environment variables for actions
-This doc was written by [aehlig@google.com](mailto:aehlig@google.com).
-Status: unimplemented.
+**Status**: Implemented.
+
+**Author**: [Klaus Aehlig](mailto:aehlig@google.com)
## Current shortcomings
@@ -140,18 +141,12 @@ following.
traditional layout) can fix the environment by adding `--action_env`
options with specific values to the user-project local `.bazelrc`.
- To simplify this use case, Bazel might provide a script
- `bazel_freeze_environment` that reads the
- `tools/bazel.rc` and looks for `--action_env` options with
- unspecified values and writes corresponding ones with specified values to the
- user-project local `.bazelrc` file; the specified values are taken from the
- environment of
- the invocation of that script.
-
- To simplify "freeze on first use" approaches, there will be separate way of
- invoking the `bazel_freeze_environment` script so that it only adds
- `--action_env` options with specified values for variables not already
- mentioned in the user-project local `.bazelrc` file.
+ To simplify this use case, and other "freeze on first use" approaches,
+ Bazel's `info` command will provide a new key `client-env` that will show
+ the environment variables, together with their values. More precisely,
+ each variable-value pair will be prefixed with `build --action_env=`, so
+ that `bazel info client-env >> .bazelrc` can be used to freeze the
+ environment.
## Transition plan
@@ -224,14 +219,6 @@ enough mechanisms to control the build behaviour and avoid special casing.
command-line options reduces the amount newly introduced concepts. The main
addition is a command-line option.
-A corner case from that perspective is the `bazel_freeze_environment` script.
-While it solves a valid use case, its only purpose is the management
-of environment variables. At least it is strictly a user tool, in the sense
-that Bazel itself does not depend on it: Bazel will happily read any
-syntactically valid rc-file, regardless how it was created; so a user can
-hand-code the user-project local `.bazelrc` file, use the help of
-`bazel_freeze_environment`, or use a third-party tool to generate it.
-
### Source of Knowledge for Needed Environment Variables
Another aspect that went into the design is that different entities know