Skip to content

Commit 72373f6

Browse files
nbdd0121AlexJones0
authored andcommitted
[bazel] add documentation for rules/nonhermetic.bzl
Signed-off-by: Gary Guo <gary.guo@lowrisc.org> (cherry picked from commit 73d55bc)
1 parent bd259f5 commit 72373f6

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

rules/nonhermetic.bzl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,24 @@ NONHERMETIC_BINS = [
1414
"updatemem",
1515
]
1616

17+
"""Variables that describe non-hermetic parts of the environment.
18+
19+
This repository provides 3 variables:
20+
- `ENV`
21+
- Dict of environment variables that may be needed for running non-hermetic tools.
22+
Currently this only include those needed by Vivado.
23+
- `HOME`
24+
- Home directory of the user that invokes Bazel.
25+
Currently this is used by hsmtool to access user's Google Cloud credentials.
26+
- `BIN_PATHS`
27+
- Map from a non-hermetic tool to the part of `$PATH` that contains it.
28+
This allows actions to use a subset of `$PATH` when invoking the tool,
29+
as `$PATH` may contain many unrelated tools.
30+
31+
Together, these variables attempt to expose the least amount of environment information
32+
to Bazel rules as possible, thus improves reproducibility and cacheability.
33+
"""
34+
1735
def _nonhermetic_repo_impl(rctx):
1836
env = "\n".join([" \"{}\": \"{}\",".format(v, rctx.os.environ.get(v, "")) for v in NONHERMETIC_ENV_VARS])
1937
home = rctx.os.environ.get("HOME", "")

0 commit comments

Comments
 (0)