From db0450c0097dcf573cebf143cf01faae74a3eeed Mon Sep 17 00:00:00 2001 From: Tom Hunze Date: Sun, 9 Nov 2025 16:03:34 +0100 Subject: [PATCH] clickhouse: reduce src tarball size --- pkgs/by-name/cl/clickhouse/generic.nix | 37 +++++++++++++++++++++----- pkgs/by-name/cl/clickhouse/lts.nix | 2 +- pkgs/by-name/cl/clickhouse/package.nix | 2 +- 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/cl/clickhouse/generic.nix b/pkgs/by-name/cl/clickhouse/generic.nix index 6399e1fecb17..72129d8a2b9b 100644 --- a/pkgs/by-name/cl/clickhouse/generic.nix +++ b/pkgs/by-name/cl/clickhouse/generic.nix @@ -45,17 +45,39 @@ llvmStdenv.mkDerivation (finalAttrs: { name = "clickhouse-${tag}.tar.gz"; inherit hash; postFetch = '' - # delete files that make the source too big - rm -rf $out/contrib/llvm-project/llvm/test - rm -rf $out/contrib/llvm-project/clang/test - rm -rf $out/contrib/croaring/benchmarks + # Delete files that make the source too big + rm -rf $out/contrib/arrow/docs/ + rm -rf $out/contrib/arrow/testing/ + rm -rf $out/contrib/aws/generated/protocol-tests/ + rm -rf $out/contrib/aws/generated/smoke-tests/ + rm -rf $out/contrib/aws/generated/tests/ + rm -rf $out/contrib/aws/tools/ + rm -rf $out/contrib/cld2/internal/test_shuffle_1000_48_666.utf8.gz + rm -rf $out/contrib/croaring/benchmarks/ + rm -rf $out/contrib/boost/doc/ + rm -rf $out/contrib/boost/libs/*/bench/ + rm -rf $out/contrib/boost/libs/*/example/ + rm -rf $out/contrib/boost/libs/*/doc/ + rm -rf $out/contrib/boost/libs/*/test/ + rm -rf $out/contrib/google-cloud-cpp/ci/abi-dumps/ + rm -rf $out/contrib/icu/icu4c/source/test/ + rm -rf $out/contrib/icu/icu4j/main/core/src/test/ + rm -rf $out/contrib/icu/icu4j/perf-tests/ + rm -rf $out/contrib/llvm-project/*/docs/ + rm -rf $out/contrib/llvm-project/*/test/ + rm -rf $out/contrib/llvm-project/*/unittests/ + rm -rf $out/contrib/postgres/doc/ + + # As long as we're not running tests, remove test files + rm -rf $out/tests/ # fix case insensitivity on macos https://github.com/NixOS/nixpkgs/issues/39308 rm -rf $out/contrib/sysroot/linux-* rm -rf $out/contrib/liburing/man - # compress to not exceed the 2GB output limit - # try to make a deterministic tarball + # Compress to not exceed the 2GB output limit + echo "Creating deterministic source tarball..." + tar -I 'gzip -n' \ --sort=name \ --mtime=1970-01-01 \ @@ -63,6 +85,9 @@ llvmStdenv.mkDerivation (finalAttrs: { --numeric-owner --mode=go=rX,u+rw,a-s \ --transform='s@^@source/@S' \ -cf temp -C "$out" . + + echo "Finished creating deterministic source tarball!" + rm -r "$out" mv temp "$out" ''; diff --git a/pkgs/by-name/cl/clickhouse/lts.nix b/pkgs/by-name/cl/clickhouse/lts.nix index e7818bfc885d..10e9f2370019 100644 --- a/pkgs/by-name/cl/clickhouse/lts.nix +++ b/pkgs/by-name/cl/clickhouse/lts.nix @@ -1,6 +1,6 @@ import ./generic.nix { version = "25.8.11.66-lts"; rev = "fa393206741c830da77b8f1bcf18c753161932c8"; - hash = "sha256-VUdT5STQqcWevYJjtuLdTeDGZHNl3JkkDSgcckjSZbw="; + hash = "sha256-LBAGiYLyo535j2FYTVbcfq20d9VisGXZMPbTpONBpQU="; lts = true; } diff --git a/pkgs/by-name/cl/clickhouse/package.nix b/pkgs/by-name/cl/clickhouse/package.nix index c787f82df7aa..f05430a6ee4b 100644 --- a/pkgs/by-name/cl/clickhouse/package.nix +++ b/pkgs/by-name/cl/clickhouse/package.nix @@ -1,6 +1,6 @@ import ./generic.nix { version = "25.10.1.3832-stable"; rev = "f95c1af632a1c4fb9c69a501d05ae04a393b8f81"; - hash = "sha256-UqdwZRJWMo2KTlZ1W3MnbXg1EhK/ifjQRciPcWiFYTk="; + hash = "sha256-00QqO7fVEg7vGtM/+69CEPfNKTm+P2uteoHKKVYwpoY="; lts = false; }