VowpalWabbit / vowpal_wabbit

Vowpal Wabbit is a machine learning system which pushes the frontier of machine learning with techniques such as online, hashing, allreduce, reductions, learning2search, active, and interactive learning.
https://vowpalwabbit.org
Other
8.49k stars 1.93k forks source link

Build failure with fmt 11 #4700

Open carlocab opened 3 months ago

carlocab commented 3 months ago

Describe the bug

The build fails with fmt 11+.

I don't have the error log anymore, but I can reproduce it if required. A patch is attached below.

How to reproduce

Build vowpal_wabbit with fmt 11+.

Version

9.10.0

OS

macOS

Language

C++

Additional context

This patch seems to fix things:

Patch ```diff diff --git a/vowpalwabbit/config/src/cli_help_formatter.cc b/vowpalwabbit/config/src/cli_help_formatter.cc index 8cc6dfe..530d200 100644 --- a/vowpalwabbit/config/src/cli_help_formatter.cc +++ b/vowpalwabbit/config/src/cli_help_formatter.cc @@ -8,6 +8,7 @@ #include "vw/config/options.h" #include +#include #include #include diff --git a/vowpalwabbit/config/src/options_cli.cc b/vowpalwabbit/config/src/options_cli.cc index e9b09a5..55e2aee 100644 --- a/vowpalwabbit/config/src/options_cli.cc +++ b/vowpalwabbit/config/src/options_cli.cc @@ -10,6 +10,7 @@ #include "vw/config/option.h" #include +#include #include #include diff --git a/vowpalwabbit/core/include/vw/core/vw_string_view_fmt.h b/vowpalwabbit/core/include/vw/core/vw_string_view_fmt.h index 0d42ac7..6f3cdff 100644 --- a/vowpalwabbit/core/include/vw/core/vw_string_view_fmt.h +++ b/vowpalwabbit/core/include/vw/core/vw_string_view_fmt.h @@ -13,6 +13,7 @@ #include #include +#include namespace fmt { diff --git a/vowpalwabbit/core/src/merge.cc b/vowpalwabbit/core/src/merge.cc index 7425dee..46e2b16 100644 --- a/vowpalwabbit/core/src/merge.cc +++ b/vowpalwabbit/core/src/merge.cc @@ -16,6 +16,8 @@ #include "vw/core/vw_math.h" #include "vw/io/io_adapter.h" +#include + #include #include diff --git a/vowpalwabbit/core/src/no_label.cc b/vowpalwabbit/core/src/no_label.cc index c09f65f..b973442 100644 --- a/vowpalwabbit/core/src/no_label.cc +++ b/vowpalwabbit/core/src/no_label.cc @@ -11,6 +11,8 @@ #include "vw/core/vw.h" #include "vw/io/logger.h" +#include + namespace { void parse_no_label(const std::vector& words, VW::io::logger& logger) diff --git a/vowpalwabbit/core/src/parse_args.cc b/vowpalwabbit/core/src/parse_args.cc index 3d33bde..7feaccc 100644 --- a/vowpalwabbit/core/src/parse_args.cc +++ b/vowpalwabbit/core/src/parse_args.cc @@ -44,6 +44,8 @@ #include "vw/io/owning_stream.h" #include "vw/text_parser/parse_example_text.h" +#include + #include #include diff --git a/vowpalwabbit/core/src/vw.cc b/vowpalwabbit/core/src/vw.cc index c8af91a..1b739a1 100644 --- a/vowpalwabbit/core/src/vw.cc +++ b/vowpalwabbit/core/src/vw.cc @@ -23,6 +23,7 @@ #include "vw/core/unique_sort.h" #include "vw/text_parser/parse_example_text.h" +#include #include namespace diff --git a/vowpalwabbit/core/include/vw/core/automl_impl.h b/vowpalwabbit/core/include/vw/core/automl_impl.h index 4a44666..0d1b35d 100644 --- a/vowpalwabbit/core/include/vw/core/automl_impl.h +++ b/vowpalwabbit/core/include/vw/core/automl_impl.h @@ -334,7 +334,7 @@ template <> class formatter : public formatter { public: - auto format(VW::reductions::automl::automl_state c, format_context& ctx) -> decltype(ctx.out()) + auto format(VW::reductions::automl::automl_state c, format_context& ctx) const -> decltype(ctx.out()) { return formatter::format(std::string{VW::to_string(c)}, ctx); } @@ -344,7 +344,7 @@ template <> class formatter : public formatter { public: - auto format(VW::reductions::automl::config_state c, format_context& ctx) -> decltype(ctx.out()) + auto format(VW::reductions::automl::config_state c, format_context& ctx) const -> decltype(ctx.out()) { return formatter::format(std::string{VW::to_string(c)}, ctx); } @@ -354,7 +354,7 @@ template <> class formatter : public formatter { public: - auto format(VW::reductions::automl::config_type c, format_context& ctx) -> decltype(ctx.out()) + auto format(VW::reductions::automl::config_type c, format_context& ctx) const -> decltype(ctx.out()) { return formatter::format(std::string{VW::to_string(c)}, ctx); } diff --git a/vowpalwabbit/core/include/vw/core/ccb_label.h b/vowpalwabbit/core/include/vw/core/ccb_label.h index 2e7e985..9dd9158 100644 --- a/vowpalwabbit/core/include/vw/core/ccb_label.h +++ b/vowpalwabbit/core/include/vw/core/ccb_label.h @@ -81,7 +81,7 @@ template <> class formatter : public formatter { public: - auto format(VW::ccb_example_type c, format_context& ctx) -> decltype(ctx.out()) + auto format(VW::ccb_example_type c, format_context& ctx) const -> decltype(ctx.out()) { return formatter::format(std::string{VW::to_string(c)}, ctx); } diff --git a/vowpalwabbit/core/include/vw/core/slates_label.h b/vowpalwabbit/core/include/vw/core/slates_label.h index 0cd089c..d226893 100644 --- a/vowpalwabbit/core/include/vw/core/slates_label.h +++ b/vowpalwabbit/core/include/vw/core/slates_label.h @@ -81,7 +81,7 @@ template <> class formatter : public formatter { public: - auto format(VW::slates::example_type c, format_context& ctx) -> decltype(ctx.out()) + auto format(VW::slates::example_type c, format_context& ctx) const -> decltype(ctx.out()) { return formatter::format(std::string{VW::to_string(c)}, ctx); } ```
JohnLangford commented 1 month ago

It looks like this isn't passing the CI checks: https://github.com/VowpalWabbit/vowpal_wabbit/actions/runs/11389180985/job/31687872013?pr=4702 . Do you know what the variance in your build environment is?

carlocab commented 1 month ago

That job is targeting WASM, which seems like an important difference. The Linux and macOS builds at #4702 seem to work fine.