-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathp4_infra_deps.bzl
More file actions
204 lines (200 loc) · 10.3 KB
/
p4_infra_deps.bzl
File metadata and controls
204 lines (200 loc) · 10.3 KB
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
192
193
194
195
196
197
198
199
200
201
202
203
204
"""Third party dependencies.
Please read carefully before adding new dependencies:
- Any dependency can break all of P4 Infra. Please be mindful of that before
adding new dependencies. Try to stick to stable versions of widely used libraries.
Do not depend on private repositories and forks.
- Fix dependencies to a specific version or commit, so upstream changes cannot break
p4-infra. Prefer releases over arbitrary commits when both are available.
"""
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def p4_infra_deps():
"""Sets up 3rd party workspaces needed to build P4 infrastructure."""
if not native.existing_rule("rules_cc"):
http_archive(
name = "rules_cc",
sha256 = "b8b918a85f9144c01f6cfe0f45e4f2838c7413961a8ff23bc0c6cdf8bb07a3b6",
strip_prefix = "rules_cc-0.1.5",
url = "https://github.com/bazelbuild/rules_cc/releases/download/0.1.5/rules_cc-0.1.5.tar.gz",
)
if not native.existing_rule("com_github_bazelbuild_buildtools"):
http_archive(
name = "com_github_bazelbuild_buildtools",
sha256 = "e3bb0dc8b0274ea1aca75f1f8c0c835adbe589708ea89bf698069d0790701ea3",
strip_prefix = "buildtools-5.1.0",
url = "https://github.com/bazelbuild/buildtools/archive/refs/tags/5.1.0.tar.gz",
)
if not native.existing_rule("com_github_nelhage_rules_boost"):
# This version includes the fix for boost failures due to the xz library issue.
http_archive(
name = "com_github_nelhage_rules_boost",
url = "https://github.com/nelhage/rules_boost/archive/5160325dbdc8c9e499f9d9917d913f35f1785d52.zip",
strip_prefix = "rules_boost-5160325dbdc8c9e499f9d9917d913f35f1785d52",
sha256 = "feb4b1294684c79df7c1e08f1aec5da0da52021e33db59c88edbe86b4d1a017a",
patch_args = ["-p1"],
patches = [
"@com_google_gutil//:bazel/patches/boost-001-temp_fix_for_build_failure.patch",
],
)
if not native.existing_rule("com_github_grpc_grpc"):
http_archive(
name = "com_github_grpc_grpc",
url = "https://github.com/grpc/grpc/archive/v1.63.0.zip",
strip_prefix = "grpc-1.63.0",
sha256 = "daa1b06a19b5f7e4603e1f8980eeab43cf69b6e89bee3b2547f275fa5af7f480",
patch_args = ["-p1"],
# TODO(b/411119415): This patch will be removed once we switch over to bzlmod and
# upgrade the grpc version.
patches = [
"@com_google_gutil//:bazel/patches/grpc-003-fix_go_gazelle_register_toolchain.patch",
],
)
if not native.existing_rule("com_google_absl"):
http_archive(
name = "com_google_absl",
url = "https://github.com/abseil/abseil-cpp/archive/20240116.2.tar.gz",
strip_prefix = "abseil-cpp-20240116.2",
sha256 = "733726b8c3a6d39a4120d7e45ea8b41a434cdacde401cba500f14236c49b39dc",
)
if not native.existing_rule("com_google_googletest"):
http_archive(
name = "com_google_googletest",
urls = ["https://github.com/google/googletest/archive/release-1.11.0.tar.gz"],
strip_prefix = "googletest-release-1.11.0",
sha256 = "b4870bf121ff7795ba20d20bcdd8627b8e088f2d1dab299a031c1034eddc93d5",
)
if not native.existing_rule("com_google_benchmark"):
http_archive(
name = "com_google_benchmark",
urls = ["https://github.com/google/benchmark/archive/v1.5.4.tar.gz"],
strip_prefix = "benchmark-1.5.4",
sha256 = "e3adf8c98bb38a198822725c0fc6c0ae4711f16fbbf6aeb311d5ad11e5a081b5",
)
if not native.existing_rule("com_google_protobuf"):
http_archive(
name = "com_google_protobuf",
url = "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v25.2.zip",
strip_prefix = "protobuf-25.2",
sha256 = "ddd0f5271f31b549efc74eb39061e142132653d5d043071fcec265bd571e73c4",
)
if not native.existing_rule("com_google_googleapis"):
http_archive(
name = "com_google_googleapis",
url = "https://github.com/googleapis/googleapis/archive/f405c718d60484124808adb7fb5963974d654bb4.zip",
strip_prefix = "googleapis-f405c718d60484124808adb7fb5963974d654bb4",
sha256 = "406b64643eede84ce3e0821a1d01f66eaf6254e79cb9c4f53be9054551935e79",
)
if not native.existing_rule("com_google_gutil"):
http_archive(
name = "com_google_gutil",
# Newest commit on main as of 2025-12-11.
url = "https://github.com/google/gutil/archive/4aaf6e6279df0c9420aa983ea39203bb24100b65.zip",
strip_prefix = "gutil-4aaf6e6279df0c9420aa983ea39203bb24100b65",
sha256 = "e3b1bc9607e27c9e2c44a2c370da7f1d819c25d065792849b34a52317188afc4",
)
if not native.existing_rule("com_github_otg_models"):
http_archive(
name = "com_github_otg_models",
url = "https://github.com/open-traffic-generator/models/archive/refs/tags/v0.12.5.zip",
strip_prefix = "models-0.12.5",
build_file = "@//:bazel/BUILD.otg-models.bazel",
sha256 = "1a63e769f1d7f42c79bc1115babf54acbc44761849a77ac28f47a74567f10090",
)
if not native.existing_rule("com_github_gnmi"):
http_archive(
name = "com_github_gnmi",
# v0.10.0 release; commit-hash:5473f2ef722ee45c3f26eee3f4a44a7d827e3575.
url = "https://github.com/openconfig/gnmi/archive/refs/tags/v0.10.0.zip",
strip_prefix = "gnmi-0.10.0",
patch_args = ["-p1"],
patches = [
"@com_github_google_pins_infra//:bazel/patches/gnmi-001-fix_virtual_proto_import.patch",
],
sha256 = "2231e1cc398a523fa840810fa6fdb8960639f7b91b57bb8f12ed8681e0142a67",
)
if not native.existing_rule("com_github_gnoi"):
http_archive(
name = "com_github_gnoi",
# Newest commit on main on 2021-11-08.
url = "https://github.com/openconfig/gnoi/archive/1ece8ed91a0d5d283219a99eb4dc6c7eadb8f287.zip",
strip_prefix = "gnoi-1ece8ed91a0d5d283219a99eb4dc6c7eadb8f287",
sha256 = "991ff13a0b28f2cdc2ccb123261e7554d9bcd95c00a127411939a3a8c8a9cc62",
)
if not native.existing_rule("com_github_p4lang_p4c"):
http_archive(
name = "com_github_p4lang_p4c",
# Newest commit on main on 2024-08-01.
url = "https://github.com/p4lang/p4c/archive/44dbcda9c7e3d26d24baadb884b31b32d215edef.zip",
strip_prefix = "p4c-44dbcda9c7e3d26d24baadb884b31b32d215edef",
sha256 = "ae4d53d0fd41572c38b03e881a8e2d2e472df246f75d6a64555f9ff1b656b574",
)
if not native.existing_rule("com_github_p4lang_p4runtime"):
# We frequently need bleeding-edge, unreleased version of P4Runtime, so we use a commit
# rather than a release.
http_archive(
name = "com_github_p4lang_p4runtime",
# Newest commit on main as of 2025-10-17.
urls = ["https://github.com/p4lang/p4runtime/archive/f5187a26cd8745cae1b8a48bcdddddc00ec85e22.zip"],
strip_prefix = "p4runtime-f5187a26cd8745cae1b8a48bcdddddc00ec85e22/proto",
sha256 = "ec894c1458a3a9504e98e4f6cc0683ddb2307d1aa229807819b2d8edab963b04",
)
if not native.existing_rule("com_github_p4lang_p4_constraints"):
# This commit is from https://github.com/p4lang/p4-constraints/pull/177.
# TODO: b/445173612 - Remove Bazel build hacks and depend on a proper upstream branch.
http_archive(
name = "com_github_p4lang_p4_constraints",
urls = ["https://github.com/p4lang/p4-constraints/archive/5b6ec72c61c9f69b1d62b58e170eb414c6748059.zip"],
strip_prefix = "p4-constraints-5b6ec72c61c9f69b1d62b58e170eb414c6748059",
)
if not native.existing_rule("com_jsoncpp"):
http_archive(
name = "com_jsoncpp",
url = "https://github.com/open-source-parsers/jsoncpp/archive/1.9.4.zip",
strip_prefix = "jsoncpp-1.9.4",
build_file = "@//:bazel/BUILD.jsoncpp.bazel",
sha256 = "6da6cdc026fe042599d9fce7b06ff2c128e8dd6b8b751fca91eb022bce310880",
)
if not native.existing_rule("com_gnu_gmp"):
http_archive(
name = "com_gnu_gmp",
urls = [
"https://gmplib.org/download/gmp/gmp-6.2.1.tar.xz",
"https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.xz",
],
strip_prefix = "gmp-6.2.1",
sha256 = "fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2",
build_file = "@//:bazel/BUILD.gmp.bazel",
)
if not native.existing_rule("rules_foreign_cc"):
http_archive(
name = "rules_foreign_cc",
sha256 = "d54742ffbdc6924f222d2179f0e10e911c5c659c4ae74158e9fe827aad862ac6",
strip_prefix = "rules_foreign_cc-0.2.0",
url = "https://github.com/bazelbuild/rules_foreign_cc/archive/0.2.0.tar.gz",
)
if not native.existing_rule("rules_proto"):
http_archive(
name = "rules_proto",
urls = [
"https://github.com/bazelbuild/rules_proto/archive/5.3.0-21.7.tar.gz",
],
strip_prefix = "rules_proto-5.3.0-21.7",
sha256 = "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd",
)
if not native.existing_rule("rules_pkg"):
http_archive(
name = "rules_pkg",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.5.1/rules_pkg-0.5.1.tar.gz",
"https://github.com/bazelbuild/rules_pkg/releases/download/0.5.1/rules_pkg-0.5.1.tar.gz",
],
sha256 = "a89e203d3cf264e564fcb96b6e06dd70bc0557356eb48400ce4b5d97c2c3720d",
)
if not native.existing_rule("com_google_ydf"):
http_archive(
name = "com_google_ydf",
urls = [
"https://github.com/google/yggdrasil-decision-forests/archive/50e3ef7d8e106f0021cab5fb94b230214f17ff94.zip",
],
strip_prefix = "yggdrasil-decision-forests-50e3ef7d8e106f0021cab5fb94b230214f17ff94",
sha256 = "c5c0cd9924064a1c70356c2074e30e9fb7daaec6267d33fc58a1d0f4a99bc501",
)