Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 797649 - gui-apps/waybar-0.9.7 with dev-libs/libfmt-8.0.0-r1 - ../Waybar-0.9.7/include/util/format.hpp:38:42: error: no matching function for call to ‘parse_nonnegative_int(const char*&, const char*&, fmt::v7::basic_format_parse_context<char>&)’
Summary: gui-apps/waybar-0.9.7 with dev-libs/libfmt-8.0.0-r1 - ../Waybar-0.9.7/include...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Jonas Toth
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2021-06-22 21:03 UTC by Dennis Schridde
Modified: 2021-07-17 22:30 UTC (History)
10 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,46.54 KB, text/x-log)
2021-06-22 21:03 UTC, Dennis Schridde
Details
emerge --info waybar libfmt (emerge.info.log,9.50 KB, text/x-log)
2021-06-22 21:04 UTC, Dennis Schridde
Details
libfmt-8.patch (libfmt-8.0.patch,1.04 KB, patch)
2021-06-30 02:32 UTC, John Helmert III
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Schridde 2021-06-22 21:03:44 UTC
Created attachment 717735 [details]
build.log

FAILED: waybar.p/src_modules_disk.cpp.o                                                                                                                                                                                                                                                                                                                                     
x86_64-pc-linux-gnu-g++ -Iwaybar.p -I. -I../Waybar-0.9.7 -I../Waybar-0.9.7/include -Iprotocol -I/usr/lib64/libffi/include -I/usr/include/sigc++-2.0 -I/usr/lib64/sigc++-2.0/include -I/usr/include/jsoncpp -I/usr/include/gtkmm-3.0 -I/usr/lib64/gtkmm-3.0/include -I/usr/include/atkmm-1.6 -I/usr/lib64/atkmm-1.6/include -I/usr/include/gtk-3.0/unix-print -I/usr/include/gdkmm-3.0 -I/usr/lib64/gdkmm-3.0/include -I/usr/include/giomm-2.4 -I/usr/lib64/giomm-2.4/include -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/atk-1.0 -I/usr/include/pangomm-1.4 -I/usr/lib64/pangomm-1.4/include -I/usr/include/glibmm-2.4 -I/usr/lib64/glibmm-2.4/include -I/usr/include/cairomm-1.0 -I/usr/lib64/cairomm-1.0/include -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/fribidi -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/libdbusmenu-gtk3-0.4 -I/usr/include/libdbusmenu-glib-0.4 -I/usr/include/libnl3 -I/usr/include/gtk-layer-shell -I/usr/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++17 '-DVERSION="0.9.7"' -DHAVE_LANGINFO_1STDAY '-DSYSCONFDIR="//etc"' -DHAVE_CPU_LINUX -DHAVE_MEMORY_LINUX -DHAVE_SWAY -DHAVE_WLR -DHAVE_RIVER -DHAVE_LIBNL -DHAVE_LIBPULSE -DHAVE_DBUSMENU -DHAVE_LIBUDEV -DHAVE_GTK_LAYER_SHELL -DWANT_RFKILL -DHAVE_LIBDATE -pipe -O2 -march=znver1 -DONLY_C_LOCALE=0 -DUSE_OS_TZDB=1 -pthread -D_REENTRANT -DSPDLOG_SHARED_LIB -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -MD -MQ waybar.p/src_modules_disk.cpp.o -MF waybar.p/src_modules_disk.cpp.o.d -o waybar.p/src_modules_disk.cpp.o -c ../Waybar-0.9.7/src/modules/disk.cpp                                                                                                                                                                                                                                                                  
In file included from ../Waybar-0.9.7/include/modules/disk.hpp:8,                                                                                                                                                                                                                                                                                                                            from ../Waybar-0.9.7/src/modules/disk.cpp:1:                                                                                                                         
../Waybar-0.9.7/include/util/format.hpp: In instantiation of ‘constexpr decltype (ctx.begin()) fmt::v7::formatter<pow_format>::parse(ParseContext&) [with ParseContext = fmt::v7::basic_format_parse_context<char>; decltype (ctx.begin()) = const char*]’:
/usr/include/fmt/core.h:1196:33:   required from ‘static void fmt::v7::detail::value<Context>::format_custom_arg(const void*, typename Context::parse_context_type&, Context&) [with T = pow_format; Formatter = fmt::v7::formatter<pow_format>; Context = fmt::v7::basic_format_context<fmt::v7::appender, char>; typename Context::parse_context_type = fmt::v7::basic_format_parse_context<char>]’                                                                                                                                                             
/usr/include/fmt/core.h:1183:19:   required from ‘constexpr fmt::v7::detail::value<Context>::value(const T&) [with T = pow_format; Context = fmt::v7::basic_format_context<fmt::v7::appender, char>]’
/usr/include/fmt/core.h:1582:14:   required from ‘constexpr fmt::v7::detail::value<Context> fmt::v7::detail::make_arg(const T&) [with bool IS_PACKED = true; Context = fmt::v7::basic_format_context<fmt::v7::appender, char>; fmt::v7::detail::type <anonymous> = fmt::v7::detail::type::custom_type; T = fmt::v7::detail::named_arg<char, pow_format>; typename std::enabl
e_if<IS_PACKED, int>::type <anonymous> = 0]’
/usr/include/fmt/core.h:1705:64:   required from ‘constexpr fmt::v7::format_arg_store<Context, Args>::format_arg_store(const Args& ...) [with Context = fmt::v7::basic_format_context<fmt::v7::appender, char>; Args = {long unsigned int, fmt::v7::detail::named_arg<char, pow_format>, fmt::v7::detail::named_arg<char, long unsigned int>, fmt::v7::detail::named_arg<cha
r, pow_format>, fmt::v7::detail::named_arg<char, long unsigned int>, fmt::v7::detail::named_arg<char, pow_format>, fmt::v7::detail::named_arg<char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >}]’                                                                                                                                    
/usr/include/fmt/core.h:1721:18:   required from ‘constexpr fmt::v7::format_arg_store<Context, Args ...> fmt::v7::make_format_args(const Args& ...) [with Context = fmt::v7::basic_format_context<fmt::v7::appender, char>; Args = {long unsigned int, fmt::v7::detail::named_arg<char, pow_format>, fmt::v7::detail::named_arg<char, long unsigned int>, fmt::v7::detail::n
amed_arg<char, pow_format>, fmt::v7::detail::named_arg<char, long unsigned int>, fmt::v7::detail::named_arg<char, pow_format>, fmt::v7::detail::named_arg<char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >}]’                                                                                                                        
/usr/include/fmt/core.h:2890:44:   required from ‘std::string fmt::v7::format(fmt::v7::format_string<T ...>, T&& ...) [with T = {long unsigned int, fmt::v7::detail::named_arg<char, pow_format>, fmt::v7::detail::named_arg<char, long unsigned int>, fmt::v7::detail::named_arg<char, pow_format>, fmt::v7::detail::named_arg<char, long unsigned int>, fmt::v7::detail::named_arg<char, pow_format>, fmt::v7::detail::named_arg<char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >}; std::string = std::__cxx11::basic_string<char>; fmt::v7::format_string<T ...> = fmt::v7::basic_format_string<char, long unsigned int, fmt::v7::detail::named_arg<char, pow_format>, fmt::v7::detail::named_arg<char, long unsigned int>, fmt::v7::detail::named_arg<char, pow_format>, fmt::v7::detail::named_arg<char, long unsigned int>, fmt::v7::detail::named_arg<char, pow_format>, fmt::v7::detail::named_arg<char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >]’
../Waybar-0.9.7/src/modules/disk.cpp:62:34:   required from here
../Waybar-0.9.7/include/util/format.hpp:38:42: error: no matching function for call to ‘parse_nonnegative_int(const char*&, const char*&, fmt::v7::basic_format_parse_context<char>&)’
   38 |             width = parse_nonnegative_int(it, end, ctx);
      |                     ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
