-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMODULE.bazel
191 lines (172 loc) · 6.82 KB
/
MODULE.bazel
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# Copyright 2023 Aalyria Technologies, Inc., and its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
module(name = "aalyria_api")
bazel_dep(name = "protobuf")
# Patch protobuf to backport
# https://github.com/protocolbuffers/protobuf/pull/17402 to protobuf 28.0-rc3.
#
# Version 28.0-rc3 is chosen because it contains a fix to restore compatability
# with libraries developed against older versions of protobuf.
# Specifically, grpc-java is the particular dependency we have that is developed
# against an old protobuf version, and so until this fix could not be used with
# newer protobuf versions.
#
# For the issue tracking grpc-java using an old version of protobuf, see:
# https://github.com/grpc/grpc-java/issues/11015
#
# For the change to protobuf that restores backwards compatability, see:
# https://github.com/protocolbuffers/protobuf/commit/72b0b7afbabce7494c2605aa240b0f0ca98aa6e5
archive_override(
module_name = "protobuf",
integrity = "sha256-9bcrhX/F2Ofy/ZyneHqEumMffGQeFSzVA/7/mXv4gBI=",
patch_strip = 1,
patches = [
"//patches:protobuf.patch",
],
strip_prefix = "protobuf-28.0-rc3",
urls = "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v28.0-rc3.zip",
)
bazel_dep(name = "gazelle", version = "0.39.1")
bazel_dep(name = "googleapis", version = "0.0.0-20240326-1c8d509c5")
# This override is necessary to prevent bzlmod from resolving grpc-java to a
# version impacted by https://github.com/grpc/grpc-java/issues/11275.
single_version_override(
module_name = "grpc-java",
version = "1.64.0",
)
bazel_dep(name = "rules_go", version = "0.49.0")
bazel_dep(name = "rules_java", version = "7.9.0")
bazel_dep(name = "rules_jvm_external", version = "6.2")
bazel_dep(name = "rules_oci", version = "1.7.5")
bazel_dep(name = "rules_pkg", version = "0.10.1")
bazel_dep(name = "rules_proto_grpc_cpp", version = "5.0.0")
bazel_dep(name = "rules_proto_grpc_doc", version = "5.0.0")
bazel_dep(name = "rules_proto_grpc_java", version = "5.0.0")
bazel_dep(name = "rules_proto_grpc_python", version = "5.0.0")
# Patch rules_proto_gprc_python to use protobuf python v28.0-rc3.
archive_override(
module_name = "rules_proto_grpc_python",
integrity = "sha256-b9r/nAMUoakRmZn2IlVYhaNYgNUXeWHGV4wgd2cCmV8=",
patch_strip = 1,
patches = [
"//patches:rules_proto_grpc_python.patch",
],
strip_prefix = "rules_proto_grpc_python-5.0.0",
urls = "https://github.com/rules-proto-grpc/rules_proto_grpc/releases/download/5.0.0/rules_proto_grpc_python-5.0.0.tar.gz",
)
bazel_dep(name = "rules_python", version = "0.35.0")
bazel_dep(name = "toolchains_protoc")
# Patch toolchains_protoc to make protoc v28.0-rc3 available.
archive_override(
module_name = "toolchains_protoc",
integrity = "sha256-0e/PjCIJqHKk5IQoPW8hBmuKRFyWdVdXZSebhrkmiQ4=",
patch_strip = 1,
patches = [
"//patches:toolchains_protoc.patch",
],
strip_prefix = "toolchains_protoc-0.3.1",
urls = "https://github.com/aspect-build/toolchains_protoc/archive/refs/tags/v0.3.1.zip",
)
# Configure the protoc toolchain used by rules_proto_grpc to use protoc
# v28.0-rc3. This ensures that the version agrees with the protobuf dependency
# version, which is necessary because Protobuf C++ requires an exact match
# between its generated code version and its runtime version.
# (https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp)
protoc = use_extension("@toolchains_protoc//protoc:extensions.bzl", "protoc")
protoc.toolchain(
google_protobuf = "com_google_protobuf",
version = "v28.0-rc3",
)
bazel_dep(name = "container_structure_test", version = "1.16.0", dev_dependency = True)
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
artifacts = [
"com.google.code.gson:gson:2.10.1",
"com.google.googlejavaformat:google-java-format:1.17.0",
"com.google.guava:guava:33.3.0-jre",
"io.grpc:grpc-testing:1.66.0",
"io.helidon.grpc:helidon-grpc-core:3.2.5",
"junit:junit:4.13.2",
"org.bouncycastle:bcprov-jdk15on:1.70",
"org.mockito:mockito-core:4.5.1",
],
repositories = [
"https://repo.maven.apache.org/maven2/",
],
)
use_repo(maven, "maven")
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(
version = "1.23.0",
)
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
use_repo(
go_deps,
"com_github_fullstorydev_grpcurl",
"com_github_golang_jwt_jwt_v5",
"com_github_google_go_cmp",
"com_github_google_uuid",
"com_github_jhump_protoreflect",
"com_github_jonboulle_clockwork",
"com_github_prometheus_client_model",
"com_github_prometheus_prom2json",
"com_github_rs_zerolog",
"com_github_urfave_cli_v2",
"com_github_vishvananda_netlink",
"io_opentelemetry_go_contrib_instrumentation_google_golang_org_grpc_otelgrpc",
"io_opentelemetry_go_otel",
"io_opentelemetry_go_otel_exporters_otlp_otlptrace_otlptracegrpc",
"io_opentelemetry_go_otel_sdk",
"io_opentelemetry_go_otel_trace",
"org_golang_google_genproto",
"org_golang_google_genproto_googleapis_rpc",
"org_golang_google_grpc",
"org_golang_google_protobuf",
"org_golang_x_sync",
"org_golang_x_sys",
)
switched_rules = use_extension("@googleapis//:extensions.bzl", "switched_rules")
switched_rules.use_languages(
cc = True,
java = True,
python = True,
)
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
is_default = True,
python_version = "3.11",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "python_deps",
python_version = "3.11",
requirements_lock = "//:requirements.txt",
)
use_repo(pip, "python_deps")
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
oci.pull(
name = "alpine_base",
# docker.io/library/alpine:3.19.1
digest = "sha256:c5b1261d6d3e43071626931fc004f70149baeba2c8ec672bd4f27761f8e1ad6b", # 3.19.1 2024-01-26
image = "docker.io/library/alpine",
platforms = ["linux/amd64"],
)
use_repo(oci, "alpine_base")
bazel_dep(name = "org_outernetcouncil_nmts")
archive_override(
module_name = "org_outernetcouncil_nmts",
strip_prefix = "nmts-0.0.5",
urls = "https://github.com/outernetcouncil/nmts/archive/refs/tags/v0.0.5.tar.gz",
)