Skip to content

Commit bf7ccd3

Browse files
committed
Add clickhouse_cpp bazel repository
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
1 parent 77e8d9e commit bf7ccd3

3 files changed

Lines changed: 70 additions & 0 deletions

File tree

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Copyright 2018- The Pixie Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
17+
load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake")
18+
19+
licenses(["notice"])
20+
21+
exports_files(["LICENSE"])
22+
23+
filegroup(
24+
name = "all",
25+
srcs = glob(["**"]),
26+
)
27+
28+
cmake(
29+
name = "clickhouse_cpp",
30+
build_args = [
31+
"--", # <- Pass remaining options to the native tool.
32+
"-j`nproc`",
33+
"-l`nproc`",
34+
],
35+
cache_entries = {
36+
"BUILD_BENCHMARK": "OFF",
37+
"BUILD_TESTS": "OFF",
38+
"BUILD_SHARED_LIBS": "OFF",
39+
"CMAKE_BUILD_TYPE": "Release",
40+
"WITH_OPENSSL": "OFF", # Disable OpenSSL for now
41+
"WITH_SYSTEM_ABSEIL": "OFF", # Use bundled abseil
42+
"WITH_SYSTEM_LZ4": "OFF", # Use bundled for now
43+
"WITH_SYSTEM_CITYHASH": "OFF", # Use bundled for now
44+
"WITH_SYSTEM_ZSTD": "OFF", # Use bundled for now
45+
"CMAKE_POSITION_INDEPENDENT_CODE": "ON",
46+
},
47+
lib_source = ":all",
48+
out_static_libs = [
49+
"libclickhouse-cpp-lib.a",
50+
"liblz4.a",
51+
"libcityhash.a",
52+
"libzstdstatic.a",
53+
"libabsl_int128.a",
54+
],
55+
targets = [
56+
"clickhouse-cpp-lib",
57+
"lz4",
58+
"cityhash",
59+
"zstdstatic",
60+
"absl_int128",
61+
],
62+
visibility = ["//visibility:public"],
63+
working_directory = "",
64+
)

bazel/repositories.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ def _cc_deps():
153153
_bazel_repo("com_github_ariafallah_csv_parser", build_file = "//bazel/external:csv_parser.BUILD")
154154
_bazel_repo("com_github_arun11299_cpp_jwt", build_file = "//bazel/external:cpp_jwt.BUILD")
155155
_bazel_repo("com_github_cameron314_concurrentqueue", build_file = "//bazel/external:concurrentqueue.BUILD")
156+
_bazel_repo("com_github_clickhouse_clickhouse_cpp", build_file = "//bazel/external:clickhouse_cpp.BUILD")
156157
_bazel_repo("com_github_cyan4973_xxhash", build_file = "//bazel/external:xxhash.BUILD")
157158
_bazel_repo("com_github_nlohmann_json", build_file = "//bazel/external:nlohmann_json.BUILD")
158159
_bazel_repo("com_github_packetzero_dnsparser", build_file = "//bazel/external:dnsparser.BUILD")

bazel/repository_locations.bzl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ REPOSITORY_LOCATIONS = dict(
7676
strip_prefix = "concurrentqueue-1.0.3",
7777
urls = ["https://github.com/cameron314/concurrentqueue/archive/refs/tags/v1.0.3.tar.gz"],
7878
),
79+
com_github_clickhouse_clickhouse_cpp = dict(
80+
sha256 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
81+
strip_prefix = "clickhouse-cpp-001025cd72d904104c15657e85e0fb6b0ec58e14",
82+
urls = ["https://github.com/ClickHouse/clickhouse-cpp/archive/refs/tags/v2.6.2.tar.gz"],
83+
),
7984
com_github_cyan4973_xxhash = dict(
8085
sha256 = "952ebbf5b11fbf59ae5d760a562d1e9112278f244340ad7714e8556cbe54f7f7",
8186
strip_prefix = "xxHash-0.7.3",

0 commit comments

Comments
 (0)