Skip to content

Commit 131f636

Browse files
committed
Opt into openssl usage and use existing abseil dependency
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
1 parent bf7ccd3 commit 131f636

5 files changed

Lines changed: 44 additions & 11 deletions

File tree

bazel/external/clickhouse_cpp.BUILD

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ cmake(
3737
"BUILD_TESTS": "OFF",
3838
"BUILD_SHARED_LIBS": "OFF",
3939
"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
40+
"WITH_OPENSSL": "ON",
41+
"WITH_SYSTEM_ABSEIL": "ON",
42+
"WITH_SYSTEM_LZ4": "OFF",
43+
"WITH_SYSTEM_CITYHASH": "OFF",
44+
"WITH_SYSTEM_ZSTD": "OFF",
4545
"CMAKE_POSITION_INDEPENDENT_CODE": "ON",
4646
},
4747
lib_source = ":all",
@@ -50,15 +50,18 @@ cmake(
5050
"liblz4.a",
5151
"libcityhash.a",
5252
"libzstdstatic.a",
53-
"libabsl_int128.a",
5453
],
5554
targets = [
5655
"clickhouse-cpp-lib",
5756
"lz4",
5857
"cityhash",
5958
"zstdstatic",
60-
"absl_int128",
6159
],
6260
visibility = ["//visibility:public"],
6361
working_directory = "",
64-
)
62+
deps = [
63+
"@boringssl//:crypto",
64+
"@boringssl//:ssl",
65+
"@com_google_absl//absl/numeric:int128",
66+
],
67+
)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
diff --git a/cmake/openssl.cmake b/cmake/openssl.cmake
2+
--- a/cmake/openssl.cmake
3+
+++ b/cmake/openssl.cmake
4+
@@ -3,4 +3,10 @@
5+
IF (WITH_OPENSSL)
6+
- FIND_PACKAGE (OpenSSL REQUIRED)
7+
- ADD_COMPILE_DEFINITIONS (WITH_OPENSSL=1)
8+
+ ADD_LIBRARY (OpenSSL::Crypto INTERFACE IMPORTED GLOBAL)
9+
+ SET_TARGET_PROPERTIES (OpenSSL::Crypto PROPERTIES
10+
+ INTERFACE_INCLUDE_DIRECTORIES "$ENV{EXT_BUILD_ROOT}/external/boringssl/src/include")
11+
+ ADD_LIBRARY (OpenSSL::SSL INTERFACE IMPORTED GLOBAL)
12+
+ SET_TARGET_PROPERTIES (OpenSSL::SSL PROPERTIES
13+
+ INTERFACE_INCLUDE_DIRECTORIES "$ENV{EXT_BUILD_ROOT}/external/boringssl/src/include"
14+
+ INTERFACE_LINK_LIBRARIES OpenSSL::Crypto)
15+
+ ADD_COMPILE_DEFINITIONS (WITH_OPENSSL=1 USE_BORINGSSL)
16+
ENDIF ()
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
--- a/CMakeLists.txt
3+
+++ b/CMakeLists.txt
4+
@@ -81,6 +81,9 @@
5+
IF (WITH_SYSTEM_ABSEIL)
6+
- FIND_PACKAGE(absl REQUIRED)
7+
+ ADD_LIBRARY (absl::int128 STATIC IMPORTED)
8+
+ SET_TARGET_PROPERTIES (absl::int128 PROPERTIES
9+
+ IMPORTED_LOCATION "$ENV{EXT_BUILD_DEPS}/lib/libint128.a"
10+
+ INTERFACE_INCLUDE_DIRECTORIES "$ENV{EXT_BUILD_ROOT}/external/com_google_absl")
11+
ELSE ()
12+
INCLUDE_DIRECTORIES (contrib/absl)
13+
SUBDIRS (contrib/absl/absl)
14+
ENDIF ()

bazel/repositories.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +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")
156+
_bazel_repo("com_github_clickhouse_clickhouse_cpp", build_file = "//bazel/external:clickhouse_cpp.BUILD", patches = ["//bazel/external:clickhouse_cpp_system_abseil.patch", "//bazel/external:clickhouse_cpp_boringssl.patch"], patch_args = ["-p1"])
157157
_bazel_repo("com_github_cyan4973_xxhash", build_file = "//bazel/external:xxhash.BUILD")
158158
_bazel_repo("com_github_nlohmann_json", build_file = "//bazel/external:nlohmann_json.BUILD")
159159
_bazel_repo("com_github_packetzero_dnsparser", build_file = "//bazel/external:dnsparser.BUILD")

bazel/repository_locations.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ REPOSITORY_LOCATIONS = dict(
7777
urls = ["https://github.com/cameron314/concurrentqueue/archive/refs/tags/v1.0.3.tar.gz"],
7878
),
7979
com_github_clickhouse_clickhouse_cpp = dict(
80-
sha256 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
81-
strip_prefix = "clickhouse-cpp-001025cd72d904104c15657e85e0fb6b0ec58e14",
80+
sha256 = "bac497857759e991fa4e1638bccf936cb36d10ad79273695a570272cc4891428",
81+
strip_prefix = "clickhouse-cpp-2.6.2",
8282
urls = ["https://github.com/ClickHouse/clickhouse-cpp/archive/refs/tags/v2.6.2.tar.gz"],
8383
),
8484
com_github_cyan4973_xxhash = dict(

0 commit comments

Comments
 (0)