summary refs log tree commit diff
diff options
context:
space:
mode:
authorNiklas Hambüchen <mail@nh2.me>2023-08-08 02:01:39 +0000
committerNiklas Hambüchen <mail@nh2.me>2023-08-08 02:16:59 +0000
commitf8262c2cc6d20efd062d0b2b53db168ced639454 (patch)
tree8608e36a7d696d89f33b929f31d9722a71655b78
parent5a8e9243812ba528000995b294292d3b5e120947 (diff)
downloadnixpkgs-f8262c2cc6d20efd062d0b2b53db168ced639454.tar
nixpkgs-f8262c2cc6d20efd062d0b2b53db168ced639454.tar.gz
nixpkgs-f8262c2cc6d20efd062d0b2b53db168ced639454.tar.bz2
nixpkgs-f8262c2cc6d20efd062d0b2b53db168ced639454.tar.lz
nixpkgs-f8262c2cc6d20efd062d0b2b53db168ced639454.tar.xz
nixpkgs-f8262c2cc6d20efd062d0b2b53db168ced639454.tar.zst
nixpkgs-f8262c2cc6d20efd062d0b2b53db168ced639454.zip
ceph: 17.2.5 -> 18.2.0
The following issues were encountered during the upgrade:

* "Could NOT find thrift (missing: thrift_LIBRARIES thrift_INCLUDE_DIR)"
  Fixed by disabling Jaeger support, see added comment.
* ```
  /build/ceph-18.2.0/src/extblkdev/ExtBlkDevInterface.h:38:10: fatal error: sys/capability.h: No such file or directory
    38 | #include <sys/capability.h>
  ```
  Fixed by `libcap` dependency.
  Ceph's Debian dependencies include both `libcap` and `libcap-ng`:
  https://github.com/ceph/ceph/blob/c8c946c970300d37c345af9fc6b25abb003e00b5/debian/control#L38-L39
* ```
  Manually-specified variables were not used by the project:
    MGR_PYTHON_VERSION
  ```
  Dropped 4 years ago for Ceph 15:
  https://github.com/ceph/ceph/commit/5fc657b40dc7d27e84d4b62b5f37d9c771d74fcd
  So I removed the flag.
* Warning:
  ```
  -- Could NOT find nasm
  ```
  Looking at the code (macros such as `HAVE_NASM_X64`), nasm existence actually results in some optimised crypto SIMD instructions being compiled, so we probably want this for performance.
  Adding `nasm` to `nativeBuildInputs` first brought error:
  ```
  /nix/store/p6dlr3skfhxpyphipg2bqnj52999banh-bash-5.2-p15/bin/bash: line 1: /build/ceph-18.2.0/src/nasm-wrapper: cannot execute: required file not found
  make[2]: *** [src/crypto/isa-l/CMakeFiles/ceph_crypto_isal.dir/build.make:117: src/crypto/isa-l/CMakeFiles/ceph_crypto_isal.dir/isa-l_crypto/aes/cbc_multibinary.asm.o] Error 127
  ```
  Solution: `patchShebangs src/nasm-wrapper`, even better `patchShebangs src/`.
* ```
  Manually-specified variables were not used by the project:
    WITH_SYSTEM_CIMG
    WITH_SYSTEM_JSONCPP
  ```
  These never were Ceph CMake options, so I removed them.
* `libcap-ng` is Linux-only, and only used for the `mount.ceph` command:
  https://github.com/ceph/ceph/blob/c8c946c970300d37c345af9fc6b25abb003e00b5/src/CMakeLists.txt#L829-L830
  Thus use it for Linux only.
* The Parquet build error is now gone, so we can enable support for it.
-rw-r--r--pkgs/tools/filesystems/ceph/default.nix42
1 files changed, 28 insertions, 14 deletions
diff --git a/pkgs/tools/filesystems/ceph/default.nix b/pkgs/tools/filesystems/ceph/default.nix
index 1b0c9c98633..5247862fc20 100644
--- a/pkgs/tools/filesystems/ceph/default.nix
+++ b/pkgs/tools/filesystems/ceph/default.nix
@@ -11,6 +11,7 @@
 , fmt
 , git
 , makeWrapper
+, nasm
 , pkg-config
 , which
 
@@ -23,14 +24,13 @@
 , boost179
 , bzip2
 , cryptsetup
-, cimg
 , cunit
 , doxygen
 , gperf
 , graphviz
 , gtest
 , icu
-, jsoncpp
+, libcap
 , libcap_ng
 , libnl
 , libxml2
@@ -225,10 +225,10 @@ let
   ]);
   inherit (ceph-python-env.python) sitePackages;
 
