This commit migrates ClickHouse to Vectorscan. The first 10 min of
[0] explain the reasons for it.
(*) Addresses (but does not resolve) #38046
(*) Config parameter names (e.g. "max_hyperscan_regexp_length") are
preserved for compatibility. Likewise, error codes (e.g.
"ErrorCodes::HYPERSCAN_CANNOT_SCAN_TEXT") and function/class names (e.g.
"HyperscanDeleter") are preserved as vectorscan aims to be a drop-in
replacement.
[0] https://www.youtube.com/watch?v=KlZWmmflW6M
- list-licenses.sh assumed GNU versions (e.g. the "-printf" flag of
find) but Mac ships with a non-GNU version
- this led to error
[8677/8942] Generating StorageSystemLicenses.generated.cpp
find: -printf: unknown primary or operator
find: -printf: unknown primary or operator
find: -printf: unknown primary or operator
find: -printf: unknown primary or operator
during build and as a result, an empty system.licenses table
- As a fix, force the GNU versions of find and grep on Mac
E.g.
utils/self-extracting-executable/compressor.cpp:257:31: format specifies type 'ptrdiff_t' (aka 'long') but the argument has type 'off_t' (aka 'long long') [-Werror,-Wformat]
printf("Size: %td\n", info_in.st_size);
~~~ ^~~~~~~~~~~~~~~
%lld
Not sure though if it's a hard requirement to use only C.
Avoided usage of fmt::format() to keep link dependencies to a minimum.
Also not using C++20 std::format() as it's only available in Clang >=14.
cmake/target.cmake defines macros for the supported platforms, this
commit changes predefined system macros to our own macros.
__linux__ --> OS_LINUX
__APPLE__ --> OS_DARWIN
__FreeBSD__ --> OS_FREEBSD