forked from sonic-net/sonic-pins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpins_infra_deps.bzl
187 lines (183 loc) · 9.75 KB
/
pins_infra_deps.bzl
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
"""Third party dependencies.
Please read carefully before adding new dependencies:
- Any dependency can break all of pins-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
pins-infra. Prefer releases over arbitrary commits when both are available.
"""
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def pins_infra_deps():
"""Sets up 3rd party workspaces needed to build PINS infrastructure."""
if not native.existing_rule("com_github_bazelbuild_buildtools"):
http_archive(
name = "com_github_bazelbuild_buildtools",
sha256 = "44a6e5acc007e197d45ac3326e7f993f0160af9a58e8777ca7701e00501c0857",
strip_prefix = "buildtools-4.2.4",
url = "https://github.com/bazelbuild/buildtools/archive/4.2.4.tar.gz",
)
if not native.existing_rule("com_github_grpc_grpc"):
http_archive(
name = "com_github_grpc_grpc",
url = "https://github.com/grpc/grpc/archive/v1.46.0.zip",
strip_prefix = "grpc-1.46.0",
sha256 = "1cbd6d6dfc9b1235766fc6b1d66d4f1dbb87f877a44c2a799bc8ee6b383af0fa",
)
if not native.existing_rule("com_google_absl"):
http_archive(
name = "com_google_absl",
url = "https://github.com/abseil/abseil-cpp/archive/refs/tags/20211102.0.tar.gz",
strip_prefix = "abseil-cpp-20211102.0",
sha256 = "dcf71b9cba8dc0ca9940c4b316a0c796be8fab42b070bb6b7cab62b48f0e66c4",
)
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_protobuf"):
http_archive(
name = "com_google_protobuf",
url = "https://github.com/protocolbuffers/protobuf/releases/download/v3.20.1/protobuf-all-3.20.1.tar.gz",
strip_prefix = "protobuf-3.20.1",
sha256 = "3a400163728db996e8e8d21c7dfb3c239df54d0813270f086c4030addeae2fad",
)
if not native.existing_rule("com_googlesource_code_re2"):
http_archive(
name = "com_googlesource_code_re2",
# Newest commit on "absl" branch as of 2021-03-25.
url = "https://github.com/google/re2/archive/72f110e82ccf3a9ae1c9418bfb447c3ba1cf95c2.zip",
strip_prefix = "re2-72f110e82ccf3a9ae1c9418bfb447c3ba1cf95c2",
sha256 = "146bf2e8796317843106a90543356c1baa4b48236a572e39971b839172f6270e",
)
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_github_google_glog"):
http_archive(
name = "com_github_google_glog",
url = "https://github.com/google/glog/archive/v0.4.0.tar.gz",
strip_prefix = "glog-0.4.0",
sha256 = "f28359aeba12f30d73d9e4711ef356dc842886968112162bc73002645139c39c",
)
# Needed to make glog happy.
if not native.existing_rule("com_github_gflags_gflags"):
http_archive(
name = "com_github_gflags_gflags",
url = "https://github.com/gflags/gflags/archive/v2.2.2.tar.gz",
strip_prefix = "gflags-2.2.2",
sha256 = "34af2f15cf7367513b352bdcd2493ab14ce43692d2dcd9dfc499492966c64dcf",
)
if not native.existing_rule("com_github_p4lang_p4c"):
http_archive(
name = "com_github_p4lang_p4c",
# Newest commit on main on 2021-12-07.
url = "https://github.com/p4lang/p4c/archive/a9aa5ff46affe8fd5dde78c2411d1bc58a715b33.zip",
strip_prefix = "p4c-a9aa5ff46affe8fd5dde78c2411d1bc58a715b33",
sha256 = "fa22c3d2b3105a39a73fc3938cbc6cd5d7895113a3e6ed6c5a48fbbd958a28af",
)
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",
# 13f0d0 is the newest commit on main as of 2022-08-02.
urls = ["https://github.com/p4lang/p4runtime/archive/13f0d02a521e38b4252f4fddfc98e2bfa1dbf7e6.zip"],
strip_prefix = "p4runtime-13f0d02a521e38b4252f4fddfc98e2bfa1dbf7e6/proto",
sha256 = "ad18b27341ea1a875919a63d37eaa347d3d85299a1f90c4bbc33789c1d0580b7",
)
if not native.existing_rule("com_github_p4lang_p4_constraints"):
http_archive(
name = "com_github_p4lang_p4_constraints",
urls = ["https://github.com/p4lang/p4-constraints/archive/5b3b4d7cecdaf30804a66e1bb6abb4f25ab2e423.zip"],
strip_prefix = "p4-constraints-5b3b4d7cecdaf30804a66e1bb6abb4f25ab2e423",
sha256 = "ae7853171b789680b6147c3966599859157b5f48adfaf5c0357d3295a804b2c3",
)
if not native.existing_rule("com_github_nlohmann_json"):
http_archive(
name = "com_github_nlohmann_json",
# JSON for Modern C++
url = "https://github.com/nlohmann/json/archive/v3.7.3.zip",
strip_prefix = "json-3.7.3",
sha256 = "e109cd4a9d1d463a62f0a81d7c6719ecd780a52fb80a22b901ed5b6fe43fb45b",
build_file_content = """cc_library(name = "nlohmann_json",
visibility = ["//visibility:public"],
hdrs = glob([
"include/nlohmann/*.hpp",
"include/nlohmann/**/*.hpp",
]),
includes = ["include"],
)""",
)
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_github_ivmai_cudd"):
http_archive(
name = "com_github_ivmai_cudd",
build_file = "@//:bazel/BUILD.cudd.bazel",
strip_prefix = "cudd-cudd-3.0.0",
sha256 = "5fe145041c594689e6e7cf4cd623d5f2b7c36261708be8c9a72aed72cf67acce",
urls = ["https://github.com/ivmai/cudd/archive/cudd-3.0.0.tar.gz"],
)
if not native.existing_rule("com_gnu_gmp"):
http_archive(
name = "com_gnu_gmp",
url = "https://gmplib.org/download/gmp/gmp-6.1.2.tar.xz",
strip_prefix = "gmp-6.1.2",
sha256 = "87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912",
build_file = "@//:bazel/BUILD.gmp.bazel",
)
if not native.existing_rule("com_github_z3prover_z3"):
http_archive(
name = "com_github_z3prover_z3",
url = "https://github.com/Z3Prover/z3/archive/z3-4.8.12.tar.gz",
strip_prefix = "z3-z3-4.8.12",
sha256 = "e3aaefde68b839299cbc988178529535e66048398f7d083b40c69fe0da55f8b7",
build_file = "@//:bazel/BUILD.z3.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://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz",
"https://github.com/bazelbuild/rules_proto/archive/97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz",
],
strip_prefix = "rules_proto-97d8af4dc474595af3900dd85cb3a29ad28cc313",
sha256 = "602e7161d9195e50246177e7c55b2f39950a9cf7366f74ed5f22fd45750cd208",
)
if not native.existing_rule("sonic_swss_common"):
http_archive(
name = "sonic_swss_common",
url = "https://github.com/azure/sonic-swss-common/archive/a5db0db46b23c000e0702e8ac247808c7d9ffe24.zip",
strip_prefix = "sonic-swss-common-a5db0db46b23c000e0702e8ac247808c7d9ffe24",
sha256 = "e1b8a787106b0627905cd07057ba094b4737942bc252287dd4014dd153664632",
)
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",
)