Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
100365: build: mark/fix actions broken under remote execution r=knz a=rickystewart

Some actions are broken under the presence of remote execution; here I have tagged or fixed those.

Epic: none
Release note: None

Co-authored-by: Ricky Stewart <[email protected]>
  • Loading branch information
craig[bot] and rickystewart committed Apr 3, 2023
2 parents 04a92b6 + 5fa0e86 commit 07024bc
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion build/STRINGER.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ def stringer(src, typ, name, additional_args=[]):
name = name,
srcs = [src], # Accessed below using `$<`.
outs = [typ.lower() + "_string.go"],
tags = ["no-remote"],
# golang.org/x/tools executes commands via
# golang.org/x/sys/execabs which requires all PATH lookups to
# result in absolute paths. To account for this, we resolve the
Expand All @@ -13,7 +14,7 @@ def stringer(src, typ, name, additional_args=[]):
GO_REL_PATH=`dirname $(location @go_sdk//:bin/go)`
GO_ABS_PATH=`cd $$GO_REL_PATH && pwd`
# Set GOPATH to something to workaround https://github.com/golang/go/issues/43938
env PATH=$$GO_ABS_PATH HOME=$(GENDIR) GOPATH=/nonexist-gopath \
env PATH=$$GO_ABS_PATH HOME=$(GENDIR) GOPATH=/nonexist-gopath GOROOT= \
$(location @com_github_cockroachdb_tools//cmd/stringer:stringer) -output=$@ -type={typ} {args} $<
""".format(
typ = typ,
Expand Down
4 changes: 3 additions & 1 deletion pkg/col/coldata/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ go_test(
],
args = ["-test.timeout=55s"],
embed = [":coldata"],
tags = ["no-remote"],
tags = ["no-remote"], # keep
deps = [
"//pkg/col/coldatatestutils",
"//pkg/sql/colconv",
Expand All @@ -67,6 +67,7 @@ GO_ABS_PATH=`cd $$GO_REL_PATH && pwd`
export PATH=$$GO_ABS_PATH:$$PATH
export HOME=$(GENDIR)
export GOPATH=/nonexist-gopath
export GOROOT=
$(location //pkg/sql/colexec/execgen/cmd/execgen) \
-fmt=false pkg/col/coldata/$@ > $@
$(location @com_github_cockroachdb_gostdlib//x/tools/cmd/goimports) -w $@
Expand All @@ -76,6 +77,7 @@ $(location @com_github_cockroachdb_gostdlib//x/tools/cmd/goimports) -w $@
"@com_github_cockroachdb_gostdlib//x/tools/cmd/goimports",
"@go_sdk//:bin/go",
],
tags = ["no-remote"], # keep
visibility = [
":__pkg__",
"//pkg/gen:__pkg__",
Expand Down
2 changes: 2 additions & 0 deletions pkg/sql/colexec/COLEXEC.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ def gen_sort_partitioner_rule(name, target, visibility = ["//visibility:private"
name = name,
srcs = ["//pkg/sql/colexec/colexecbase:distinct_tmpl.go"],
outs = [target],
tags = ["no-remote"],
cmd = """\
GO_REL_PATH=`dirname $(location @go_sdk//:bin/go)`
GO_ABS_PATH=`cd $$GO_REL_PATH && pwd`
Expand All @@ -13,6 +14,7 @@ export PATH=$$GO_ABS_PATH:$$PATH
export HOME=$(GENDIR)
export GOPATH=/nonexist-gopath
export COCKROACH_INTERNAL_DISABLE_METAMORPHIC_TESTING=true
export GOROOT=
$(location :execgen) -template $(SRCS) -fmt=false pkg/sql/colexec/$@ > $@
$(location :goimports) -w $@
""",
Expand Down
2 changes: 2 additions & 0 deletions pkg/sql/colexecop/EXECGEN.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ def gen_eg_go_rules(targets):
name = name,
srcs = [template],
outs = [target],
tags = ["no-remote"],
cmd = """
GO_REL_PATH=`dirname $(location @go_sdk//:bin/go)`
GO_ABS_PATH=`cd $$GO_REL_PATH && pwd`
export PATH=$$GO_ABS_PATH:$$PATH
export HOME=$(GENDIR)
export GOPATH=/nonexist-gopath
export COCKROACH_INTERNAL_DISABLE_METAMORPHIC_TESTING=true
export GOROOT=
$(location :execgen) -template $(SRCS) \
-fmt=false pkg/sql/colexec/$@ > $@
$(location :goimports) -w $@
Expand Down
1 change: 1 addition & 0 deletions pkg/sql/opt/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ genrule(
"@go_sdk//:bin/go",
"@com_github_cockroachdb_tools//cmd/stringer",
],
tags = ["no-remote"], # keep
visibility = [
":__pkg__",
"//pkg/gen:__pkg__",
Expand Down
2 changes: 2 additions & 0 deletions pkg/sql/parser/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ GO_ABS_PATH=`cd $$GO_REL_PATH && pwd`
export PATH=$$GO_ABS_PATH:$$PATH
export HOME=$(GENDIR)
export GOPATH=/nonexist-gopath
export GOROOT=
$(location :sql-gen) $(location sql.y) $(location replace_help_rules.awk) \
$(location sql.go) $(location @org_golang_x_tools//cmd/goyacc) \
$(location @com_github_cockroachdb_gostdlib//x/tools/cmd/goimports)
Expand All @@ -108,6 +109,7 @@ $(location :sql-gen) $(location sql.y) $(location replace_help_rules.awk) \
"@go_sdk//:bin/go",
"@org_golang_x_tools//cmd/goyacc",
],
tags = ["no-remote"], # keep
visibility = ["//visibility:public"],
)

Expand Down
3 changes: 2 additions & 1 deletion pkg/util/encoding/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,14 @@ genrule(
GO_ABS_PATH=`cd $$GO_REL_PATH && pwd`
# Set GOPATH to something to workaround https://github.com/golang/go/issues/43938
sed -e 's/type Type encodingtype.T/type Type int/' $(location encoding.go) > encoding_tmp.go && \
env PATH=$$GO_ABS_PATH HOME=$(GENDIR) GOPATH=/nonexist-gopath \
env PATH=$$GO_ABS_PATH HOME=$(GENDIR) GOPATH=/nonexist-gopath GOROOT= \
$(location @com_github_cockroachdb_tools//cmd/stringer:stringer) -output=$@ -type=Type encoding_tmp.go
""",
exec_tools = [
"@go_sdk//:bin/go",
"@com_github_cockroachdb_tools//cmd/stringer",
],
tags = ["no-remote"], # keep
visibility = [
":__pkg__",
"//pkg/gen:__pkg__",
Expand Down

0 comments on commit 07024bc

Please sign in to comment.