-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
roachpb: stop using reflection to generate file
This reflection ended up causing serious build pain and represented a non-zero portion of the critical path time of our build. AST inspection works just as well as reflection and means we now only depend on the generated proto files. Release note: None
- Loading branch information
Showing
9 changed files
with
153 additions
and
118 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "GoSource") | ||
|
||
def _batch_gen_impl(ctx): | ||
srcs = [src for src in ctx.attr.src[GoSource].srcs] | ||
print(ctx.outputs.out) | ||
ctx.actions.run( | ||
outputs = [ctx.outputs.out], | ||
inputs = srcs, | ||
executable = ctx.executable._tool, | ||
arguments = ["--filename", ctx.outputs.out.path] + [src.path for src in srcs], | ||
) | ||
return [DefaultInfo(files = depset([ctx.outputs.out])),] | ||
|
||
batch_gen = rule( | ||
implementation = _batch_gen_impl, | ||
attrs = { | ||
"out": attr.output(mandatory = True), | ||
"src": attr.label(providers = [GoSource]), | ||
"_tool": attr.label(default = "//pkg/roachpb/gen", executable = True, cfg = "exec"), | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters