-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix system cityhash setup #301
Conversation
Thank you for a contribution! Quick question: how do you test this setup? It looks like |
Homebrew does provide the # `cityhash` does not provide a pkg-config or CMake config file.
# Help CMake find it.
inreplace "CMakeLists.txt", "FIND_PACKAGE(cityhash REQUIRED)",
"FIND_LIBRARY(CITYHASH NAMES cityhash REQUIRED)"
inreplace "clickhouse/CMakeLists.txt", "cityhash::cityhash", "cityhash" With this, the build passed on both macOS and Linux. I suggest trying the following in a
|
Nice! Could you please add a workflow that verifies such setup? That would be a more solid guarantee that it doesn't break in the future :) |
7df7df6
to
fefc0ee
Compare
Sure, I've pushed 45edfc1 and fefc0ee. I also adjusted the patch to avoid additional However, when testing this on my fork, some of the tests failed. Specifically, these on Linux, and these on macOS. The failing tests reported According to cityhash's changelog, cityhash v1.1 did "Change existing functions to improve their hash quality and/or speed". Does this raise a concern? |
Breaking a hash compatibility with CH server is a big "no-no", perhaps you can choose another version from homebrew to install? |
Understood. In that case, I think we'll have to use the vendored cityhash because Homebrew does not support installing a specific version of a formula (package). I opened Homebrew/homebrew-core#129222 to fix this in Homebrew's And as for this PR, let me see what I can do here. Some of the failures seem unrelated -- are they transient SSL issues? |
SSL errors seem to be unrelated, maybe just some network issues, but rest are pretty suspicious, especially: Windows MSVChttps://github.com/ClickHouse/clickhouse-cpp/actions/runs/4772342534/jobs/8517401004?pr=301 MacOShttps://github.com/ClickHouse/clickhouse-cpp/actions/runs/4772342519/jobs/8517401026?pr=301 https://github.com/ClickHouse/clickhouse-cpp/actions/runs/4772342519/jobs/8517401280?pr=301 |
Use the vendored version (1.0.2) of `cityhash` because newer versions break hash compatibility. See: ClickHouse/clickhouse-cpp#301 (comment)
OK, I think I'll need to roll back the workflow changes because I don't know any system that ships this very version of cityhash (v1.0.2). (The fact that the clickhouse library was built should suggest that the changes are fine, though.) As for the other failures, I am very confused because I haven't touched the Windows / MinGW workflows at all. Anyway, I've tried to keep only the CMake changes in another testing branch; the tests should work fine. |
fefc0ee
to
b99d338
Compare
clickhouse/CMakeLists.txt
Outdated
@@ -38,12 +38,18 @@ IF (WITH_OPENSSL) | |||
LIST(APPEND clickhouse-cpp-lib-src base/sslsocket.cpp) | |||
ENDIF () | |||
|
|||
IF (WITH_SYSTEM_CITYHASH AND NOT cityhash_FOUND) | |||
SET (CITYHASH ${SYSTEM_CITYHASH}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we can add something similar to https://github.com/ClickHouse/clickhouse-cpp/blob/master/cmake/Findlz4.cmake to properly set a cityhash::cityhash
imported library instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's actually a good idea. I pushed a Findcityhash.cmake
and that should do it. I've verified this with a workflow in my fork: https://github.com/ZhongRuoyu/clickhouse-cpp/actions/runs/4840656304/jobs/8626442071#step:7:41. (Failure is due to a mismatched cityhash version, as discussed earlier -- but it's functional.)
cityhash does not provide any CMake packages. Add a `Findcityhash.cmake` script to help find cityhash. Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
945066a
to
bb85459
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice, thank you!
Temporary closing to re-trigger against latest master |
cityhash does not provide any CMake packages. Add a
Findcityhash.cmake
script to help find cityhash.