From 63faf31b1ecd74dd0743b2ba782eff67a44cf8e9 Mon Sep 17 00:00:00 2001 From: Tobias Mayer Date: Sun, 21 Jul 2024 09:03:58 +0200 Subject: [PATCH] ceph: Fix race in parallel build --- pkgs/tools/filesystems/ceph/default.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/filesystems/ceph/default.nix b/pkgs/tools/filesystems/ceph/default.nix index e116304f07b4..a8ed7611546e 100644 --- a/pkgs/tools/filesystems/ceph/default.nix +++ b/pkgs/tools/filesystems/ceph/default.nix @@ -340,8 +340,6 @@ in rec { graphviz ]; - enableParallelBuilding = true; - buildInputs = cryptoLibsMap.${cryptoStr} ++ [ arrow-cpp babeltrace @@ -449,6 +447,14 @@ in rec { ''-DWITH_XFS=${if optLibxfs != null then "ON" else "OFF"}'' ] ++ lib.optional stdenv.isLinux "-DWITH_SYSTEM_LIBURING=ON"; + 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 + ''; + postFixup = '' wrapPythonPrograms wrapProgram $out/bin/ceph-mgr --prefix PYTHONPATH ":" "$(toPythonPath ${placeholder "out"}):$(toPythonPath ${ceph-python-env})"