Skip to content

Build failure in CI due to articuno not being compatible with latest fmt #1

Description

@alandtse
  Error: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\include\format(3398): error C2338: static_assert failed: 'Cannot format an argument. To make type T formattable, provide a formatter<T> specialization. See N4917 [format.arg.store]/2 and [formatter.requirements].'
  C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\include\format(3521): note: see reference to function template instantiation 'auto std::make_format_args<std::format_context,C*__restrict &>(C *__restrict &)' being compiled
          with
          [
              C=const char
          ]
  D:\a\MergeMapper\MergeMapper\build\release-msvc\vcpkg_installed\x64-windows-skse\include\articuno\archives\ryml\yaml_source.h(339): note: see reference to function template instantiation 'std::string std::format<C*__restrict &>(const std::basic_format_string<char,C *__restrict &>,C *__restrict &)' being compiled
          with
          [
              C=const char
          ]
  D:\a\MergeMapper\MergeMapper\build\release-msvc\vcpkg_installed\x64-windows-skse\include\articuno\archives\ryml\yaml_source.h(331): note: while compiling class template member function 'void const articuno::ryml::yaml_source<articuno::ryml::yaml_parser,articuno::archive_flags{gluino::flags_traits{},const articuno::archive_flags::enum_type:(articuno::archive_flags::enum_type)0},articuno::default_tag{}>::collect_anchors(c4::yml::NodeRef)'
  D:\a\MergeMapper\MergeMapper\build\release-msvc\vcpkg_installed\x64-windows-skse\include\articuno\archives\ryml\yaml_source.h(353): note: see reference to function template instantiation 'void const articuno::ryml::yaml_source<articuno::ryml::yaml_parser,articuno::archive_flags{gluino::flags_traits{},const articuno::archive_flags::enum_type:(articuno::archive_flags::enum_type)0},articuno::default_tag{}>::collect_anchors(c4::yml::NodeRef)' being compiled
  D:\a\MergeMapper\MergeMapper\src\Config.cpp(16): note: see reference to class template instantiation 'const articuno::ryml::yaml_source<articuno::ryml::yaml_parser,articuno::archive_flags{gluino::flags_traits{},const articuno::archive_flags::enum_type:(articuno::archive_flags::enum_type)0},articuno::default_tag{}>' being compiled
void collect_anchors(::ryml::NodeRef node) {
            if (node.has_val_anchor()) {
                auto anchor = node.val_anchor();
                auto [_, success] = _anchors.try_emplace(::std::string_view(anchor.str, anchor.size()), node);
                if (!success) {
                    throw ::articuno::format_error(
                        ::std::format("Found duplicate anchor name '{}' " // this line breaks
                                      "in YAML document.",
                                      anchor.str));
                }
            }
            for (auto child : node.children()) {
                collect_anchors(child);
            }
        }

Easy fix is to replace std::format with fmt::format

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions