aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/build_defs/hash/hash.bzl
diff options
context:
space:
mode:
Diffstat (limited to 'tools/build_defs/hash/hash.bzl')
-rw-r--r--tools/build_defs/hash/hash.bzl29
1 files changed, 15 insertions, 14 deletions
diff --git a/tools/build_defs/hash/hash.bzl b/tools/build_defs/hash/hash.bzl
index 62741540b2..3eb3cd6af1 100644
--- a/tools/build_defs/hash/hash.bzl
+++ b/tools/build_defs/hash/hash.bzl
@@ -14,21 +14,22 @@
"""Functions for producing the hash of an artifact."""
def sha256(ctx, artifact):
- """Create an action to compute the SHA-256 of an artifact."""
- out = ctx.new_file(artifact.basename + ".sha256")
- ctx.action(
- executable = ctx.executable.sha256,
- arguments = [artifact.path, out.path],
- inputs = [artifact],
- outputs = [out],
- mnemonic = "SHA256")
- return out
-
+ """Create an action to compute the SHA-256 of an artifact."""
+ out = ctx.new_file(artifact.basename + ".sha256")
+ ctx.action(
+ executable = ctx.executable.sha256,
+ arguments = [artifact.path, out.path],
+ inputs = [artifact],
+ outputs = [out],
+ mnemonic = "SHA256",
+ )
+ return out
tools = {
"sha256": attr.label(
- default=Label("//tools/build_defs/hash:sha256"),
- cfg="host",
- executable=True,
- allow_files=True)
+ default = Label("//tools/build_defs/hash:sha256"),
+ cfg = "host",
+ executable = True,
+ allow_files = True,
+ ),
}