2023-03-24 13:27:12 +00:00
{ lib
, stdenv
, runCommand
, fetchurl
, fetchFromGitHub
2023-05-25 16:03:52 +00:00
, fetchPypi
2024-08-13 02:08:58 +00:00
, fetchpatch
2023-03-24 13:27:12 +00:00
# Build time
, cmake
2018-11-06 13:35:48 +00:00
, ensureNewerSourcesHook
2023-03-24 13:27:12 +00:00
, fmt
, git
2021-02-14 17:57:50 +00:00
, makeWrapper
2023-08-08 02:01:39 +00:00
, nasm
2023-03-24 13:27:12 +00:00
, pkg-config
, which
# Tests
2021-02-14 18:01:16 +00:00
, nixosTests
2023-03-24 13:27:12 +00:00
# Runtime dependencies
, arrow-cpp
, babeltrace
, boost179
2021-04-21 08:02:36 +00:00
, bzip2
2023-03-24 13:27:12 +00:00
, cryptsetup
, cunit
2021-04-21 08:02:36 +00:00
, doxygen
2023-03-24 13:27:12 +00:00
, gperf
2021-04-21 08:02:36 +00:00
, graphviz
ceph: use absolute binary paths instead of relative paths
While trying to mount CephFS using libceph and systemd, mount.ceph tries to call "modinfo", "modprobe", and "grep", but fails with the error "sh: line 1: modprobe: command not found". This is because ceph calls these binaries by running the command "sh -c -- <application> %s %s", which does not pass the PATH environment variable through. This isn't usually a problem, because ceph, by default, calls the paths of these binaries as they would be in debian, in /sbin and /bin, but a change was made to replace these with relative paths, thus breaking the mounting process entirely. Replacing these relative paths with absolute store paths alleviates this issue whilst preserving all functionality.
2023-12-11 13:39:26 +00:00
, gnugrep
2023-03-24 13:27:12 +00:00
, gtest
, icu
ceph: use absolute binary paths instead of relative paths
While trying to mount CephFS using libceph and systemd, mount.ceph tries to call "modinfo", "modprobe", and "grep", but fails with the error "sh: line 1: modprobe: command not found". This is because ceph calls these binaries by running the command "sh -c -- <application> %s %s", which does not pass the PATH environment variable through. This isn't usually a problem, because ceph, by default, calls the paths of these binaries as they would be in debian, in /sbin and /bin, but a change was made to replace these with relative paths, thus breaking the mounting process entirely. Replacing these relative paths with absolute store paths alleviates this issue whilst preserving all functionality.
2023-12-11 13:39:26 +00:00
, kmod
2023-08-08 02:01:39 +00:00
, libcap
2023-03-24 13:27:12 +00:00
, libcap_ng
, libnl
, libxml2
, lttng-ust
, lua
, lz4
, oath-toolkit
, openldap
2024-05-03 10:43:34 +00:00
, python311
2023-03-24 13:27:12 +00:00
, rdkafka
, rocksdb
, snappy
, sqlite
, utf8proc
, zlib
, zstd
2015-11-19 13:21:07 +00:00
2024-01-19 12:56:44 +00:00
# Dependencies of overridden Python dependencies, hopefully we can remove these soon.
, rustPlatform
2018-11-06 13:35:48 +00:00
# Optional Dependencies
2023-03-24 13:27:12 +00:00
, curl ? null
, expat ? null
, fuse ? null
, libatomic_ops ? null
, libedit ? null
2018-11-06 13:35:48 +00:00
, libs3 ? null
2023-03-24 13:27:12 +00:00
, yasm ? null
2015-11-19 13:21:07 +00:00
2018-11-06 13:35:48 +00:00
# Mallocs
2023-03-24 13:27:12 +00:00
, gperftools ? null
, jemalloc ? null
2018-11-06 13:35:48 +00:00
# Crypto Dependencies
, cryptopp ? null
2023-03-24 13:27:12 +00:00
, nspr ? null
, nss ? null
2018-11-06 13:35:48 +00:00
# Linux Only Dependencies
2023-03-24 13:27:12 +00:00
, linuxHeaders
, util-linux
, libuuid
, udev
, keyutils
, rdma-core
, rabbitmq-c
, libaio ? null
, libxfs ? null
, liburing ? null
, zfs ? null
2018-11-06 13:35:48 +00:00
, . . .
} :
# We must have one crypto library
assert cryptopp != null || ( nss != null && nspr != null ) ;
let
2023-04-20 21:16:02 +00:00
shouldUsePkg = pkg : if pkg != null && lib . meta . availableOn stdenv . hostPlatform pkg then pkg else null ;
2018-11-06 13:35:48 +00:00
optYasm = shouldUsePkg yasm ;
optExpat = shouldUsePkg expat ;
optCurl = shouldUsePkg curl ;
optFuse = shouldUsePkg fuse ;
optLibedit = shouldUsePkg libedit ;
optLibatomic_ops = shouldUsePkg libatomic_ops ;
optLibs3 = shouldUsePkg libs3 ;
optJemalloc = shouldUsePkg jemalloc ;
optGperftools = shouldUsePkg gperftools ;
optCryptopp = shouldUsePkg cryptopp ;
optNss = shouldUsePkg nss ;
optNspr = shouldUsePkg nspr ;
optLibaio = shouldUsePkg libaio ;
optLibxfs = shouldUsePkg libxfs ;
optZfs = shouldUsePkg zfs ;
2023-03-24 13:27:12 +00:00
# Downgrade rocksdb, 7.10 breaks ceph
2023-07-25 14:08:41 +00:00
rocksdb' = rocksdb . overrideAttrs {
2023-03-24 13:27:12 +00:00
version = " 7 . 9 . 2 " ;
src = fetchFromGitHub {
owner = " f a c e b o o k " ;
repo = " r o c k s d b " ;
rev = " r e f s / t a g s / v 7 . 9 . 2 " ;
hash = " s h a 2 5 6 - 5 P 7 I q J 1 4 E Z z D k b j a B v b i x 0 4 c e G G d l W B u V F H / 5 d p D 5 V M = " ;
} ;
2023-07-25 14:08:41 +00:00
} ;
2018-11-06 13:35:48 +00:00
2023-03-24 13:27:12 +00:00
hasRadosgw = optExpat != null && optCurl != null && optLibedit != null ;
2018-11-06 13:35:48 +00:00
# Malloc implementation (can be jemalloc, tcmalloc or null)
malloc = if optJemalloc != null then optJemalloc else optGperftools ;
# We prefer nss over cryptopp
cryptoStr = if optNss != null && optNspr != null then " n s s " else
if optCryptopp != null then " c r y p t o p p " else " n o n e " ;
cryptoLibsMap = {
nss = [ optNss optNspr ] ;
cryptopp = [ optCryptopp ] ;
none = [ ] ;
} ;
2021-01-27 10:21:31 +00:00
getMeta = description : with lib ; {
2022-01-07 07:01:51 +00:00
homepage = " h t t p s : / / c e p h . i o / e n / " ;
2020-07-07 08:56:04 +00:00
inherit description ;
2024-04-26 11:35:31 +00:00
license = with licenses ; [ lgpl21 gpl2Only bsd3 mit publicDomain ] ;
2020-07-07 08:56:04 +00:00
maintainers = with maintainers ; [ adev ak johanot krav ] ;
2021-01-04 14:37:23 +00:00
platforms = [ " x 8 6 _ 6 4 - l i n u x " " a a r c h 6 4 - l i n u x " ] ;
2020-07-07 08:56:04 +00:00
} ;
2023-03-24 13:27:12 +00:00
ceph-common = with python . pkgs ; buildPythonPackage {
2020-07-07 08:56:04 +00:00
pname = " c e p h - c o m m o n " ;
inherit src version ;
sourceRoot = " c e p h - ${ version } / s r c / p y t h o n - c o m m o n " ;
2023-03-24 13:27:12 +00:00
propagatedBuildInputs = [
pyyaml
] ;
nativeCheckInputs = [
pytestCheckHook
] ;
disabledTests = [
# requires network access
" t e s t _ v a l i d _ a d d r "
] ;
2020-07-07 08:56:04 +00:00
meta = getMeta " C e p h c o m m o n m o d u l e f o r c o d e s h a r e d b y m a n a g e r m o d u l e s " ;
} ;
2023-03-24 13:27:12 +00:00
# Watch out for python <> boost compatibility
2024-05-03 10:43:34 +00:00
python = python311 . override {
2024-03-19 09:14:41 +00:00
packageOverrides = self : super : let
cryptographyOverrideVersion = " 4 0 . 0 . 1 " ;
bcryptOverrideVersion = " 4 . 0 . 1 " ;
in {
# Ceph does not support `bcrypt` > 4.0 yet:
# * Upstream issue: https://tracker.ceph.com/issues/63529
# > Python Sub-Interpreter Model Used by ceph-mgr Incompatible With Python Modules Based on PyO3
bcrypt = super . bcrypt . overridePythonAttrs ( old : rec {
pname = " b c r y p t " ;
version = bcryptOverrideVersion ;
src = fetchPypi {
inherit pname version ;
hash = " s h a 2 5 6 - J 9 N 1 k D r I J h z + Q E f 2 c J 0 W 9 9 G N O b H s k q r 3 K v m J V S p l D r 0 = " ;
} ;
cargoRoot = " s r c / _ b c r y p t " ;
cargoDeps = rustPlatform . fetchCargoTarball {
inherit src ;
sourceRoot = " ${ pname } - ${ version } / ${ cargoRoot } " ;
name = " ${ pname } - ${ version } " ;
hash = " s h a 2 5 6 - l D W X 6 9 Y E N Z F M u 7 p y B m a v U Z a a l G v F q b H S H f k w k z m D Q a Y = " ;
} ;
} ) ;
2024-01-19 12:56:44 +00:00
# Ceph does not support `cryptography` > 40 yet:
# * https://github.com/NixOS/nixpkgs/pull/281858#issuecomment-1899358602
# * Upstream issue: https://tracker.ceph.com/issues/63529
# > Python Sub-Interpreter Model Used by ceph-mgr Incompatible With Python Modules Based on PyO3
#
# We pin the older `cryptography` 40 here;
# this also forces us to pin an older `pyopenssl` because the current one
# is not compatible with older `cryptography`, see:
# https://github.com/pyca/pyopenssl/blob/d9752e44127ba36041b045417af8a0bf16ec4f1e/CHANGELOG.rst#2320-2023-05-30
cryptography = super . cryptography . overridePythonAttrs ( old : rec {
version = cryptographyOverrideVersion ;
src = fetchPypi {
inherit ( old ) pname ;
version = cryptographyOverrideVersion ;
hash = " s h a 2 5 6 - K A P y + L H p X 2 F E G Z J s f m 9 V 2 C i v x h T K X t Y V Q 4 d 6 5 m j M N H I = " ;
} ;
cargoDeps = rustPlatform . fetchCargoTarball {
inherit src ;
sourceRoot = let cargoRoot = " s r c / r u s t " ; in " ${ old . pname } - ${ cryptographyOverrideVersion } / ${ cargoRoot } " ;
name = " ${ old . pname } - ${ cryptographyOverrideVersion } " ;
hash = " s h a 2 5 6 - g F f D T c 2 Q W B W H B C y c V H 1 d Y l C s W Q M V c R Z f O B I a u + n j t D U = " ;
} ;
2024-02-20 07:58:55 +00:00
# Not using the normal `(old.patches or []) ++` pattern here to use
# the overridden package's patches, because current nixpkgs's `cryptography`
# has patches that do not apply on this old version.
2024-02-18 07:30:05 +00:00
patches = [
2024-01-19 12:56:44 +00:00
# Fix https://nvd.nist.gov/vuln/detail/CVE-2023-49083 which has no upstream backport.
# See https://github.com/pyca/cryptography/commit/f09c261ca10a31fe41b1262306db7f8f1da0e48a#diff-f5134bf8f3cf0a5cc8601df55e50697acc866c603a38caff98802bd8e17976c5R1893
./python-cryptography-Cherry-pick-fix-for-CVE-2023-49083-on-cryptography-40.patch
] ;
# Tests would require overriding `cryptography-vectors`, which is not currently
# possible/desired, see: https://github.com/NixOS/nixpkgs/pull/281858#pullrequestreview-1841421866
doCheck = false ;
} ) ;
# This is the most recent version of `pyopenssl` that's still compatible with `cryptography` 40.
# See https://github.com/NixOS/nixpkgs/pull/281858#issuecomment-1899358602
pyopenssl = super . pyopenssl . overridePythonAttrs ( old : rec {
version = " 2 3 . 1 . 1 " ;
src = fetchPypi {
pname = " p y O p e n S S L " ;
inherit version ;
hash = " s h a 2 5 6 - h B S Y u b 7 G F i O x t s R + u 8 A j Z 8 B 9 Y O D h l f G X k I F / E M y N s L c = " ;
} ;
2024-03-24 11:43:08 +00:00
disabledTests = old . disabledTests or [ ] ++ [
" t e s t _ e x p o r t _ m d 5 _ d i g e s t "
2024-03-17 18:38:59 +00:00
] ;
2024-05-03 09:34:16 +00:00
propagatedBuildInputs = old . propagatedBuildInputs or [ ] ++ [
self . flaky
] ;
2024-01-19 12:56:44 +00:00
} ) ;
# Ceph does not support `kubernetes` >= 19, see:
# https://github.com/NixOS/nixpkgs/pull/281858#issuecomment-1900324090
kubernetes = super . kubernetes . overridePythonAttrs ( old : rec {
version = " 1 8 . 2 0 . 0 " ;
src = fetchFromGitHub {
owner = " k u b e r n e t e s - c l i e n t " ;
repo = " p y t h o n " ;
rev = " v ${ version } " ;
sha256 = " 1 s a w p 6 2 j 7 h 0 y k s m g 9 j l v 4 i k 9 b 9 i 1 a 1 w 9 s y y w c 9 m v 8 x 8 9 w i b f 5 q l 1 " ;
fetchSubmodules = true ;
} ;
} ) ;
2023-03-08 13:44:18 +00:00
} ;
} ;
2022-06-11 06:29:30 +00:00
2023-03-24 13:27:12 +00:00
boost = boost179 . override {
2022-06-11 06:29:30 +00:00
enablePython = true ;
inherit python ;
} ;
2021-06-22 22:30:31 +00:00
2023-03-24 13:27:12 +00:00
# TODO: split this off in build and runtime environment
ceph-python-env = python . withPackages ( ps : with ps ; [
2020-07-07 08:56:04 +00:00
ceph-common
2023-03-24 13:27:12 +00:00
# build time
2024-04-18 09:09:19 +00:00
cython_0
2023-03-24 13:27:12 +00:00
# debian/control
bcrypt
cherrypy
influxdb
jinja2
kubernetes
natsort
numpy
pecan
prettytable
pyjwt
pyopenssl
python-dateutil
pyyaml
requests
routes
scikit-learn
scipy
setuptools
sphinx
virtualenv
werkzeug
# src/pybind/mgr/requirements-required.txt
cryptography
jsonpatch
# src/tools/cephfs/shell/setup.py
cmd2
colorama
2018-11-06 13:35:48 +00:00
] ) ;
2023-05-19 21:02:56 +00:00
inherit ( ceph-python-env . python ) sitePackages ;
2018-11-06 13:35:48 +00:00
2024-07-26 17:41:56 +00:00
version = " 1 8 . 2 . 4 " ;
2020-07-07 08:56:04 +00:00
src = fetchurl {
2023-05-19 21:02:56 +00:00
url = " h t t p s : / / d o w n l o a d . c e p h . c o m / t a r b a l l s / c e p h - ${ version } . t a r . g z " ;
2024-07-26 17:41:56 +00:00
hash = " s h a 2 5 6 - E F q t e P 3 J o + h A S X V e s H 6 g k j D j F O 7 / 1 R N 1 5 1 t I f / l Q 0 6 s = " ;
2020-07-07 08:56:04 +00:00
} ;
2018-11-06 13:35:48 +00:00
in rec {
ceph = stdenv . mkDerivation {
2019-09-05 10:48:15 +00:00
pname = " c e p h " ;
2020-07-07 08:56:04 +00:00
inherit src version ;
2018-11-06 13:35:48 +00:00
2024-08-13 02:08:58 +00:00
patches = [
# Fixes mgr not being able to import `packaging` due to autotools >= 70.
# Remove once https://github.com/ceph/ceph/pull/58624 is merged, see
# https://github.com/NixOS/nixpkgs/pull/330226#issuecomment-2268421031
( fetchpatch {
url = " h t t p s : / / g i t h u b . c o m / c e p h / c e p h / c o m m i t / 8 d a 2 d 8 5 7 f a 8 f d f e d d 7 a a d 0 c a 9 0 e 1 7 8 0 a 3 e d 0 8 5 c 9 . p a t c h " ;
name = " c e p h - m g r - p y t h o n - f i x - p a c k a g i n g - i m p o r t . p a t c h " ;
hash = " s h a 2 5 6 - 3 Y l 1 X 6 U f T f 0 X C X J x g R n M / J s 9 s z 8 t S + h s q V i Y 6 g D E x o I = " ;
} )
2024-08-13 02:18:21 +00:00
# Fixes cryptesetup version parsing regex, see
# * https://github.com/NixOS/nixpkgs/issues/334227
# * https://www.mail-archive.com/ceph-users@ceph.io/msg26309.html
# * https://github.com/ceph/ceph/pull/58997
# Remove once we're on the next version of Ceph 18, when this should be in:
# https://github.com/ceph/ceph/pull/58997
( fetchpatch {
url = " h t t p s : / / g i t h u b . c o m / c e p h / c e p h / c o m m i t / 6 a e 8 7 4 9 0 2 b 6 3 6 5 2 f a 1 9 9 5 6 3 b 6 e 7 9 5 0 c d 7 5 1 5 1 3 0 4 . p a t c h " ;
name = " c e p h - r e e f - c e p h - v o l u m e - f i x - s e t _ d m c r y p t _ n o _ w o r k q u e u e . p a t c h " ;
hash = " s h a 2 5 6 - r + 7 h c C z 2 W F / r J f g K w T a t K Y 9 u n J l E 8 U w 3 f m O y a Y 5 j V H 0 = " ;
} )
2024-08-13 02:08:58 +00:00
] ;
2024-07-06 14:45:50 +00:00
postPatch = ''
substituteInPlace cmake/modules/Finduring.cmake \
- - replace-fail " l i b u r i n g . a l i b u r i n g " " u r i n g "
'' ;
2018-11-06 13:35:48 +00:00
nativeBuildInputs = [
cmake
2023-03-24 13:27:12 +00:00
fmt
git
makeWrapper
2023-08-08 02:01:39 +00:00
nasm
2023-03-24 13:27:12 +00:00
pkg-config
python
2021-06-22 22:30:31 +00:00
python . pkgs . python # for the toPythonPath function
2023-03-24 13:27:12 +00:00
python . pkgs . wrapPython
which
2018-11-06 13:35:48 +00:00
( ensureNewerSourcesHook { year = " 1 9 8 0 " ; } )
2021-04-21 08:02:36 +00:00
# for building docs/man-pages presumably
doxygen
graphviz
2018-11-06 13:35:48 +00:00
] ;
buildInputs = cryptoLibsMap . ${ cryptoStr } ++ [
2023-03-24 13:27:12 +00:00
arrow-cpp
babeltrace
boost
bzip2
ceph-python-env
cryptsetup
cunit
gperf
gtest
icu
2023-08-08 02:01:39 +00:00
libcap
2023-03-24 13:27:12 +00:00
libnl
libxml2
lttng-ust
lua
lz4
malloc
oath-toolkit
openldap
optLibatomic_ops
optLibs3
optYasm
rdkafka
rocksdb'
snappy
sqlite
utf8proc
zlib
zstd
2021-01-27 10:21:31 +00:00
] ++ lib . optionals stdenv . isLinux [
2023-03-24 13:27:12 +00:00
keyutils
2023-08-08 02:01:39 +00:00
libcap_ng
2023-03-24 13:27:12 +00:00
liburing
libuuid
linuxHeaders
optLibaio
optLibxfs
optZfs
rabbitmq-c
rdma-core
udev
util-linux
2021-01-27 10:21:31 +00:00
] ++ lib . optionals hasRadosgw [
2023-03-24 13:27:12 +00:00
optCurl
optExpat
optFuse
optLibedit
2018-11-06 13:35:48 +00:00
] ;
2019-11-10 23:24:27 +00:00
pythonPath = [ ceph-python-env " ${ placeholder " o u t " } / ${ ceph-python-env . sitePackages } " ] ;
ceph: use absolute binary paths instead of relative paths
While trying to mount CephFS using libceph and systemd, mount.ceph tries to call "modinfo", "modprobe", and "grep", but fails with the error "sh: line 1: modprobe: command not found". This is because ceph calls these binaries by running the command "sh -c -- <application> %s %s", which does not pass the PATH environment variable through. This isn't usually a problem, because ceph, by default, calls the paths of these binaries as they would be in debian, in /sbin and /bin, but a change was made to replace these with relative paths, thus breaking the mounting process entirely. Replacing these relative paths with absolute store paths alleviates this issue whilst preserving all functionality.
2023-12-11 13:39:26 +00:00
# replace /sbin and /bin based paths with direct nix store paths
# increase the `command` buffer size since 2 nix store paths cannot fit within 128 characters
2018-11-06 13:35:48 +00:00
preConfigure = ''
ceph: use absolute binary paths instead of relative paths
While trying to mount CephFS using libceph and systemd, mount.ceph tries to call "modinfo", "modprobe", and "grep", but fails with the error "sh: line 1: modprobe: command not found". This is because ceph calls these binaries by running the command "sh -c -- <application> %s %s", which does not pass the PATH environment variable through. This isn't usually a problem, because ceph, by default, calls the paths of these binaries as they would be in debian, in /sbin and /bin, but a change was made to replace these with relative paths, thus breaking the mounting process entirely. Replacing these relative paths with absolute store paths alleviates this issue whilst preserving all functionality.
2023-12-11 13:39:26 +00:00
substituteInPlace src/common/module.c \
- - replace " c h a r c o m m a n d [ 1 2 8 ] ; " " c h a r c o m m a n d [ 2 5 6 ] ; " \
- - replace " / s b i n / m o d i n f o " " ${ kmod } / b i n / m o d i n f o " \
- - replace " / s b i n / m o d p r o b e " " ${ kmod } / b i n / m o d p r o b e " \
- - replace " / b i n / g r e p " " ${ gnugrep } / b i n / g r e p "
2018-11-06 13:35:48 +00:00
# install target needs to be in PYTHONPATH for "*.pth support" check to succeed
2020-01-21 14:26:20 +00:00
# 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 }
2023-08-08 02:01:39 +00:00
patchShebangs src /
2018-11-06 13:35:48 +00:00
'' ;
cmakeFlags = [
2019-11-10 23:24:27 +00:00
" - D C M A K E _ I N S T A L L _ D A T A D I R = ${ placeholder " l i b " } / l i b "
2023-03-24 13:27:12 +00:00
" - D W I T H _ C E P H F S _ S H E L L : B O O L = O N "
" - D W I T H _ S Y S T E M D : B O O L = O F F "
2023-08-08 02:01:39 +00:00
# `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.
" - D W I T H _ J A E G E R : B O O L = O F F "
2023-03-24 13:27:12 +00:00
" - D W I T H _ T E S T S : B O O L = O F F "
# Use our own libraries, where possible
2023-08-08 02:01:39 +00:00
" - D W I T H _ S Y S T E M _ A R R O W : B O O L = O N " # Only used if other options enable Arrow support.
2023-03-24 13:27:12 +00:00
" - D W I T H _ S Y S T E M _ B O O S T : B O O L = O N "
" - D W I T H _ S Y S T E M _ G T E S T : B O O L = O N "
" - D W I T H _ S Y S T E M _ R O C K S D B : B O O L = O N "
" - D W I T H _ S Y S T E M _ U T F 8 P R O C : B O O L = O N "
" - D W I T H _ S Y S T E M _ Z S T D : B O O L = O N "
2018-11-06 13:35:48 +00:00
# TODO breaks with sandbox, tries to download stuff with npm
2023-03-24 13:27:12 +00:00
" - D W I T H _ M G R _ D A S H B O A R D _ F R O N T E N D : B O O L = O F F "
2021-04-21 08:02:36 +00:00
# WITH_XFS has been set default ON from Ceph 16, keeping it optional in nixpkgs for now
'' - D W I T H _ X F S = ${ if optLibxfs != null then " O N " else " O F F " } ''
2021-06-30 16:55:32 +00:00
] ++ lib . optional stdenv . isLinux " - D W I T H _ S Y S T E M _ L I B U R I N G = O N " ;
2018-11-06 13:35:48 +00:00
2024-07-21 07:03:58 +00:00
preBuild =
# The legacy-option-headers target is not correctly empbedded in the build graph.
# It also contains some internal race conditions that we work around by building with `-j 1`.
# Upstream discussion for additional context at https://tracker.ceph.com/issues/63402.
''
cmake - - build . - - target legacy-option-headers - j 1
'' ;
2018-11-06 13:35:48 +00:00
postFixup = ''
wrapPythonPrograms
2019-11-10 23:24:27 +00:00
wrapProgram $ out/bin/ceph-mgr - - prefix PYTHONPATH " : " " $ ( t o P y t h o n P a t h ${ placeholder " o u t " } ) : $ ( t o P y t h o n P a t h ${ ceph-python-env } ) "
2020-01-21 14:26:20 +00:00
# Test that ceph-volume exists since the build system has a tendency to
# silently drop it with misconfigurations.
test - f $ out/bin/ceph-volume
2018-11-06 13:35:48 +00:00
'' ;
outputs = [ " o u t " " l i b " " d e v " " d o c " " m a n " ] ;
2019-11-10 23:24:27 +00:00
doCheck = false ; # uses pip to install things from the internet
2021-04-25 14:32:33 +00:00
# Takes 7+h to build with 2 cores.
requiredSystemFeatures = [ " b i g - p a r a l l e l " ] ;
2020-07-07 08:56:04 +00:00
meta = getMeta " D i s t r i b u t e d s t o r a g e s y s t e m " ;
2018-11-06 13:35:48 +00:00
2023-03-24 13:27:12 +00:00
passthru = {
inherit version ;
tests = {
inherit ( nixosTests )
ceph-multi-node
ceph-single-node
ceph-single-node-bluestore ;
} ;
} ;
2015-11-19 13:21:07 +00:00
} ;
2018-11-06 13:35:48 +00:00
ceph-client = runCommand " c e p h - c l i e n t - ${ version } " {
2021-11-10 20:44:52 +00:00
meta = getMeta " T o o l s n e e d e d t o m o u n t C e p h ' s R A D O S B l o c k D e v i c e s / C e p h f s " ;
2018-11-06 13:35:48 +00:00
} ''
2021-11-15 16:12:36 +00:00
mkdir - p $ out / { bin , etc , ${ sitePackages } , share/bash-completion/completions }
2018-11-06 13:35:48 +00:00
cp - r $ { ceph } /bin / { ceph , . ceph-wrapped , rados , rbd , rbdmap } $ out/bin
cp - r $ { ceph } /bin/ceph- { authtool , conf , dencoder , rbdnamer , syn } $ out/bin
cp - r $ { ceph } /bin/rbd-replay * $ out/bin
2021-11-15 16:12:36 +00:00
cp - r $ { ceph } /sbin/mount.ceph $ out/bin
cp - r $ { ceph } /sbin/mount.fuse.ceph $ out/bin
ln - s bin $ out/sbin
2021-11-12 18:05:27 +00:00
cp - r $ { ceph } / $ { sitePackages } /* $ o u t / $ { s i t e P a c k a g e s }
2020-11-12 21:22:18 +00:00
cp - r $ { ceph } /etc/bash_completion.d $ out/share/bash-completion/completions
2018-11-06 13:35:48 +00:00
# wrapPythonPrograms modifies .ceph-wrapped, so lets just update its paths
substituteInPlace $ out/bin/ceph - - replace $ { ceph } $ out
substituteInPlace $ out/bin/.ceph-wrapped - - replace $ { ceph } $ out
'' ;
}