In file included from /usr/include/fmt/format.h:44,
                 from ../Waybar-0.9.7/include/modules/disk.hpp:3,
                 from ../Waybar-0.9.7/src/modules/disk.cpp:1:                                                                                                                         
/usr/include/fmt/core.h:2107:20: note: candidate: ‘template<class Char> constexpr int fmt::v7::detail::parse_nonnegative_int(const Char*&, const Char*, int)’
 2107 | FMT_CONSTEXPR auto parse_nonnegative_int(const Char*& begin, const Char* end,
      |                    ^~~~~~~~~~~~~~~~~~~~~        
/usr/include/fmt/core.h:2107:20: note:   template argument deduction/substitution failed:
In file included from ../Waybar-0.9.7/include/modules/disk.hpp:8,                                                                                                                     
                 from ../Waybar-0.9.7/src/modules/disk.cpp:1:                              
../Waybar-0.9.7/include/util/format.hpp:38:42: note:   cannot convert ‘ctx’ (type ‘fmt::v7::basic_format_parse_context<char>’) to type ‘int’
   38 |             width = parse_nonnegative_int(it, end, ctx);                                                                                                                      
      |                     ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
Comment 1 Dennis Schridde 2021-06-22 21:04:24 UTC
Created attachment 717738 [details]
emerge --info waybar libfmt
Comment 2 Jonas Toth 2021-06-23 10:15:20 UTC
The issue seems to be the update of fmt-lib to version 8.0, released 2 days ago.
https://github.com/fmtlib/fmt/releases/tag/8.0.0

With this release some functions have been removed.

waybar needs to use the 7 releases for fmt-lib until that is resolved.
Comment 3 Jonas Toth 2021-06-23 19:26:01 UTC
I contacted the maintainer of libfmt as I am unsure on how to resolve the issue best.

libfmt changed some interfaces and removed deprecated functionality.
So having libfmt-8.0.0 is probably not compatible with libfmt-7.x.x. The library is not slotted and both version can not live next to each other right now.

I am unsure on how to proceed to resolve the issue.

@Dennis a short-term solution would be masking libfmt-8.0.0 locally.
Comment 4 Ionen Wolkens gentoo-dev 2021-06-23 19:53:48 UTC
(In reply to Jonas Toth from comment #3)
> libfmt changed some interfaces and removed deprecated functionality.
> So having libfmt-8.0.0 is probably not compatible with libfmt-7.x.x. The
> library is not slotted and both version can not live next to each other
> right now.
> 
> I am unsure on how to proceed to resolve the issue.

For starters, has this been reported to the waybar upstream yet? Continued use of deprecated features sound like something they should fix.
Comment 5 Jonas Toth 2021-06-23 21:16:01 UTC
> For starters, has this been reported to the waybar upstream yet? Continued
> use of deprecated features sound like something they should fix.

I did not (yet). The code is still valid for libfmt-7.0.0 and when compiling it does not show deprecation-warnings, so i think it is more an implicit dependency problem.

But I did not have time to investigate this in detail. Once this is done, I would like to create a good bug-report describing the problem and maybe even work on a fix, if this needs a fix in waybar.
But for now, the libfmt-8 needs to be blocked.

I am unsure how to do that on subslot-basis. The libfmt-ebuild only defines subslots for all versions.

Does something like this work or is this bad style? If so, what would be better?
```
    >=dev-libs/libfmt-5.3.0:=
    !>=dev-libs/libfmt-8.0.0
```
Comment 6 Craig Andrews gentoo-dev 2021-06-24 01:11:53 UTC
I think this may be due to https://github.com/fmtlib/fmt/issues/2363 which is also experienced in Kodi, see bug 797619. I believe that adding:
#include <fmt/xchar.h>
at https://github.com/Alexays/Waybar/blob/0.9.7/include/util/format.hpp#L3
will fix this problem.

Perhaps you could try that?
Comment 7 Dennis Schridde 2021-06-24 06:46:22 UTC
(In reply to Craig Andrews from comment #6)
> I think this may be due to https://github.com/fmtlib/fmt/issues/2363 which
> is also experienced in Kodi, see bug 797619. I believe that adding:
> #include <fmt/xchar.h>
> at https://github.com/Alexays/Waybar/blob/0.9.7/include/util/format.hpp#L3
> will fix this problem.
> 
> Perhaps you could try that?

I just tried:

# cat /etc/portage/patches/gui-apps/waybar-0.9.7/waybar-0.9.7-fix-libfmt-8-compat.patch 
--- Waybar-0.9.7/include/util/format.hpp.orig   2021-06-24 08:39:18.596813035 +0200
+++ Waybar-0.9.7/include/util/format.hpp        2021-06-24 08:39:39.139663158 +0200
@@ -1,6 +1,7 @@
 #pragma once
 
 #include <fmt/format.h>
+#include <fmt/xchar.h>
 
 class pow_format {
   public:

It does not help, the error stays the same:

cannot convert ‘ctx’ (type ‘fmt::v7::basic_format_parse_context<char>’) to type ‘int’
Comment 8 vicalcas 2021-06-26 11:19:59 UTC
Linked this bug report upstream, hope it gets noticed.
Comment 9 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2021-06-30 02:32:59 UTC
Created attachment 720255 [details, diff]
libfmt-8.patch

This patch works for me. It may work for others, but I have no idea what I'm doing in C++.
Comment 10 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2021-06-30 02:44:45 UTC
(In reply to John Helmert III from comment #9)
> Created attachment 720255 [details, diff] [details, diff]
> libfmt-8.patch
> 
> This patch works for me. It may work for others, but I have no idea what I'm
> doing in C++.

Submitted upstream, maybe they'll like it:

https://github.com/Alexays/Waybar/pull/1144
Comment 11 Jonas Toth 2021-07-02 12:50:27 UTC
Thank you all for the help so far!

There are two issues:

1. Waybar itself had one formatter that is broken
2. Waybar uses spdlog that does not work with libfmt-8.0 (fix is not released yet)

[1] The patch for Waybar is here: https://github.com/Alexays/Waybar/pull/1144/files

[2] There is the patched version of spdlog (1.8.5-r1 in the tree)
[2] https://github.com/gabime/spdlog/issues/1975

Both fixes are required to compile waybar.
I verified that waybar still builds with old version (0.9.5 with spdlog 1.8.2 and fmt-7.1.3) and the new versions, they do.

I am creating a PR waybar-0.9.{5,7}. Upstream Waybar should include the patch soon, as the PR is already created and pretty much accepted (if I understood correctly).
Comment 12 Jonas Toth 2021-07-02 12:57:09 UTC
PR: https://github.com/gentoo/gentoo/pull/21506
Comment 13 Larry the Git Cow gentoo-dev 2021-07-12 15:02:07 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=209673f3c76e5589ba6776a81eab44a01daa0cc6

commit 209673f3c76e5589ba6776a81eab44a01daa0cc6
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2021-07-12 10:21:02 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2021-07-12 14:59:15 +0000

    gui-apps/waybar: fix build with libfmt-8
    
    Backport of the upstreamed fix.
    
    (no real credit goes to me, only adjusted PR with maintainer's ack)
    
    Closes: https://bugs.gentoo.org/797649
    Closes: https://github.com/gentoo/gentoo/pull/21506
    Signed-off-by: Jonas Toth <gentoo@jonas-toth.eu>
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 gui-apps/waybar/files/waybar-0.9.7-libfmt-8.patch | 32 +++++++++++++++++++++++
 gui-apps/waybar/waybar-0.9.5-r1.ebuild            |  4 +++
 gui-apps/waybar/waybar-0.9.7-r1.ebuild            |  4 +++
 3 files changed, 40 insertions(+)
Comment 14 Jonas Toth 2021-07-17 12:35:55 UTC
Thank you all for your help and time!
I hope the issue is now fixed for everyone.
Comment 15 Bearcat M. Şándor 2021-07-17 22:30:54 UTC
(In reply to Jonas Toth from comment #14)
> Thank you all for your help and time!
> I hope the issue is now fixed for everyone.

Yes! It's fixed for me. Thank you!