Use BCR cityhash module#522
Open
BYVoid wants to merge 2 commits into
Open
Conversation
…yhash # Conflicts: # BUILD.bazel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cityhash@1.0.2.bcr.1module dependency@cityhash//:cityhash1.0.2.bcr.1now packages the frozen CityHash 1.0.2 source with thessize_tcompatibility patchWhy this can replace the Bazel part of #515
#515 fixes the Bazel-local
:cityhashtarget under the assumption that Bazel keeps compilingcontrib/cityhash. In that setup, the vendoredcity.ccincluded a genericconfig.h, so #515 renamed the checked-in header tocity_config.h, prefixed its macros, and updated the local Bazelsrcslist.This PR removes that Bazel-local target entirely. Bazel no longer compiles
contrib/cityhash; it consumes CityHash through the BCR module instead. That makes the Bazel-specific part of #515 unnecessary: there is no local:cityhashrule, no localcity_config.hentry to maintain, and no local Windows/DWIN32workaround for CityHash. The CMake/vendor-side cleanup from #515 can still be useful for the checked-in contrib copy, but Bazel no longer needs to own or patch that copy.In short: #515 makes the vendored Bazel CityHash target safer; this PR stops vendoring CityHash in Bazel. The latter is a smaller maintenance surface for Bazel.
Why
cityhash@1.0.2.bcr.1matches the local contrib versionThe local
contrib/cityhashcopy is based on upstreamgoogle/cityhash@bc38ef45ddbbe640e48db7b8ef65e80ea7f71298, i.e. CityHash 1.0.2. Later local changes were compatibility/build-system edits, not intentional hash algorithm changes.The BCR
cityhash@1.0.2.bcr.1module points to that same upstream commit and applies the same relevant compatibility fix forssize_t(remove_ssize_t.patch). That patch matches the localc02157e-style fix and preserves the CityHash64/CityHash128 behavior.I also verified this locally by comparing outputs from patched BCR CityHash and the checked-in contrib CityHash for multiple input lengths across:
CityHash64CityHash64WithSeedCityHash128The outputs were identical, and the server-dependent e2e tests with compressed roundtrips passed against a local ClickHouse server.
Testing
bazel --ignore_all_rc_files test @cityhash//:all --registry=https://bcr.bazel.buildbazel --ignore_all_rc_files test //... --registry=https://bcr.bazel.buildbazel --ignore_all_rc_files test //ut:e2e_tests --test_output=errors --cache_test_results=no --registry=https://bcr.bazel.buildAlso tested earlier with
--//:tls=noand--//:tls=opensslvariants while validating the cityhash swap.