Skip to content

Commit 07be054

Browse files
authored
Fix build imports (#171)
1 parent 00fca7e commit 07be054

Some content is hidden

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

62 files changed

+6731
-9047
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ gNOI defines a set of gRPC-based microservices for executing operational command
33

44
# Rebuild *.pb.go files
55
```
6-
./compile_proto.sh
6+
./regenerate-files.sh
77
````

WORKSPACE

Lines changed: 24 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
workspace(name = "com_github_openconfig_gnoi")
2+
13
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
24

35
### Bazel rules for many languages to compile PROTO into gRPC libraries
@@ -8,6 +10,20 @@ http_archive(
810
urls = ["https://github.com/rules-proto-grpc/rules_proto_grpc/archive/4.6.0.tar.gz"],
911
)
1012

13+
http_archive(
14+
name = "com_google_googleapis",
15+
sha256 = "9fc03150d86501d7da35eefa989d5553bdd77a95cfe4373cdafe8eee92f6bfb1",
16+
strip_prefix = "googleapis-870a5ed7e141b4faf70e2a0858854e9b5bb18612",
17+
urls = ["https://github.com/googleapis/googleapis/archive/870a5ed7e141b4faf70e2a0858854e9b5bb18612.tar.gz"],
18+
)
19+
20+
load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language")
21+
switched_rules_by_language(
22+
name = "com_google_googleapis_imports",
23+
cc = True,
24+
go = True,
25+
)
26+
1127
load(
1228
"@rules_proto_grpc//:repositories.bzl",
1329
"bazel_gazelle",
@@ -38,64 +54,20 @@ go_register_toolchains(go_version = "1.20")
3854
# gazelle:repo bazel_gazelle
3955
bazel_gazelle()
4056

41-
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
57+
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
4258

43-
go_repository(
44-
name = "com_github_openconfig_bootz",
45-
importpath = "github.com/openconfig/bootz",
46-
sum = "h1:pCBi4GXcT+XM2Vud8kh0Q6uyw6oUxN1CFvrxnW+I/as=",
47-
version = "v0.1.1",
48-
)
49-
50-
51-
go_repository(
52-
name = "com_github_openconfig_gnmi",
53-
build_directives = [
54-
"gazelle:proto_import_prefix github.com/openconfig/gnmi",
55-
],
56-
build_file_generation = "on",
57-
importpath = "github.com/openconfig/gnmi",
58-
sum = "h1:tv9HygDMXnoGyWuLmNCodMV2+PK6+uT/ndAxDVzsUUQ=",
59-
version = "v0.0.0-20220617175856-41246b1b3507",
60-
)
59+
load("//:gnoi_deps.bzl", "gnoi_deps")
6160

62-
go_repository(
63-
name = "com_github_openconfig_gnsi",
64-
importpath = "github.com/openconfig/gnsi",
65-
sum = "h1:oHdSFP1CpP+mfv6IOKWefHpbW3Fy9ZOSHgPgpCb8EDU=",
66-
version = "v1.2.4",
67-
)
68-
69-
go_repository(
70-
name = "com_github_kylelemons_godebug",
71-
importpath = "github.com/kylelemons/godebug",
72-
sum = "h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=",
73-
version = "v1.1.0",
74-
)
75-
76-
go_repository(
77-
name = "com_github_openconfig_goyang",
78-
importpath = "github.com/openconfig/goyang",
79-
sum = "h1:Z95LskKYk6nBYOxHtmJCu3YEKlr3pJLWG1tYAaNh3yU=",
80-
version = "v0.2.9",
81-
)
82-
83-
go_repository(
84-
name = "com_github_openconfig_ygot",
85-
build_directives = [
86-
"gazelle:proto_import_prefix github.com/openconfig/ygot",
87-
],
88-
importpath = "github.com/openconfig/ygot",
89-
sum = "h1:EKaeFhx1WwTZGsYeqipyh1mfF8y+z2StaXZtwVnXklk=",
90-
version = "v0.13.1",
91-
)
92-
93-
gazelle_dependencies()
61+
gnoi_deps()
9462

9563
load("@rules_proto_grpc//go:repositories.bzl", rules_proto_grpc_go_repos = "go_repos")
9664

9765
rules_proto_grpc_go_repos()
9866

67+
# Load gazelle_dependencies last, so that the newer version of org_golang_google_grpc is used.
68+
# see https://github.com/rules-proto-grpc/rules_proto_grpc/issues/160
69+
gazelle_dependencies()
70+
9971
### C++
10072
load("@rules_proto_grpc//cpp:repositories.bzl", rules_proto_grpc_cpp_repos = "cpp_repos")
10173

@@ -105,6 +77,7 @@ load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
10577

10678
grpc_deps()
10779

80+
10881
# open-config YANG files
10982
http_archive(
11083
name = "github_openconfig_yang",

bgp/bgp.pb.go

Lines changed: 118 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bgp/bgp.proto

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515
//
16-
1716
syntax = "proto3";
1817

1918
package gnoi.bgp;
2019

21-
import "types/types.proto";
20+
import "github.com/openconfig/gnoi/types/types.proto";
2221

2322
option go_package = "github.com/openconfig/gnoi/bgp";
2423

0 commit comments

Comments
 (0)