mariadb failed to use system fmt 10.1.x
by lucabon from LinuxQuestions.org on (#6E8YA)
From fmt 10.1.0 (tested also with 10.1.1), mariadb failed to use the system one due to error while compiling the test program:
Code:#define FMT_STATIC_THOUSANDS_SEPARATOR ','
#define FMT_HEADER_ONLY 1
#include <fmt/format-inl.h>
#include <iostream>
int main() {
fmt::format_args::format_arg arg=
fmt::detail::make_arg<fmt::format_context>(42);
std::cout << fmt::vformat("The answer is {}.",
fmt::format_args(&arg, 1));
}Seems detail::make_arg was removed from 10.1.0 in favor of make_format_args:
Code:--- fmt-10.0.0/test/format-test.cc 2023-05-10 00:55:39.000000000 +0200
+++ fmt-10.1.0/test/format-test.cc 2023-08-12 16:18:59.000000000 +0200
@@ -2098,8 +2075,8 @@ TEST(format_test, format_to_n_output_ite
TEST(format_test, vformat_to) {
using context = fmt::format_context;
- fmt::basic_format_arg<context> arg = fmt::detail::make_arg<context>(42);
- auto args = fmt::basic_format_args<context>(&arg, 1);
+ int n = 42;
+ auto args = fmt::make_format_args<context>(n);
auto s = std::string();
fmt::vformat_to(std::back_inserter(s), "{}", args);
EXPECT_EQ("42", s);In this way, only online compilation is possibile (MariaDB will download fmt 8.0.1).
Not sure which is the best solution: provide fmt v8.0.1 in the sources or patch testing program and related source files (cmake/libfmt.cmake and sql/item_strfunc.cc).
Code:#define FMT_STATIC_THOUSANDS_SEPARATOR ','
#define FMT_HEADER_ONLY 1
#include <fmt/format-inl.h>
#include <iostream>
int main() {
fmt::format_args::format_arg arg=
fmt::detail::make_arg<fmt::format_context>(42);
std::cout << fmt::vformat("The answer is {}.",
fmt::format_args(&arg, 1));
}Seems detail::make_arg was removed from 10.1.0 in favor of make_format_args:
Code:--- fmt-10.0.0/test/format-test.cc 2023-05-10 00:55:39.000000000 +0200
+++ fmt-10.1.0/test/format-test.cc 2023-08-12 16:18:59.000000000 +0200
@@ -2098,8 +2075,8 @@ TEST(format_test, format_to_n_output_ite
TEST(format_test, vformat_to) {
using context = fmt::format_context;
- fmt::basic_format_arg<context> arg = fmt::detail::make_arg<context>(42);
- auto args = fmt::basic_format_args<context>(&arg, 1);
+ int n = 42;
+ auto args = fmt::make_format_args<context>(n);
auto s = std::string();
fmt::vformat_to(std::back_inserter(s), "{}", args);
EXPECT_EQ("42", s);In this way, only online compilation is possibile (MariaDB will download fmt 8.0.1).
Not sure which is the best solution: provide fmt v8.0.1 in the sources or patch testing program and related source files (cmake/libfmt.cmake and sql/item_strfunc.cc).