-
Notifications
You must be signed in to change notification settings - Fork 0
/
WORKSPACE.bazel
372 lines (314 loc) · 11.1 KB
/
WORKSPACE.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
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
workspace(name = "k9db")
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")
# Rules java
http_archive(
name = "rules_java",
url = "https://github.com/bazelbuild/rules_java/releases/download/4.0.0/rules_java-4.0.0.tar.gz",
sha256 = "34b41ec683e67253043ab1a3d1e8b7c61e4e8edefbcad485381328c934d072fe",
)
load("@rules_java//java:repositories.bzl", "rules_java_dependencies", "rules_java_toolchains")
rules_java_dependencies()
rules_java_toolchains()
# Get newer version of python_rules so that tcmalloc works
# Must be defined here, otherwise protobuf_deps will pull in an older version of this
# repo.
http_archive(
name = "rules_python",
sha256 = "954aa89b491be4a083304a2cb838019c8b8c3720a7abb9c4cb81ac7a24230cea",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.4.0/rules_python-0.4.0.tar.gz",
)
# Buildifier
# buildifier is written in Go and hence needs rules_go to be built.
# See https://github.com/bazelbuild/rules_go for the up to date setup instructions.
http_archive(
name = "io_bazel_rules_go",
sha256 = "d1ffd055969c8f8d431e2d439813e42326961d0942bdf734d2c95dc30c369566",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.5/rules_go-v0.24.5.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.24.5/rules_go-v0.24.5.tar.gz",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains()
http_archive(
name = "bazel_gazelle",
sha256 = "b85f48fa105c4403326e9525ad2b2cc437babaa6e15a3fc0b1dbab0ab064bc7c",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.2/bazel-gazelle-v0.22.2.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.2/bazel-gazelle-v0.22.2.tar.gz",
],
)
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
gazelle_dependencies(go_repository_default_config = "@//:WORKSPACE.bazel")
http_archive(
name = "com_google_protobuf",
strip_prefix = "protobuf-22.5",
urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v22.5/protobuf-22.5.tar.gz"],
)
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
protobuf_deps()
http_archive(
name = "com_github_bazelbuild_buildtools",
strip_prefix = "buildtools-master",
url = "https://github.com/bazelbuild/buildtools/archive/master.zip",
)
# End of Buildifier
# Abseil C++ Libraries
http_archive(
name = "com_google_absl", # 2021-05-20T02:59:16Z
sha256 = "aeba534f7307e36fe084b452299e49b97420667a8d28102cf9a0daeed340b859",
strip_prefix = "abseil-cpp-7971fb358ae376e016d2d4fc9327aad95659b25e",
urls = ["https://github.com/abseil/abseil-cpp/archive/7971fb358ae376e016d2d4fc9327aad95659b25e.zip"],
)
# Google Test
http_archive(
name = "com_google_googletest", # 2021-05-19T20:10:13Z
sha256 = "8cf4eaab3a13b27a95b7e74c58fb4c0788ad94d1f7ec65b20665c4caf1d245e8",
strip_prefix = "googletest-aa9b44a18678dfdf57089a5ac22c1edb69f35da5",
urls = ["https://github.com/google/googletest/archive/aa9b44a18678dfdf57089a5ac22c1edb69f35da5.zip"],
)
# Google GFlags
# Needed because GLog depends on this.
#
# NOTE(malte): do *not* change the name of this dependency; GLog's build
# infrastructure depends on it being "com_github_gflags_gflags"
http_archive(
name = "com_github_gflags_gflags",
sha256 = "34af2f15cf7367513b352bdcd2493ab14ce43692d2dcd9dfc499492966c64dcf",
strip_prefix = "gflags-2.2.2",
urls = ["https://github.com/gflags/gflags/archive/v2.2.2.tar.gz"],
)
# Google GLog
# Abseil will provide a similar logging API in the future, but for now
# we're tied to classic GLog and GFlags.
http_archive(
name = "glog",
sha256 = "f28359aeba12f30d73d9e4711ef356dc842886968112162bc73002645139c39c",
strip_prefix = "glog-0.4.0",
urls = ["https://github.com/google/glog/archive/v0.4.0.tar.gz"],
)
# Google Benchmark library for microbenchmarks
http_archive(
name = "com_github_google_benchmark", # 2021-05-20T16:59:29Z
sha256 = "a6abcbe9dec091cd570462bf712661d3944f73f964f82501456eaa5f89036b1a",
strip_prefix = "benchmark-a4bcd937b298fdc2b0c7da9961fa202a5aecd56b",
urls = ["https://github.com/google/benchmark/archive/a4bcd937b298fdc2b0c7da9961fa202a5aecd56b.zip"],
)
# C++ rules for Bazel.
http_archive(
name = "rules_cc",
sha256 = "954b7a3efc8752da957ae193a13b9133da227bdacf5ceb111f2e11264f7e8c95",
strip_prefix = "rules_cc-9e10b8a6db775b1ecd358d8ddd3dab379a2c29a5",
urls = ["https://github.com/bazelbuild/rules_cc/archive/9e10b8a6db775b1ecd358d8ddd3dab379a2c29a5.zip"],
)
# ANTLR Runtime and Parser generator from grammar files.
http_archive(
name = "rules_antlr",
sha256 = "26e6a83c665cf6c1093b628b3a749071322f0f70305d12ede30909695ed85591",
strip_prefix = "rules_antlr-0.5.0",
urls = ["https://github.com/marcohu/rules_antlr/archive/0.5.0.tar.gz"],
)
load("@rules_antlr//antlr:repositories.bzl", "rules_antlr_dependencies")
load("@rules_antlr//antlr:lang.bzl", "CPP")
rules_antlr_dependencies("4.8", CPP)
# ANTLR grammars repository (non-bazel) which includes the sqlite grammar!
new_git_repository(
name = "grammars-v4",
build_file_content = """
load("@rules_antlr//antlr:antlr4.bzl", "antlr")
# Compile the grammar with the antlrcpp generation tool
antlr(
name = "sqlgrammar",
srcs = [
"sql/sqlite/SQLiteParser.g4",
"sql/sqlite/SQLiteLexer.g4",
],
no_visitor = False,
visitor = True,
language = "Cpp",
package = "sqlparser",
)
# Expose compiled grammar as a Cpp library
cc_library(
name = "sqlparser",
srcs = [":sqlgrammar"],
linkstatic = 1,
visibility = ["//visibility:public"],
deps = [
":sqlgrammar",
"@antlr4_runtimes//:cpp",
],
copts = [
"-fno-char8_t",
],
)
""",
# Has all our annotations.
commit = "854a5f8b191b7f34539727c78fcf31a78f53c15f",
remote = "https://github.com/KinanBab/grammars-v4.git",
)
# External/foreign tools to include make projects.
http_archive(
name = "rules_foreign_cc",
sha256 = "33a5690733c5cc2ede39cb62ebf89e751f2448e27f20c8b2fbbc7d136b166804",
strip_prefix = "rules_foreign_cc-0.5.1",
url = "https://github.com/bazelbuild/rules_foreign_cc/archive/0.5.1.tar.gz",
)
load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")
rules_foreign_cc_dependencies()
# Java related tools (for planner / calcite)
RULES_JVM_EXTERNAL_TAG = "2.5"
RULES_JVM_EXTERNAL_SHA = "249e8129914be6d987ca57754516be35a14ea866c616041ff0cd32ea94d2f3a1"
http_archive(
name = "rules_jvm_external",
sha256 = RULES_JVM_EXTERNAL_SHA,
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG,
)
# Dependencies of planner.
load("@rules_jvm_external//:defs.bzl", "maven_install")
maven_install(
name = "maven",
artifacts = [
"com.google.googlejavaformat:google-java-format:1.9",
"org.apache.calcite:calcite-core:1.27.0",
"org.apache.calcite.avatica:avatica-core:1.18.0",
"org.bytedeco:javacpp:1.5.4",
"org.mariadb.jdbc:mariadb-java-client:2.5.4",
],
fetch_sources = True,
repositories = [
"https://repo.maven.apache.org/maven2/",
],
)
http_archive(
name = "rules_rust",
sha256 = "7453856d239a004c9e29cde2e45903a068446e4a69501ee7393faf08e1a30403",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_rust/releases/download/0.1.0/rules_rust-v0.1.0.tar.gz",
"https://github.com/bazelbuild/rules_rust/releases/download/0.1.0/rules_rust-v0.1.0.tar.gz",
],
)
load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains", "rust_repository_set")
rules_rust_dependencies()
# Default rust toolchain.
rust_register_toolchains(
edition = "2018",
include_rustc_srcs = True,
version = "1.58.0",
)
# define a nightly toolchain that is only used for asan/tsan.
rust_repository_set(
name = "rust_nightly",
edition = "2018",
exec_triple = "x86_64-unknown-linux-gnu",
iso_date = "2022-01-13",
version = "nightly",
)
load("@rules_rust//bindgen:repositories.bzl", "rust_bindgen_repositories")
rust_bindgen_repositories()
load("//k9db/proxy/cargo:crates.bzl", "raze_fetch_remote_crates")
raze_fetch_remote_crates()
# TCMalloc dependencies: Fuzzing
# Need to install python3-distutils or python3-dev
# Also: sudo ln -s /usr/bin/python3 /usr/bin/python
http_archive(
name = "rules_fuzzing",
sha256 = "a5734cb42b1b69395c57e0bbd32ade394d5c3d6afbfe782b24816a96da24660d",
strip_prefix = "rules_fuzzing-0.1.1",
urls = ["https://github.com/bazelbuild/rules_fuzzing/archive/v0.1.1.zip"],
)
load("@rules_fuzzing//fuzzing:repositories.bzl", "rules_fuzzing_dependencies")
rules_fuzzing_dependencies()
load("@rules_fuzzing//fuzzing:init.bzl", "rules_fuzzing_init")
rules_fuzzing_init()
# TCMalloc
git_repository(
name = "com_google_tcmalloc",
commit = "45c59ccbc062ac96d83710205033c656e490d376",
remote = "https://github.com/google/tcmalloc.git",
)
# RocksDB.
new_git_repository(
name = "rocksdb",
build_file_content = """
load("@rules_cc//cc:defs.bzl", "cc_library")
load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake")
filegroup(
name = "all_srcs",
srcs = glob(["**"]),
visibility = ["//visibility:public"],
)
cmake(
name = "rocksdb",
generate_args = [
"-DUSE_RTTI=ON",
"-DROCKSDB_BUILD_SHARED=ON",
"-DWITH_GFLAGS=OFF",
"-DWITH_BZ2=1",
"-DWITH_ZLIB=1",
"-DWITH_SNAPPY=1",
"-DCMAKE_BUILD_TYPE=Release",
"-DCMAKE_POSITION_INDEPENDENT_CODE=ON",
],
build_args = [
"--", # pass following args through to `make`
"-j 8",
],
cache_entries = {
"CMAKE_C_FLAGS": "-fPIC",
"CMAKE_CXX_FLAGS": "-fPIC",
},
lib_source = ":all_srcs",
out_shared_libs = ["librocksdb.so.7"],
out_static_libs = [],
deps = [],
visibility = ["//visibility:public"],
)
genrule(
name = "rocksdb_so_gen",
srcs = [
":rocksdb",
],
outs = [
"librocksdb.so",
],
cmd = \"\"\"
locs=($(execpaths :rocksdb))
cp "$${locs[0]}/lib/librocksdb.so" $@
\"\"\",
)
cc_library(
name = "rocksdb_so",
srcs = [
":rocksdb_so_gen",
],
visibility = ["//visibility:public"],
)
""",
commit = "eb9a80fe1f18017b4d7f4084e8f2554f12234822",
remote = "https://github.com/facebook/rocksdb.git",
)
# libsodium.
http_archive(
name = "libsodium",
build_file_content = """
load("@rules_foreign_cc//foreign_cc:defs.bzl", "configure_make")
filegroup(
name = "all_srcs",
srcs = glob(["**"]),
visibility = ["//visibility:public"]
)
configure_make(
name = "libsodium",
lib_source = ":all_srcs",
out_lib_dir = "lib",
visibility = ["//visibility:public"],
)
""",
strip_prefix = "libsodium-1.0.18-RELEASE",
type = "zip",
url = "https://github.com/jedisct1/libsodium/archive/1.0.18-RELEASE.zip",
)