-
Notifications
You must be signed in to change notification settings - Fork 3.9k
/
Copy pathCOLEXEC.bzl
31 lines (30 loc) · 1.28 KB
/
COLEXEC.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Generating the code for `sort_partitioner.eg.go` requires special handling
# because the template lives in a subpackage.
def gen_sort_partitioner_rule(name, target, visibility = ["//visibility:private"]):
native.genrule(
name = name,
srcs = ["//pkg/sql/colexec/colexecbase:distinct_tmpl.go"],
outs = [target],
cmd = """\
export COCKROACH_INTERNAL_DISABLE_METAMORPHIC_TESTING=true
$(location :execgen) -template $(SRCS) -fmt=false pkg/sql/colexec/$@ > $@
$(location :goimports) -w $@
""",
tools = [":execgen", ":goimports"],
visibility = [":__pkg__", "//pkg/gen:__pkg__"],
)
# Generating the code for `default_cmp_proj_const_op.eg.go` requires special
# handling because the template lives in a different package.
def gen_default_cmp_proj_const_rule(name, target, visibility = ["//visibility:private"]):
native.genrule(
name = name,
srcs = ["//pkg/sql/colexec/colexecproj:default_cmp_proj_ops_tmpl.go"],
outs = [target],
cmd = """\
export COCKROACH_INTERNAL_DISABLE_METAMORPHIC_TESTING=true
$(location :execgen) -template $(SRCS) -fmt=false pkg/sql/colexec/colexecprojconst$@ > $@
$(location :goimports) -w $@
""",
tools = [":execgen", ":goimports"],
visibility = [":__pkg__", "//pkg/gen:__pkg__"],
)