bazel: Run buildifier, general cleanup (#13193)

* Run buildifier

* Other BUILD.bazel cleanup, rm swagger stuff.

---------

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
Preston Van Loon
2023-11-16 12:41:37 -06:00
committed by GitHub
parent 8f5ae760ee
commit bba8dd6f1e
11 changed files with 84 additions and 253 deletions

View File

@@ -9,7 +9,7 @@ def prysm_image_deps():
"http://http.us.debian.org/debian/pool/main/b/bash/bash_5.1-2+deb11u1_amd64.deb",
"http://ftp.uk.debian.org/debian/pool/main/b/bash/bash_5.1-2+deb11u1_amd64.deb",
"http://ftp.au.debian.org/debian/pool/main/b/bash/bash_5.1-2+deb11u1_amd64.deb",
"https://prysmaticlabs.com/uploads/bash_5.1-2+deb11u1_amd64.deb",
"https://prysmaticlabs.com/uploads/bash_5.1-2+deb11u1_amd64.deb",
],
)

View File

@@ -1,3 +1,29 @@
"""
A rule that uses the generated pb.go files from a go_proto_library target to generate SSZ marshal
and unmarshal functions as pointer receivers on the specified objects. To use this rule, provide a
go_proto_library target and specify the structs to generate methods in the "objs" field. Lastly,
include your new target as a source for the go_library that embeds the go_proto_library.
Example:
go_proto_library(
name = "example_go_proto",
...
)
ssz_gen_marshal(
name = "ssz_generated_sources",
go_proto = ":example_go_proto",
objs = [ # omit this field to generate for all structs in the package.
"AddressBook",
"Person",
],
)
go_library(
name = "go_default_library",
srcs = [":ssz_generated_sources"],
embed = [":example_go_proto"],
deps = SSZ_DEPS,
)
"""
load(
"@io_bazel_rules_go//go:def.bzl",
"GoLibrary",
@@ -32,7 +58,7 @@ def _ssz_go_proto_library_impl(ctx):
args.append("--include=%s" % ",".join(incs))
if len(ctx.attr.objs) > 0:
args += ["--objs=%s" % ",".join(ctx.attr.objs)]
args.append("--objs=%s" % ",".join(ctx.attr.objs))
ctx.actions.run(
executable = ctx.executable.sszgen,
@@ -42,31 +68,6 @@ def _ssz_go_proto_library_impl(ctx):
outputs = [output],
)
"""
A rule that uses the generated pb.go files from a go_proto_library target to generate SSZ marshal
and unmarshal functions as pointer receivers on the specified objects. To use this rule, provide a
go_proto_library target and specify the structs to generate methods in the "objs" field. Lastly,
include your new target as a source for the go_library that embeds the go_proto_library.
Example:
go_proto_library(
name = "example_go_proto",
...
)
ssz_gen_marshal(
name = "ssz_generated_sources",
go_proto = ":example_go_proto",
objs = [ # omit this field to generate for all structs in the package.
"AddressBook",
"Person",
],
)
go_library(
name = "go_default_library",
srcs = [":ssz_generated_sources"],
embed = [":example_go_proto"],
deps = SSZ_DEPS,
)
"""
ssz_gen_marshal = rule(
implementation = _ssz_go_proto_library_impl,
attrs = {
@@ -75,7 +76,7 @@ ssz_gen_marshal = rule(
"sszgen": attr.label(
default = Label("@com_github_prysmaticlabs_fastssz//sszgen:sszgen"),
executable = True,
cfg = "host",
cfg = "exec",
),
"objs": attr.string_list(),
"includes": attr.label_list(providers = [GoLibrary]),