clickhouse: 23.11.1.2711 -> 24.3.2.23

This commit is contained in:
Maksym Balatsko 2024-04-04 13:48:58 -07:00
parent 6f139367a3
commit 6e53c551cd

View file

@ -11,6 +11,7 @@
, nixosTests , nixosTests
, darwin , darwin
, findutils , findutils
, libiconv
, rustSupport ? true , rustSupport ? true
@ -28,15 +29,15 @@ let
else llvmPackages.stdenv).mkDerivation; else llvmPackages.stdenv).mkDerivation;
in mkDerivation rec { in mkDerivation rec {
pname = "clickhouse"; pname = "clickhouse";
version = "23.11.1.2711"; version = "24.3.2.23";
src = fetchFromGitHub rec { src = fetchFromGitHub rec {
owner = "ClickHouse"; owner = "ClickHouse";
repo = "ClickHouse"; repo = "ClickHouse";
rev = "v${version}-stable"; rev = "v${version}-lts";
fetchSubmodules = true; fetchSubmodules = true;
name = "clickhouse-${rev}.tar.gz"; name = "clickhouse-${rev}.tar.gz";
hash = "sha256-xRg9NzUkjTbR2Lp6DgDzcUp2Hrc4sfgkot7KxPw2Uy8="; hash = "sha256-2OdlePEFJu4k2ysSPqa3kwsPgVRIlaU1B80LmU5w0yQ=";
postFetch = '' postFetch = ''
# delete files that make the source too big # delete files that make the source too big
rm -rf $out/contrib/llvm-project/llvm/test rm -rf $out/contrib/llvm-project/llvm/test
@ -95,6 +96,8 @@ in mkDerivation rec {
rustPlatform.cargoSetupHook rustPlatform.cargoSetupHook
]; ];
buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
# their vendored version is too old and missing this patch: https://github.com/corrosion-rs/corrosion/pull/205 # their vendored version is too old and missing this patch: https://github.com/corrosion-rs/corrosion/pull/205
corrosionSrc = if rustSupport then fetchFromGitHub { corrosionSrc = if rustSupport then fetchFromGitHub {
owner = "corrosion-rs"; owner = "corrosion-rs";
@ -112,7 +115,7 @@ in mkDerivation rec {
inherit src; inherit src;
name = "rust-deps"; name = "rust-deps";
preBuild = "cd rust"; preBuild = "cd rust";
hash = "sha256-fWDAGm19b7uZv8aBdBoieY5c6POd8IxFXbGdtONpZbw="; hash = "sha256-rbEfCRB2QAZ2WBgSLYYUqeYtI4Y5d9oQ2G8/mPirIp4=";
} else null; } else null;
dontCargoSetupPostUnpack = true; dontCargoSetupPostUnpack = true;
@ -177,10 +180,13 @@ in mkDerivation rec {
"-DENABLE_EMBEDDED_COMPILER=ON" "-DENABLE_EMBEDDED_COMPILER=ON"
]; ];
env = lib.optionalAttrs stdenv.isDarwin { env = {
# Silence ``-Wimplicit-const-int-float-conversion` error in MemoryTracker.cpp and NIX_CFLAGS_COMPILE =
# ``-Wno-unneeded-internal-declaration` TreeOptimizer.cpp. # undefined reference to '__sync_val_compare_and_swap_16'
NIX_CFLAGS_COMPILE = "-Wno-implicit-const-int-float-conversion -Wno-unneeded-internal-declaration"; lib.optionalString stdenv.isx86_64 " -mcx16" +
# Silence ``-Wimplicit-const-int-float-conversion` error in MemoryTracker.cpp and
# ``-Wno-unneeded-internal-declaration` TreeOptimizer.cpp.
lib.optionalString stdenv.isDarwin " -Wno-implicit-const-int-float-conversion -Wno-unneeded-internal-declaration";
}; };
# https://github.com/ClickHouse/ClickHouse/issues/49988 # https://github.com/ClickHouse/ClickHouse/issues/49988
@ -206,7 +212,7 @@ in mkDerivation rec {
homepage = "https://clickhouse.com"; homepage = "https://clickhouse.com";
description = "Column-oriented database management system"; description = "Column-oriented database management system";
license = licenses.asl20; license = licenses.asl20;
maintainers = with maintainers; [ orivej ]; maintainers = with maintainers; [ orivej mbalatsko ];
# not supposed to work on 32-bit https://github.com/ClickHouse/ClickHouse/pull/23959#issuecomment-835343685 # not supposed to work on 32-bit https://github.com/ClickHouse/ClickHouse/pull/23959#issuecomment-835343685
platforms = lib.filter (x: (lib.systems.elaborate x).is64bit) (platforms.linux ++ platforms.darwin); platforms = lib.filter (x: (lib.systems.elaborate x).is64bit) (platforms.linux ++ platforms.darwin);