Skip to content

Update fmt version to 12.0.0 - #4912

Closed
servantftransperfect wants to merge 2 commits into
AcademySoftwareFoundation:mainfrom
servantftransperfect:patch-1
Closed

Update fmt version to 12.0.0#4912
servantftransperfect wants to merge 2 commits into
AcademySoftwareFoundation:mainfrom
servantftransperfect:patch-1

Conversation

@servantftransperfect

Copy link
Copy Markdown
Contributor

Upgrading fmt dependency to 12.0.0.

Current fmt version is not compatible with Clang 21.1.2 (Maybe older too)

@linux-foundation-easycla

linux-foundation-easycla Bot commented Sep 28, 2025

Copy link
Copy Markdown

CLA Not Signed

@lgritz

lgritz commented Sep 28, 2025

Copy link
Copy Markdown
Collaborator

I am not opposed to raising the auto-build version of fmt. There is another PR #4910 in review that updates several auto-build versions (which does not include fmt, but I think that is a mere oversight and not purposeful intent).

But this change is failing on Windows, so there's probably something else still needing adjustment for that platform.

Can you please explain more about how fmt 10.2 was failing against clang 21.1? Can you maybe reproduce some of the error log here so we can see?

Since auto-build is just used when a dependency is not found externally, if it's true that certain (moderately recent, even) versions of fmt don't work with the latest compilers, I feel like we should detect this case and warn about it with a clear explanation, even when not doing auto-build.

@lgritz lgritz added the build / testing / port / CI Affecting the build system, tests, platform support, porting, or continuous integration. label Oct 11, 2025
@lgritz

lgritz commented Oct 11, 2025

Copy link
Copy Markdown
Collaborator

Hi, @servantftransperfect, any comments about this?

@servantftransperfect

Copy link
Copy Markdown
Contributor Author

I'm sorry, i am not able to reproduce it. It currently compiles out of the box (?). Closing this.

@servantftransperfect

servantftransperfect commented Feb 2, 2026

Copy link
Copy Markdown
Contributor Author

Finally able to reproduce. Building some library which use oiio with clang 21.1.4. Oiio was built using another toolchain.

Getting this : (Sorry for the layout, github seems to mess it)

