Repository navigation
Conversation
|
Can one of the admins verify this patch? |
14 similar comments
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
| return fmt::format(FMT_STRING("{:d}{:02d}{:02d}/{:s}/{:s}/aws4_request"), | ||
| return fmt::format(fmt::runtime("{:d}{:02d}{:02d}/{:s}/{:s}/aws4_request"), |
There was a problem hiding this comment.
i don't see why this can't be a compile-time format string - does it still not work with FMT_STRING removed?
There was a problem hiding this comment.
my test shows only clang 20/21 is failed, no problem with gcc & clang below 20
and yes, it still works with FMT_STRING removed.
There was a problem hiding this comment.
yeah, i am able to reproduce the build failure with -std=c++20, see https://godbolt.org/z/jnqcnW8Eo, where six combinations are tested:
| compiler | fmt | build? |
|---|---|---|
| gcc 15.2 | 9.1.0 | yes |
| clang 21 | 9.1.0 | no |
| gcc 15.2 | 11.0.0 | yes |
| clang 21 | 11.0.0 | no |
| gcc 15.2 | 12.0.0 | yes |
| clang 21 | 12.0.0 | yes |
this is a known issue, see fmtlib/fmt#4552 , which was fixed by fmt 12.0.0.
i think the right fix is to remove FMT_STRING(). like:
return fmt::format("{:d}{:02d}{:02d}/{:s}/{:s}/aws4_request",Compile-time format string checks are enabled by default on compilers that support C++20 consteval. On older compilers you can use the FMT_STRING macro defined in fmt/format.h instead.
but we are now using C++23. and require a compiler which is C++23 compliant. and the minimal fmt version we require is 8.1.1, fmt enabled the compile-time format check by default in 8.0, see fmtlib/fmt#2022. so we can safely drop it.
There was a problem hiding this comment.
I agree, force pushed.
|
I think this is a problem of libfmt, build is ok after switch libfmt to 11.1.4 (which is the version used in main branch). I did the test on ceph 19.2.2 where libfmt is 9.1.0. clang -isystem src/fmt/include -std=c++20 -c test.cc |
tchaikov
left a comment
There was a problem hiding this comment.
i'd suggest just drop FMT_STRING. IMHO, fmt::runtime() is not designed to be used in this use case. as "{:d}{:02d}{:02d}/{:s}/{:s}/aws4_request" is a compile-time constexpr.
the build failure is a known issue, and documented upstream. please reference it in the commit message.
per the upstream release note, it's fixed in v12.0.0. |
6828267 to
60872ed
Compare
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 fmtlib/fmt@6797f0c). 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]>
Just did a test with different release of fmt, build is ok since fmt v11.1.0, i'll update the commit message. |
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
|
ping |
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
|
ok to test |
|
jenkins test make check |
|
jenkins test make check arm64 |
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
2 similar comments
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
ping |
|
@anrao19 Could you include this in the next run, please? |
sure @adamemerson |
|
This PR has been added to main integration testing by anuchaithra started 2026-07-17-06:18. |
pr testing completed and approved by @ivancich |
Fix a build failure with Clang 20+ where fmt's compile-time format parsing fails in a consteval context.
The following error is triggered 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
Use fmt::runtime() to avoid compile-time format string parsing and restore buildability across toolchains.