Skip to content

Commit

Permalink
Remove more sha1-generation code
Browse files Browse the repository at this point in the history
  • Loading branch information
johngmyers committed Jun 22, 2020
1 parent abe4c12 commit e313f38
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 34 deletions.
1 change: 0 additions & 1 deletion tools/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
exports_files([
"sha1",
"sha256",
])
17 changes: 1 addition & 16 deletions tools/hashes.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@ def _impl(ctx):
in_file = ctx.file.src

basename = ctx.attr.src.label.name
out_sha1 = ctx.actions.declare_file("%s.sha1" % basename)
ctx.actions.run(
executable = ctx.executable._cmd_sha1,
outputs = [out_sha1],
inputs = [in_file],
arguments = [in_file.path, out_sha1.path],
)

out_sha256 = ctx.actions.declare_file("%s.sha256" % basename)
ctx.actions.run(
executable = ctx.executable._cmd_sha256,
Expand All @@ -19,25 +11,18 @@ def _impl(ctx):
)

return DefaultInfo(
files = depset([out_sha1, out_sha256]),
files = depset([out_sha256]),
)

def _get_outputs(src):
return {
"sha1": src.name + ".sha1",
"sha256": src.name + ".sha256",
}

hashes = rule(
implementation = _impl,
attrs = {
"src": attr.label(mandatory = True, allow_single_file = True),
"_cmd_sha1": attr.label(
default = Label("//tools:sha1"),
allow_single_file = True,
executable = True,
cfg = "host",
),
"_cmd_sha256": attr.label(
default = Label("//tools:sha256"),
allow_single_file = True,
Expand Down
17 changes: 0 additions & 17 deletions tools/sha1

This file was deleted.

0 comments on commit e313f38

Please sign in to comment.