In file included from /s/apps/packages/cgDev/oiio/3.0.9.1/platform-linux/boost-1.85/tbb-2021/openexr-3.3/ocio-2.4/include/OpenImageIO/color.h:10: In file included from /s/apps/packages/cgDev/oiio/3.0.9.1/platform-linux/boost-1.85/tbb-2021/openexr-3.3/ocio-2.4/include/OpenImageIO/fmath.h:41: In file included from /s/apps/packages/cgDev/oiio/3.0.9.1/platform-linux/boost-1.85/tbb-2021/openexr-3.3/ocio-2.4/include/OpenImageIO/span.h:20: In file included from /s/apps/packages/cgDev/oiio/3.0.9.1/platform-linux/boost-1.85/tbb-2021/openexr-3.3/ocio-2.4/include/OpenImageIO/detail/fmt.h:67: In file included from /s/apps/packages/cgDev/oiio/3.0.9.1/platform-linux/boost-1.85/tbb-2021/openexr-3.3/ocio-2.4/include/OpenImageIO/detail/fmt/format.h:4530: /s/apps/packages/cgDev/oiio/3.0.9.1/platform-linux/boost-1.85/tbb-2021/openexr-3.3/ocio-2.4/include/OpenImageIO/detail/fmt/format-inl.h:61:24: error: call to consteval function 'fmt::basic_format_string<char, fmt::basic_string_view<char> &, const char (&)[3]>::basic_format_string<FMT_COMPILE_STRING, 0>' is not a constant expression 61 | fmt::format_to(it, FMT_STRING("{}{}"), message, SEP); | ^ /s/apps/packages/cgDev/oiio/3.0.9.1/platform-linux/boost-1.85/tbb-2021/openexr-3.3/ocio-2.4/include/OpenImageIO/detail/fmt/format.h:1848:23: note: expanded from macro 'FMT_STRING' 1848 | #define FMT_STRING(s) FMT_STRING_IMPL(s, fmt::detail::compile_string, ) | ^ /s/apps/packages/cgDev/oiio/3.0.9.1/platform-linux/boost-1.85/tbb-2021/openexr-3.3/ocio-2.4/include/OpenImageIO/detail/fmt/format.h:1825:3: note: expanded from macro 'FMT_STRING_IMPL' 1825 | [] { \ | ^ /s/apps/packages/cgDev/oiio/3.0.9.1/platform-linux/boost-1.85/tbb-2021/openexr-3.3/ocio-2.4/include/OpenImageIO/detail/fmt/core.h:704:54: note: subexpression not valid in a constant expression 704 | format_str_.remove_prefix(detail::to_unsigned(it - begin())); | ~~~^~~~~~~~~ /s/apps/packages/cgDev/oiio/3.0.9.1/platform-linux/boost-1.85/tbb-2021/openexr-3.3/ocio-2.4/include/OpenImageIO/detail/fmt/core.h:2682:5: note: in call to 'this->context_.advance_to(&"{}{}"[1])' 2682 | context_.advance_to(begin); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ /s/apps/packages/cgDev/oiio/3.0.9.1/platform-linux/boost-1.85/tbb-2021/openexr-3.3/ocio-2.4/include/OpenImageIO/detail/fmt/core.h:2677:5: note: in call to 'this->on_format_specs(0, &"{}{}"[1], &"{}{}"[1])' 2677 | on_format_specs(id, begin, begin); // Call parse() on empty specs. | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /s/apps/packages/cgDev/oiio/3.0.9.1/platform-linux/boost-1.85/tbb-2021/openexr-3.3/ocio-2.4/include/OpenImageIO/detail/fmt/core.h:2502:5: note: in call to 'handler.on_replacement_field(0, &"{}{}"[1])' 2502 | handler.on_replacement_field(handler.on_arg_id(), begin); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /s/apps/packages/cgDev/oiio/3.0.9.1/platform-linux/boost-1.85/tbb-2021/openexr-3.3/ocio-2.4/include/OpenImageIO/detail/fmt/core.h:2534:21: note: in call to 'parse_replacement_field<char, fmt::detail::format_string_checker<char, fmt::basic_string_view<char>, char[3]> &>(&"{}{}"[1], &"{}{}"[4], checker(s))' 2534 | begin = p = parse_replacement_field(p - 1, end, handler); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /s/apps/packages/cgDev/oiio/3.0.9.1/platform-linux/boost-1.85/tbb-2021/openexr-3.3/ocio-2.4/include/OpenImageIO/detail/fmt/core.h:2787:7: note: in call to 'parse_format_string<true, char, fmt::detail::format_string_checker<char, fmt::basic_string_view<char>, char[3]>>({&"{}{}"[0], 4}, checker(s))' 2787 | detail::parse_format_string<true>(str_, checker(s)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /s/apps/packages/cgDev/oiio/3.0.9.1/platform-linux/boost-1.85/tbb-2021/openexr-3.3/ocio-2.4/include/OpenImageIO/detail/fmt/format-inl.h:61:24: note: in call to 'basic_format_string<FMT_COMPILE_STRING, 0>([] { struct __attribute__((visibility("hidden"))) FMT_COMPILE_STRING : fmt::detail::compile_string { using char_type [[maybe_unused]] = fmt::remove_cvref_t<decltype("{}{}"[0])>; [[maybe_unused]] constexpr operator fmt::basic_string_view<char_type>() const { return fmt::detail_exported::compile_string_to_view<char_type>("{}{}"); } }; return FMT_COMPILE_STRING(); }())' 61 | fmt::format_to(it, FMT_STRING("{}{}"), message, SEP); | ^~~~~~~~~~~~~~~~~~ /s/apps/packages/cgDev/oiio/3.0.9.1/platform-linux/boost-1.85/tbb-2021/openexr-3.3/ocio-2.4/include/OpenImageIO/detail/fmt/format.h:1848:23: note: expanded from macro 'FMT_STRING' 1848 | #define FMT_STRING(s) FMT_STRING_IMPL(s, fmt::detail::compile_string, ) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /s/apps/packages/cgDev/oiio/3.0.9.1/platform-linux/boost-1.85/tbb-2021/openexr-3.3/ocio-2.4/include/OpenImageIO/detail/fmt/format.h:1825:3: note: expanded from macro 'FMT_STRING_IMPL' 1825 | [] { \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1826 | /* Use the hidden visibility as a workaround for a GCC bug (#1973). */ \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1827 | /* Use a macro-like name to avoid shadowing warnings. */ \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1828 | struct FMT_VISIBILITY("hidden") FMT_COMPILE_STRING : base { \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1829 | using char_type FMT_MAYBE_UNUSED = fmt::remove_cvref_t<decltype(s[0])>; \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1830 | FMT_MAYBE_UNUSED FMT_CONSTEXPR explicit \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1831 | operator fmt::basic_string_view<char_type>() const { \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1832 | return fmt::detail_exported::compile_string_to_view<char_type>(s); \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1833 | } \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1834 | }; \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1835 | return FMT_COMPILE_STRING(); \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1836 | }()

@lgritz

lgritz commented Feb 2, 2026

Copy link
Copy Markdown
Collaborator

Hi, Fabien. Thanks for following up on this. This looks fine to me, but it needs DCO signoff, CLA, and probably should be rebased on top of the current main just to be sure there are no conflicts and to pick up other changes that may be breaking CI.

@lgritz

lgritz commented Feb 2, 2026

Copy link
Copy Markdown
Collaborator

Fabien, can you clarify: Was the solution all along simply that we needed the /utf-8? Is the upgrade to a more recent fmt version still an important part of the solution? Should we not only update the default that we auto-build, but also enforce a higher minimum fmt version on Windows? And if so, what's the minimum version -- is 12.0 the earliest that will avoid the problem? Do you think there's an issue on any other platforms?

I can't merge your PR without the DCO and CLA fixed, but the change is so trivial that if you are unable to get the CLA taken care of (I know sometimes it can seem like too much work to fight the bureaucracy to get a CLA signed by an executive for a two-line fix), I think it's fine for me to just submit this myself as a separate PR.

@servantftransperfect

servantftransperfect commented Feb 3, 2026

Copy link
Copy Markdown
Contributor Author

Larry,

My original (personal) problem is to build on linux with clang 21. Look life format solved this bug in the following commit. As you can see, the first release after this commit is fmt 12.0.0.

Problem is, when running the CI, windows is failing and ask explicitely for this /utf-8 in the error log. I just added this flag to comply but i am NOT sure this has no side effects on OiiO.

As for the administrative stuff, feel free to do whatever you want, i have no interest on seeing my name somewhere.

Signed-off-by: Fabien Servant <100348063+servantftransperfect@users.noreply.github.com>
Signed-off-by: Fabien Servant <100348063+servantftransperfect@users.noreply.github.com>
@lgritz

lgritz commented Feb 10, 2026

Copy link
Copy Markdown
Collaborator

Closing -- superseded by #5039

@lgritz lgritz closed this Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build / testing / port / CI Affecting the build system, tests, platform support, porting, or continuous integration.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants