The clickhouse program links to LLVM and to the clickhouse library, that also
links to LLVM. When the library is shared but LLVM is static, LLVM gets linked
into the program twice (once via the library and once directly), which causes
this error when running clickhouse:
: CommandLine Error: Option 'x86-use-base-pointer' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options
A common LLVM installation provides static component libraries and a shared
libLLVM. Linking to libLLVM when libclickhouse is shared solves this issue.
Upstream pull request: https://github.com/yandex/ClickHouse/pull/3989
Although the package itself builds fine, the module fails because it
tries to log into a non-existant file in `/var/log` which breaks the
service. Patching to default config to log to stdout by default fixes
the issue. Additionally this is the better solution as NixOS heavily
relies on systemd (and thus journald) for logging.
Also, the runtime relies on `/etc/localtime` to start, as it's not
required by the module system we set UTC as sensitive default when using
the module.
To ensure that the service's basic functionality is available, a simple
NixOS test has been added.