-  version = "17.2.5";
+  version = "18.2.0";
   src = fetchurl {
     url = "https://download.ceph.com/tarballs/ceph-${version}.tar.gz";
-    hash = "sha256-NiJpwUeROvh0siSaRoRrDm+C0s61CvRiIrbd7JmRspo=";
+    hash = "sha256:0k9nl6xi5brva51rr14m7ig27mmmd7vrpchcmqc40q3c2khn6ns9";
   };
 in rec {
   ceph = stdenv.mkDerivation {
@@ -240,6 +240,7 @@ in rec {
       fmt
       git
       makeWrapper
+      nasm
       pkg-config
       python
       python.pkgs.python # for the toPythonPath function
@@ -259,14 +260,12 @@ in rec {
       boost
       bzip2
       ceph-python-env
-      cimg
       cryptsetup
       cunit
       gperf
       gtest
-      jsoncpp
       icu
-      libcap_ng
+      libcap
       libnl
       libxml2
       lttng-ust
@@ -287,6 +286,7 @@ in rec {
       zstd
     ] ++ lib.optionals stdenv.isLinux [
       keyutils
+      libcap_ng
       liburing
       libuuid
       linuxHeaders
@@ -314,22 +314,38 @@ in rec {
       # install target needs to be in PYTHONPATH for "*.pth support" check to succeed
       # set PYTHONPATH, so the build system doesn't silently skip installing ceph-volume and others
       export PYTHONPATH=${ceph-python-env}/${sitePackages}:$lib/${sitePackages}:$out/${sitePackages}
-      patchShebangs src/script src/spdk src/test src/tools
+      patchShebangs src/
     '';
 
     cmakeFlags = [
       "-DCMAKE_INSTALL_DATADIR=${placeholder "lib"}/lib"
 
-      "-DMGR_PYTHON_VERSION=${ceph-python-env.python.pythonVersion}"
       "-DWITH_CEPHFS_SHELL:BOOL=ON"
       "-DWITH_SYSTEMD:BOOL=OFF"
+      # `WITH_JAEGER` requires `thrift` as a depenedncy (fine), but the build fails with:
+      #     CMake Error at src/opentelemetry-cpp-stamp/opentelemetry-cpp-build-Release.cmake:49 (message):
+      #     Command failed: 2
+      #
+      #        'make' 'opentelemetry_trace' 'opentelemetry_exporter_jaeger_trace'
+      #
+      #     See also
+      #
+      #        /build/ceph-18.2.0/build/src/opentelemetry-cpp/src/opentelemetry-cpp-stamp/opentelemetry-cpp-build-*.log
+      # and that file contains:
+      #     /build/ceph-18.2.0/src/jaegertracing/opentelemetry-cpp/exporters/jaeger/src/TUDPTransport.cc: In member function 'virtual void opentelemetry::v1::exporter::jaeger::TUDPTransport::close()':
+      #     /build/ceph-18.2.0/src/jaegertracing/opentelemetry-cpp/exporters/jaeger/src/TUDPTransport.cc:71:7: error: '::close' has not been declared; did you mean 'pclose'?
+      #       71 |     ::THRIFT_CLOSESOCKET(socket_);
+      #          |       ^~~~~~~~~~~~~~~~~~
+      # Looks like `close()` is somehow not included.
+      # But the relevant code is already removed in `open-telemetry` 1.10: https://github.com/open-telemetry/opentelemetry-cpp/pull/2031
+      # So it's proably not worth trying to fix that for this Ceph version,
+      # and instead just disable Ceph's Jaeger support.
+      "-DWITH_JAEGER:BOOL=OFF"
       "-DWITH_TESTS:BOOL=OFF"
 
       # Use our own libraries, where possible
-      "-DWITH_SYSTEM_ARROW:BOOL=ON"
+      "-DWITH_SYSTEM_ARROW:BOOL=ON" # Only used if other options enable Arrow support.
       "-DWITH_SYSTEM_BOOST:BOOL=ON"
-      "-DWITH_SYSTEM_CIMG:BOOL=ON"
-      "-DWITH_SYSTEM_JSONCPP:BOOL=ON"
       "-DWITH_SYSTEM_GTEST:BOOL=ON"
       "-DWITH_SYSTEM_ROCKSDB:BOOL=ON"
       "-DWITH_SYSTEM_UTF8PROC:BOOL=ON"
@@ -337,8 +353,6 @@ in rec {
 
       # TODO breaks with sandbox, tries to download stuff with npm
       "-DWITH_MGR_DASHBOARD_FRONTEND:BOOL=OFF"
-      # no matching function for call to 'parquet::PageReader::Open(std::shared_ptr<arrow::io::InputStream>&, int64_t, arrow::Compression::type, parquet::MemoryPool*, parquet::CryptoContext*)'
-      "-DWITH_RADOSGW_SELECT_PARQUET:BOOL=OFF"
       # WITH_XFS has been set default ON from Ceph 16, keeping it optional in nixpkgs for now
       ''-DWITH_XFS=${if optLibxfs != null then "ON" else "OFF"}''
     ] ++ lib.optional stdenv.isLinux "-DWITH_SYSTEM_LIBURING=ON";