forked from project-oak/oak
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WORKSPACE
446 lines (371 loc) · 15.2 KB
/
WORKSPACE
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
#
# Copyright 2018 The Project Oak Authors
#
# 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.
#
workspace(name = "oak")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository", "new_git_repository")
# Docker rules should be loaded in the beginning of the WORKSPACE file
# to avoid diamond dependencies:
# https://github.com/bazelbuild/rules_docker/blob/bb8da501955e5f7c1f704c50c0e4fce0193b2b2e/README.md#known-issues
http_archive(
name = "io_bazel_rules_docker",
sha256 = "df13123c44b4a4ff2c2f337b906763879d94871d16411bf82dcfeba892b58607",
strip_prefix = "rules_docker-0.13.0",
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.13.0/rules_docker-v0.13.0.tar.gz"],
)
load("@io_bazel_rules_docker//repositories:repositories.bzl", container_repositories = "repositories")
container_repositories()
load("@io_bazel_rules_docker//cc:image.bzl", _cc_image_repos = "repositories")
_cc_image_repos()
load("@io_bazel_rules_docker//repositories:deps.bzl", container_deps = "deps")
container_deps()
# Load a Distroless-CC Docker image.
load("@io_bazel_rules_docker//container:container.bzl", "container_pull")
container_pull(
name = "cc_image",
# Image uploaded on 2019-10-28.
# https://pantheon.corp.google.com/gcr/images/distroless/GLOBAL/cc
digest = "sha256:f81e5db8287d66b012d874a6f7fea8da5b96d9cc509aa5a9b5d095a604d4bca1",
registry = "gcr.io",
repository = "distroless/cc",
)
http_archive(
name = "rules_cc",
sha256 = "ff1710c6f2a880784abe6aa9a6fcb6c4cbfc2cf3e5d81ef5d92dddc8ef537864",
strip_prefix = "rules_cc-0489ba308b2e1fe458dea5a3e6efebd25087a339",
urls = [
# Head commit on 2020-01-14.
"https://github.com/bazelbuild/rules_cc/archive/0489ba308b2e1fe458dea5a3e6efebd25087a339.tar.gz",
],
)
http_archive(
name = "com_google_absl",
sha256 = "eb44e45b9b53b506658861f734ca743346ec792732b063a5b43c96751ccd90c7",
strip_prefix = "abseil-cpp-7853a7586c492ce8905c9e49f8679dada6354f2c",
urls = [
# Head commit on 2020-03-16.
"https://github.com/abseil/abseil-cpp/archive/7853a7586c492ce8905c9e49f8679dada6354f2c.zip",
],
)
# Java rules
http_archive(
name = "rules_java",
sha256 = "7f4772b0ee2b46a042870c844e9c208e8a0960a953a079236a4bbd785e471275",
strip_prefix = "rules_java-9eb38ebffbaf4414fa3d2292b28e604a256dd5a5",
urls = [
# Head commit on 2020-02-18.
"https://github.com/bazelbuild/rules_java/archive/9eb38ebffbaf4414fa3d2292b28e604a256dd5a5.zip",
],
)
# BoringSSL
http_archive(
name = "boringssl",
sha256 = "37fabee8aa25d4a7f4eb05071b2c1929991c272cc2cb1cb33305163faea3c668",
strip_prefix = "boringssl-6a47fc1adc71998756d275050351346e4fb4e2d5",
# Commit from 2019-12-13
urls = [
"https://github.com/google/boringssl/archive/6a47fc1adc71998756d275050351346e4fb4e2d5.tar.gz",
],
)
# Patch gRPC ares BUILD file.
# TODO: Remove when gRPC will fix Ares Android build
# https://github.com/grpc/grpc/pull/21463
http_archive(
name = "com_github_grpc_grpc",
patches = [
# This patch adds `ares_android.h` dependency in the Ares BUILD file.
# https://github.com/grpc/grpc/issues/21437
"//third_party/google/rpc:Add-ares-android.patch",
],
sha256 = "c2ab8a42a0d673c1acb596d276055adcc074c1116e427f118415da3e79e52969",
strip_prefix = "grpc-1.27.3",
urls = ["https://github.com/grpc/grpc/archive/v1.27.3.tar.gz"],
)
# Google Test
git_repository(
name = "gtest",
commit = "2fe3bd994b3189899d93f1d5a881e725e046fdc2",
remote = "https://github.com/google/googletest",
)
# Google Protocol Buffers.
http_archive(
name = "com_google_protobuf",
sha256 = "e8c7601439dbd4489fe5069c33d374804990a56c2f710e00227ee5d8fd650e67",
strip_prefix = "protobuf-3.11.2",
urls = [
"https://github.com/protocolbuffers/protobuf/archive/v3.11.2.tar.gz",
],
)
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
protobuf_deps()
# Google APIs for Cloud Spanner protos.
# TODO: Switch from fork after https://github.com/googleapis/googleapis/pull/553 is merged.
http_archive(
name = "com_google_googleapis",
sha256 = "3a426981242af9c05dbc3cdfc72f6627516232bbccaebaab1711397606184973",
strip_prefix = "googleapis-66d43496b46c26915d7d37302cddbd81481302d7",
urls = [
"https://github.com/michael-kernel-sanders/googleapis/archive/66d43496b46c26915d7d37302cddbd81481302d7.zip",
],
)
# Java gRPC support for Android examples.
http_archive(
name = "io_grpc_grpc_java",
#sha256 = "9d23d9fec84e24bd3962f5ef9d1fd61ce939d3f649a22bcab0f19e8167fae8ef",
strip_prefix = "grpc-java-1.29.0",
urls = [
"https://github.com/grpc/grpc-java/archive/v1.29.0.zip",
],
)
load("@io_grpc_grpc_java//:repositories.bzl", "grpc_java_repositories")
grpc_java_repositories()
# TODO: Create a deps function for the googleapis repo.
http_archive(
name = "com_google_api_codegen",
sha256 = "ba19948ebc4ea39358ba07fc0253f8927d7a2c9ba3462e8f34faad7ad5ac4142",
strip_prefix = "gapic-generator-8e930b79e846b9d4876462be9dc4c1dbc04e2903",
urls = ["https://github.com/googleapis/gapic-generator/archive/8e930b79e846b9d4876462be9dc4c1dbc04e2903.zip"],
)
http_archive(
name = "org_tensorflow",
sha256 = "4844e49a4d6ed9bceef608ce7f65f41b75e6362b2721c4e0d34a053d58753f42",
strip_prefix = "tensorflow-11bed638b14898cdde967f6b108e45732aa4798a",
urls = [
# Head commit on 2020-01-20.
"https://github.com/tensorflow/tensorflow/archive/11bed638b14898cdde967f6b108e45732aa4798a.tar.gz",
],
)
# TensorFlow dependency.
http_archive(
name = "io_bazel_rules_closure",
sha256 = "5b00383d08dd71f28503736db0500b6fb4dda47489ff5fc6bed42557c07c6ba9",
strip_prefix = "rules_closure-308b05b2419edb5c8ee0471b67a40403df940149",
urls = [
# Head commit on 2019-06-13.
"https://github.com/bazelbuild/rules_closure/archive/308b05b2419edb5c8ee0471b67a40403df940149.tar.gz",
],
)
# WebAssembly Binary Toolkit
#
# The config.h.patch is generated by following the wabt build instructions to
# generate a new config.h file, and then converting that into a patch file. E.g.
# in the wabt repo directory:
#
# ~~~
# $ mkdir build
# $ cd build
# $ cmake ..
# $ cmake --build .
# $ diff -Naur /dev/null config.h > config.h.patch
# ~~~
http_archive(
name = "wabt",
build_file = "@//third_party/wabt:wabt.BUILD",
patches = [
"//third_party/wabt:config.h.patch",
],
sha256 = "5333949ed4ae63808afa0d1f7d627cd7485ebeec339590571e5f2cb21e304f79",
strip_prefix = "wabt-1.0.12",
urls = ["https://github.com/WebAssembly/wabt/archive/1.0.12.tar.gz"],
)
# Tool used for creating a compilation database.
http_archive(
name = "io_kythe",
sha256 = "85dac12cdeea46f9e369ff109934aa98967bed1cd7c4c4afdc11577c3f99d31a",
strip_prefix = "kythe-4814f9f3fcc05c49fbe11f62f1e58a428048da27",
urls = [
# Head commit on 2019-12-03.
"https://github.com/kythe/kythe/archive/4814f9f3fcc05c49fbe11f62f1e58a428048da27.tar.gz",
],
)
# Kythe tool dependency.
# Loading only a subset of Kythe dependencies necessary for
# compilation database generation.
# https://github.com/kythe/kythe/blob/4814f9f3fcc05c49fbe11f62f1e58a428048da27/external.bzl#L110-L123
http_archive(
name = "com_github_google_glog",
build_file_content = "\n".join([
"load(\"//:bazel/glog.bzl\", \"glog_library\")",
"glog_library(with_gflags=0)",
]),
sha256 = "9b4867ab66c33c41e2672b5de7e3133d38411cdb75eeb0d2b72c88bb10375c71",
strip_prefix = "glog-ba8a9f6952d04d1403b97df24e6836227751454e",
url = "https://github.com/google/glog/archive/ba8a9f6952d04d1403b97df24e6836227751454e.zip",
)
# Kythe tool dependency.
# https://github.com/kythe/kythe/blob/4814f9f3fcc05c49fbe11f62f1e58a428048da27/external.bzl#L75-L85
http_archive(
name = "com_github_tencent_rapidjson",
build_file = "@io_kythe//third_party:rapidjson.BUILD",
sha256 = "8e00c38829d6785a2dfb951bb87c6974fa07dfe488aa5b25deec4b8bc0f6a3ab",
strip_prefix = "rapidjson-1.1.0",
url = "https://github.com/Tencent/rapidjson/archive/v1.1.0.zip",
)
http_archive(
name = "bazel_skylib",
sha256 = "9a737999532daca978a158f94e77e9af6a6a169709c0cee274f0a4c3359519bd",
strip_prefix = "bazel-skylib-1.0.0",
url = "https://github.com/bazelbuild/bazel-skylib/archive/1.0.0.tar.gz",
)
http_archive(
name = "io_bazel_rules_rust",
sha256 = "275f0166e61e6cad3e29b0e37c21ecbb66880c049dbeea6e574d74a8ec4775c5",
strip_prefix = "rules_rust-e285f2bd8be77712e6b80ccb52918b727d10d70e",
urls = [
# Master branch as of 2020-04-21.
"https://github.com/bazelbuild/rules_rust/archive/e285f2bd8be77712e6b80ccb52918b727d10d70e.tar.gz",
],
)
load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repository_set")
load("@io_bazel_rules_rust//:workspace.bzl", "bazel_version")
bazel_version(name = "bazel_version")
# Make sure to update Dockerfile too, e.g. when updating nightly version
rust_repository_set(
name = "rust_linux_x86_64",
exec_triple = "x86_64-unknown-linux-gnu",
extra_target_triples = ["wasm32-unknown-unknown"],
iso_date = "2020-04-17",
version = "nightly",
)
load("//cargo:crates.bzl", "raze_fetch_remote_crates")
raze_fetch_remote_crates()
# Bazel rules for Android applications.
http_archive(
name = "rules_android",
sha256 = "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806",
strip_prefix = "rules_android-0.1.1",
urls = ["https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip"],
)
load("@rules_android//android:rules.bzl", "android_ndk_repository", "android_sdk_repository")
android_sdk_repository(
name = "androidsdk",
api_level = 28,
build_tools_version = "28.0.3",
)
android_ndk_repository(
name = "androidndk",
api_level = 28,
)
load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
grpc_deps()
load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
grpc_extra_deps()
http_archive(
name = "io_bazel_rules_go",
sha256 = "142dd33e38b563605f0d20e89d9ef9eda0fc3cb539a14be1bdb1350de2eda659",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.22.2/rules_go-v0.22.2.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.22.2/rules_go-v0.22.2.tar.gz",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains()
# Download Gazelle
http_archive(
name = "bazel_gazelle",
sha256 = "d8c45ee70ec39a57e7a05e5027c32b1576cc7f16d9dd37135b0eddde45cf1b10",
urls = [
"https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/bazel-gazelle/releases/download/v0.20.0/bazel-gazelle-v0.20.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.20.0/bazel-gazelle-v0.20.0.tar.gz",
],
)
# Load and call Gazelle dependencies
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
gazelle_dependencies()
# Repositories used by Go code.
go_repository(
name = "com_github_golang_glog",
importpath = "github.com/golang/glog",
sum = "h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=",
version = "v0.0.0-20160126235308-23def4e6c14b",
)
go_repository(
name = "org_golang_google_grpc",
importpath = "google.golang.org/grpc",
sum = "h1:wdKvqQk7IttEw92GoRyKG2IDrUIpgpj6H6m81yfeMW0=",
version = "v1.25.1",
)
go_repository(
name = "org_golang_x_net",
importpath = "golang.org/x/net",
sum = "h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=",
version = "v0.0.0-20190311183353-d8887717615a",
)
go_repository(
name = "org_golang_x_text",
importpath = "golang.org/x/text",
sum = "h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=",
version = "v0.3.0",
)
load("@io_kythe//:setup.bzl", "kythe_rule_repositories")
kythe_rule_repositories()
# Kythe requires `go_rules_compat` to be loaded.
# https://github.com/kythe/kythe/blob/9941fe8eabba4612daea78ce69c5cc205e9b0791/WORKSPACE#L28-L39
# https://github.com/kythe/kythe/issues/4237
# Visibility warnings are disabled, since they cause check_formatting to fail.
# buildifier: disable=bzl-visibility
load("@io_bazel_rules_go//go/private:compat/compat_repo.bzl", "go_rules_compat")
go_rules_compat(
name = "io_bazel_rules_go_compat",
)
# clang + llvm 8.0
http_archive(
name = "clang",
build_file = "//toolchain:all_files.BUILD",
sha256 = "0f5c314f375ebd5c35b8c1d5e5b161d9efaeff0523bac287f8b4e5b751272f51",
strip_prefix = "clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-18.04",
url = "http://releases.llvm.org/8.0.0/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz",
)
# Gcc compiler for Arm
# We need the compiler in order to get the sysroot for aarch64_linux to crosscompile + all the
# needed libraries to link agaisnt.
# NB: we are not usign gcc to build, clang is still the default compiler.
http_archive(
name = "gcc_arm",
build_file = "//toolchain:all_files.BUILD",
sha256 = "8ce3e7688a47d8cd2d8e8323f147104ae1c8139520eca50ccf8a7fa933002731",
strip_prefix = "gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu",
url = "https://developer.arm.com/-/media/Files/downloads/gnu-a/8.3-2019.03/binrel/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz",
)
load("//toolchain:emcc_toolchain_config.bzl", "emsdk_configure")
# Should be configured after loading `clang`.
emsdk_configure(name = "emsdk")
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_repositories")
closure_repositories()
# Do not use `tf_workspace()` - it interferes with c-ares in gRPC loaded and patched
# and causes missing `ares.h` error.
# https://github.com/tensorflow/tensorflow/blob/25a06bc503c7d07ffc5480ac107e3c8681937971/tensorflow/workspace.bzl#L970-L975
load("@org_tensorflow//tensorflow:workspace.bzl", "tf_repositories")
tf_repositories()
# Roughtime
new_git_repository(
name = "roughtime",
build_file = "//third_party/roughtime:roughtime.BUILD",
commit = "51f6971f5f06ec101e5fbcabe5a49477708540f3",
remote = "https://roughtime.googlesource.com/roughtime",
shallow_since = "1555608176 +0000",
)
# Bazel rules for packaging and deployment by Grakn Labs
http_archive(
name = "graknlabs_bazel_distribution",
sha256 = "cbb8357cc5b78a141ab7871558916c991f3ba80778d91fd4e2aa6b7894f52749",
strip_prefix = "bazel-distribution-01973c5e50eadf7a64273d72d0158d58012f977c",
url = "https://github.com/graknlabs/bazel-distribution/archive/01973c5e50eadf7a64273d72d0158d58012f977c.zip",
)
load("@graknlabs_bazel_distribution//common:dependencies.bzl", "bazelbuild_rules_pkg")
bazelbuild_rules_pkg()
load("@graknlabs_bazel_distribution//packer:dependencies.bzl", "deploy_packer_dependencies")
deploy_packer_dependencies()