Skip to content

Commit 6ae38dd

Browse files
committed
Remove '.com' from gogo repository names to avoid python proto module issues
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
1 parent 515b57e commit 6ae38dd

8 files changed

Lines changed: 31 additions & 24 deletions

File tree

.arclint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"(^src/ui/src/types/generated/)",
3434
"(^src/ui/src/types/schema\\.ts$)",
3535
"(^third_party/cpplint/cpplint.py$)",
36-
"(^third_party/github.com/gogo/protobuf/gogoproto/gogo.proto$)",
36+
"(^third_party/github/gogo/protobuf/gogoproto/gogo.proto$)",
3737
"(c_cpp_properties.json$)",
3838
"(go\\.mod$)",
3939
"(go\\.sum$)"

bazel/external/protobuf_gogo_hack.patch

Lines changed: 0 additions & 17 deletions
This file was deleted.

bazel/external/protobuf_javascript.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ index 97b5844..1351a54 100644
66

77
for (int i = 0; i < file->dependency_count(); i++) {
88
const std::string& name = file->dependency(i)->name();
9-
+ if (ModuleAlias(name) == "github_com_gogo_protobuf_gogoproto_gogo_pb") {
9+
+ if (ModuleAlias(name) == "github_gogo_protobuf_gogoproto_gogo_pb") {
1010
+ continue;
1111
+ }
1212
printer->Print(

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: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ 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
31-
load("@px//bazel:proto_compile.bzl", "pl_proto_library", "pl_cc_proto_library")
31+
load("@px//bazel:proto_compile.bzl", "pl_proto_library", "pl_cc_proto_library", "pl_py_proto_library")
3232
3333
pl_proto_library(
3434
name = "gogo_pl_proto",
@@ -44,6 +44,13 @@ pl_cc_proto_library(
4444
deps = [],
4545
)
4646
47+
pl_py_proto_library(
48+
name = "gogo_pl_py_proto",
49+
proto = ":gogo_pl_proto",
50+
visibility = ["//visibility:public"],
51+
deps = [],
52+
)
53+
4754
""")
4855

4956
gogo_grpc_proto = repository_rule(

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"])

scripts/update_ts_protos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function copy() {
4848
# VizierapiServiceClient.ts has a relative import; we're copying elsewhere. We fix this with perl string substitution.
4949
regexRelativeImport="s|import \* as ([^ ]+) from '([^ /]+/)+vizierapi_pb'\;|import * as \1 from './vizierapi_pb';|m"
5050
# vizierapi_pb.d.ts incorrectly includes an unused (and non-existent) relative import related to Go protos. Remove it.
51-
regexExtraneousImport="s|^import \* as github_com_gogo_protobuf_gogoproto_gogo_pb.*$||m"
51+
regexExtraneousImport="s|^import \* as github_gogo_protobuf_gogoproto_gogo_pb.*$||m"
5252

5353
for abs_path in $abs_paths; do
5454
echo "Propagating ${abs_path} ..."

third_party/github.com/gogo/protobuf/gogoproto/gogo.proto renamed to third_party/github/com/gogo/protobuf/gogoproto/gogo.proto

File renamed without changes.

0 commit comments

Comments
 (0)