commit:     5b6873f0f26e803b124c7d7d3380a459e82b8234
Author:     Z. Liu <zhixu.liu <AT> gmail <DOT> com>
AuthorDate: Tue Jan 20 15:31:57 2026 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jan 25 06:45:35 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5b6873f0

sys-cluster/ceph: fix build issue with FMT_STRING on clang 20+

1. add ceph-19.2.2-rgw-remove-FMT_STRING-to-fix-clang-20-build-failure.patch
   fix a build failure with clang 20+ where fmt’s compile-time format parsing
   fails in a consteval context.
2. use the system fmt for ceph 20+, as builds with the bundled one fail with
   FMT_STRING when using clang 20+.

Signed-off-by: Z. Liu <zhixu.liu <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/45459
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-cluster/ceph/ceph-19.2.2-r6.ebuild             |  1 +
 sys-cluster/ceph/ceph-19.2.3.ebuild                |  1 +
 sys-cluster/ceph/ceph-20.1.0-r2.ebuild             |  4 +-
 sys-cluster/ceph/ceph-20.1.1.ebuild                |  4 +-
 ...-FMT_STRING-to-fix-clang-20-build-failure.patch | 51 ++++++++++++++++++++++
 5 files changed, 57 insertions(+), 4 deletions(-)

diff --git a/sys-cluster/ceph/ceph-19.2.2-r6.ebuild 
b/sys-cluster/ceph/ceph-19.2.2-r6.ebuild
index 3187ab96a64a..76db70064052 100644
--- a/sys-cluster/ceph/ceph-19.2.2-r6.ebuild
+++ b/sys-cluster/ceph/ceph-19.2.2-r6.ebuild
@@ -242,6 +242,7 @@ PATCHES=(
        "${FILESDIR}/ceph-19.2.2-gcc15.patch"
        "${FILESDIR}/ceph-19.2.2-ipv6.patch"
        
"${FILESDIR}/ceph-19.2.2-add-option-to-build-agains-system-opentelemetry.patch"
+       
"${FILESDIR}/ceph-19.2.2-rgw-remove-FMT_STRING-to-fix-clang-20-build-failure.patch"
 )
 
 check-reqs_export_vars() {

diff --git a/sys-cluster/ceph/ceph-19.2.3.ebuild 
b/sys-cluster/ceph/ceph-19.2.3.ebuild
index 5d158d026d52..7a66040319dd 100644
--- a/sys-cluster/ceph/ceph-19.2.3.ebuild
+++ b/sys-cluster/ceph/ceph-19.2.3.ebuild
@@ -241,6 +241,7 @@ PATCHES=(
        "${FILESDIR}/ceph-19.2.2-py313-3.patch"
        "${FILESDIR}/ceph-19.2.2-gcc15.patch"
        
"${FILESDIR}/ceph-19.2.2-add-option-to-build-agains-system-opentelemetry.patch"
+       
"${FILESDIR}/ceph-19.2.2-rgw-remove-FMT_STRING-to-fix-clang-20-build-failure.patch"
 )
 
 check-reqs_export_vars() {

diff --git a/sys-cluster/ceph/ceph-20.1.0-r2.ebuild 
b/sys-cluster/ceph/ceph-20.1.0-r2.ebuild
index 5f1d754fa9d7..e54261a52366 100644
--- a/sys-cluster/ceph/ceph-20.1.0-r2.ebuild
+++ b/sys-cluster/ceph/ceph-20.1.0-r2.ebuild
@@ -219,6 +219,7 @@ PATCHES=(
        "${FILESDIR}/ceph-18.2.4-spdk.patch"
        "${FILESDIR}/ceph-19.2.1-isa-l.patch"
        
"${FILESDIR}/ceph-19.2.2-add-option-to-build-agains-system-opentelemetry.patch"
+       
"${FILESDIR}/ceph-19.2.2-rgw-remove-FMT_STRING-to-fix-clang-20-build-failure.patch"
        "${FILESDIR}/ceph-20.1.0-nvmeof.patch"
 )
 
@@ -343,8 +344,7 @@ ceph_src_configure() {
                -DWITH_SYSTEM_UTF8PROC:BOOL=ON
                
-DCMAKE_INSTALL_DOCDIR:PATH="${EPREFIX}/usr/share/doc/${PN}-${PVR}"
                -DCMAKE_INSTALL_SYSCONFDIR:PATH="${EPREFIX}/etc"
-               # use the bundled libfmt for now since they seem to constantly 
break their API
-               -DCMAKE_DISABLE_FIND_PACKAGE_fmt=ON
+               -DWITH_SYSTEM_FMT=ON
                -Wno-dev
                -DCEPHADM_BUNDLED_DEPENDENCIES=none
                -DWITH_NVMEOF_GATEWAY_MONITOR_CLIENT:BOOL=$(usex nvmeof)

diff --git a/sys-cluster/ceph/ceph-20.1.1.ebuild 
b/sys-cluster/ceph/ceph-20.1.1.ebuild
index 5f1d754fa9d7..e54261a52366 100644
--- a/sys-cluster/ceph/ceph-20.1.1.ebuild
+++ b/sys-cluster/ceph/ceph-20.1.1.ebuild
@@ -219,6 +219,7 @@ PATCHES=(
        "${FILESDIR}/ceph-18.2.4-spdk.patch"
        "${FILESDIR}/ceph-19.2.1-isa-l.patch"
        
"${FILESDIR}/ceph-19.2.2-add-option-to-build-agains-system-opentelemetry.patch"
+       
"${FILESDIR}/ceph-19.2.2-rgw-remove-FMT_STRING-to-fix-clang-20-build-failure.patch"
        "${FILESDIR}/ceph-20.1.0-nvmeof.patch"
 )
 
@@ -343,8 +344,7 @@ ceph_src_configure() {
                -DWITH_SYSTEM_UTF8PROC:BOOL=ON
                
-DCMAKE_INSTALL_DOCDIR:PATH="${EPREFIX}/usr/share/doc/${PN}-${PVR}"
                -DCMAKE_INSTALL_SYSCONFDIR:PATH="${EPREFIX}/etc"
-               # use the bundled libfmt for now since they seem to constantly 
break their API
-               -DCMAKE_DISABLE_FIND_PACKAGE_fmt=ON
+               -DWITH_SYSTEM_FMT=ON
                -Wno-dev
                -DCEPHADM_BUNDLED_DEPENDENCIES=none
                -DWITH_NVMEOF_GATEWAY_MONITOR_CLIENT:BOOL=$(usex nvmeof)

diff --git 
a/sys-cluster/ceph/files/ceph-19.2.2-rgw-remove-FMT_STRING-to-fix-clang-20-build-failure.patch
 
b/sys-cluster/ceph/files/ceph-19.2.2-rgw-remove-FMT_STRING-to-fix-clang-20-build-failure.patch
new file mode 100644
index 000000000000..428c6d7c48a6
--- /dev/null
+++ 
b/sys-cluster/ceph/files/ceph-19.2.2-rgw-remove-FMT_STRING-to-fix-clang-20-build-failure.patch
@@ -0,0 +1,51 @@
+https://github.com/ceph/ceph/pull/66928
+
+From 4965dbac4bd17973eb15fe09d2a046a509b4a65a Mon Sep 17 00:00:00 2001
+From: "Z. Liu" <[email protected]>
+Date: Wed, 14 Jan 2026 22:46:39 +0800
+Subject: [PATCH] rgw: remove FMT_STRING to fix clang 20+ build failure
+
+Fix a build failure with Clang 20+ using -std=c++20, where fmt
+(v9.1.0, v11.0.0, and possibly other versions) fails to parse
+format strings at compile-time in a consteval context. This is
+a known issue in fmt, fixed in fmt v11.1.0 (see
+https://github.com/fmtlib/fmt/commit/6797f0c39a4ef13061cbc3bb850c35af7428fdc4).
+
+The following error occurs when building rgw_auth_s3.cc:
+
+  src/rgw/rgw_auth_s3.cc:600:22: error: call to consteval function
+  'fmt::basic_format_string<...>' is not a constant expression
+
+Removing FMT_STRING avoids compile-time format string parsing
+and restores buildability across different toolchains.
+
+Test case:
+
+  #include <fmt/format.h>
+
+  std::string gen_v4_scope(const std::string& region)
+  {
+    return fmt::format(FMT_STRING("{:s}"), region);
+  }
+
+Compile with:
+
+  clang -isystem fmt/include -std=c++20 -c test.cc
+
+Signed-off-by: Z. Liu <[email protected]>
+
+diff --git a/src/rgw/rgw_auth_s3.cc b/src/rgw/rgw_auth_s3.cc
+index c14a937685a..b31b0279d8e 100644
+--- a/src/rgw/rgw_auth_s3.cc
++++ b/src/rgw/rgw_auth_s3.cc
+@@ -605,7 +605,7 @@ string gen_v4_scope(const ceph::real_time& timestamp,
+   auto mon = bt.tm_mon + 1;
+   auto day = bt.tm_mday;
+ 
+-  return fmt::format(FMT_STRING("{:d}{:02d}{:02d}/{:s}/{:s}/aws4_request"),
++  return fmt::format("{:d}{:02d}{:02d}/{:s}/{:s}/aws4_request",
+                      year, mon, day, region, service);
+ }
+ 
+-- 
+2.49.1

Reply via email to