Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building justbuild fails with GCC 13.2 due to partial specialization of ‘struct fmt::v10::formatter<std::__cxx11::basic_string<...>> #43

Closed
mhthies opened this issue Aug 29, 2023 · 2 comments

Comments

@mhthies
Copy link
Contributor

mhthies commented Aug 29, 2023

I tried to change my Arch Linux package recipe to use GCC instead of Clang and ran into another {fmt}-related issue:

In file included from /usr/include/fmt/ostream.h:20,
                 from /home/michael/Documents/Freizeit/Programme/pkgbuild/justbuild/src/build/src/src/utils/cpp/json.hpp:25,
                 from /home/michael/Documents/Freizeit/Programme/pkgbuild/justbuild/src/build/src/src/buildtool/common/artifact_description.hpp:27,
                 from /home/michael/Documents/Freizeit/Programme/pkgbuild/justbuild/src/build/src/src/buildtool/build_engine/expression/target_result.hpp:23,
                 from /home/michael/Documents/Freizeit/Programme/pkgbuild/justbuild/src/build/src/src/buildtool/build_engine/expression/target_result.cpp:15:
/usr/include/fmt/format.h:4076:1: error: partial specialization of ‘struct fmt::v10::formatter<std::__cxx11::basic_string<_CharT>, Char>’ after instantiation of ‘struct fmt::v10::formatter<std::__cxx11::basic_string<char>, char, void>’ [-fpermissive]
 4076 | FMT_FORMAT_AS(std::basic_string<Char>, basic_string_view<Char>);
      | ^~~~~~~~~~~~~

(and many similar occurances; all of them caused by artifact_description.hpp being included somehow.)

This might be introduced by my patch (#42) and sounds similar to this issue: fmtlib/fmt#2769

I was able to fully fix the problem by replacing the #include "fmt/core.h" with #include "fmt/format.h" in logger.hpp.

Tested with fmt 10.1.0.

@spc90
Copy link
Collaborator

spc90 commented Sep 1, 2023

Hi @mhthies ! Thank you for your report.

We are currently having trouble reproducing this in our pipelines. The issue seems to be more related to fmtlib/fmt#3584, which would explain also the temporary fix of reordering/replacing the include. We have bumped up our fmt version to 10.1.1 (commit f969ab6) which contains an upstream fix for this issue.

Could you please check if this solves it on your side?

@mhthies
Copy link
Contributor Author

mhthies commented Sep 1, 2023

Thanks for investigating this issue! :)

You are right: Updating to fmt 10.1.1 fixes the issue. Now, I'll only have to wait for the Arch Linux package maintainer to package this fmt version.

@mhthies mhthies closed this as completed Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants