Skip to content

Commit 880bd10

Browse files
committed
gogo provided via bazel works for some targets. Need to mass replace to fully address
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
1 parent 1cf1c56 commit 880bd10

82 files changed

Lines changed: 272 additions & 107 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bazel/external/rules_go.patch

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,20 @@ index abacbc80..09b2c9bf 100644
1111
]
1212
env.update({
1313
"CGO_ENABLED": "1",
14+
diff --git a/proto/gogo.bzl b/proto/gogo.bzl
15+
index 05a8f044..374e7295 100644
16+
--- a/proto/gogo.bzl
17+
+++ b/proto/gogo.bzl
18+
@@ -17,9 +17,9 @@ def _gogo_special_proto_impl(ctx):
19+
ctx.file("BUILD.bazel", "")
20+
ctx.symlink(
21+
ctx.path(Label("@com_github_gogo_protobuf//gogoproto:gogo.proto")),
22+
- "github.com/gogo/protobuf/gogoproto/gogo.proto",
23+
+ "github/gogo/protobuf/gogoproto/gogo.proto",
24+
)
25+
- ctx.file("github.com/gogo/protobuf/gogoproto/BUILD.bazel", """
26+
+ ctx.file("github/gogo/protobuf/gogoproto/BUILD.bazel", """
27+
load("@rules_proto//proto:defs.bzl", "proto_library")
28+
29+
proto_library(
30+

bazel/gogo.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ def _gogo_grpc_proto_impl(ctx):
2424
ctx.file("BUILD.bazel", "")
2525
ctx.symlink(
2626
ctx.path(Label("@com_github_gogo_protobuf//gogoproto:gogo.proto")),
27-
"github.com/gogo/protobuf/gogoproto/gogo.proto",
27+
"github/gogo/protobuf/gogoproto/gogo.proto",
2828
)
29-
ctx.file("github.com/gogo/protobuf/gogoproto/BUILD.bazel", """
29+
ctx.file("github/gogo/protobuf/gogoproto/BUILD.bazel", """
3030
3131
load("@px//bazel:proto_compile.bzl", "pl_proto_library", "pl_cc_proto_library", "pl_py_proto_library")
3232

bazel/proto_compile.bzl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@ def _colocate_python_files_impl(ctx):
172172
dest.path,
173173
)
174174
for src, dest in src_dest
175+
# ]) + "\n" + "\n".join([
176+
# "sed -i 's|from github.com|from github|g' {}".format(
177+
# dest.path,
178+
# )
179+
# for src, dest in src_dest
175180
]),
176181
)
177182
ctx.actions.run(

bazel/repositories.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def _cc_deps():
121121
# Dependencies with native bazel build files.
122122

123123
_bazel_repo("upb")
124-
_bazel_repo("com_google_protobuf", patches = ["//bazel/external:protobuf_gogo_hack.patch", "//bazel/external:protobuf_text_format.patch", "//bazel/external:protobuf_warning.patch"], patch_args = ["-p1"])
124+
_bazel_repo("com_google_protobuf", patches = ["//bazel/external:protobuf_text_format.patch", "//bazel/external:protobuf_warning.patch"], patch_args = ["-p1"])
125125
_bazel_repo("com_github_grpc_grpc", patches = ["//bazel/external:grpc.patch", "//bazel/external:grpc_go_toolchain.patch", "//bazel/external:grpc_test_visibility.patch"], patch_args = ["-p1"])
126126

127127
_bazel_repo("boringssl", patches = ["//bazel/external:boringssl.patch"], patch_args = ["-p0"])

src/api/proto/cloudpb/BUILD.bazel

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ pl_proto_library(
2626
"//src/api/proto/uuidpb:uuid_pl_proto",
2727
"//src/api/proto/vispb:vis_pl_proto",
2828
"//src/api/proto/vizierconfigpb:vizier_pl_proto",
29-
"@gogo_special_proto//github.com/gogo/protobuf/gogoproto",
30-
"@gogo_grpc_proto//github.com/gogo/protobuf/gogoproto:gogo_pl_proto",
29+
"@gogo_grpc_proto//github/gogo/protobuf/gogoproto:gogo_pl_proto",
3130
],
3231
)
3332

@@ -59,6 +58,6 @@ pl_py_grpc_library(
5958
"//src/api/proto/uuidpb:uuid_pl_py_proto",
6059
"//src/api/proto/vispb:vis_pl_py_proto",
6160
"//src/api/proto/vizierconfigpb:vizier_pl_py_proto",
62-
"@gogo_grpc_proto//github.com/gogo/protobuf/gogoproto:gogo_pl_py_proto",
61+
"@gogo_grpc_proto//github/gogo/protobuf/gogoproto:gogo_pl_py_proto",
6362
],
6463
)

src/api/proto/cloudpb/cloudapi.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ option go_package = "cloudpb";
2828
// * Please do not include dependencies that are outside of src/api
2929
// * and only include protobufs that are useful to external-facing users.
3030
//
31-
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
31+
import "github/gogo/protobuf/gogoproto/gogo.proto";
3232
import "google/protobuf/empty.proto";
3333
import "google/protobuf/timestamp.proto";
3434
import "google/protobuf/wrappers.proto";

src/api/proto/vispb/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pl_proto_library(
2121
srcs = ["vis.proto"],
2222
visibility = ["//src:__subpackages__"],
2323
deps = [
24-
"@gogo_special_proto//github.com/gogo/protobuf/gogoproto",
24+
"@gogo_special_proto//github/gogo/protobuf/gogoproto",
2525
],
2626
)
2727

src/api/proto/vispb/vis.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import "google/protobuf/wrappers.proto";
2727

2828
// Keep this below the google imports. Apparently protobufjs cli doesn't like
2929
// it when this is loaded before the google imports. :(
30-
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
30+
import "github/gogo/protobuf/gogoproto/gogo.proto";
3131

3232
// PXType represents the data type of an argument that a pxl script can take.
3333
// For example, with a func like def my_func(arg1: px.Service, arg2: int),

src/api/proto/vizierconfigpb/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pl_proto_library(
2121
srcs = ["vizier_types.proto"],
2222
visibility = ["//src:__subpackages__"],
2323
deps = [
24-
"@gogo_grpc_proto//github.com/gogo/protobuf/gogoproto:gogo_pl_proto",
24+
"@gogo_grpc_proto//github/gogo/protobuf/gogoproto:gogo_pl_proto",
2525
],
2626
)
2727

@@ -30,7 +30,7 @@ pl_cc_proto_library(
3030
proto = ":vizier_pl_proto",
3131
visibility = ["//src:__subpackages__"],
3232
deps = [
33-
"@gogo_grpc_proto//github.com/gogo/protobuf/gogoproto:gogo_pl_cc_proto",
33+
"@gogo_grpc_proto//github/gogo/protobuf/gogoproto:gogo_pl_cc_proto",
3434
],
3535
)
3636

src/api/proto/vizierconfigpb/vizier_types.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ package px.vizierconfigpb;
2222

2323
option go_package = "vizierconfigpb";
2424

25-
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
25+
import "github/gogo/protobuf/gogoproto/gogo.proto";
2626
import "google/protobuf/wrappers.proto";
2727

2828
// Note: Any changes to this file should be in sync with operatpro/api/v1alpha1/vizier_types.go.

0 commit comments

Comments
 (0)