[PATCH] gnu: gajim: Use hicolor-icon-theme to avoid crashing on startup

  • Open
  • quality assurance status badge
Details
5 participants
  • Morgan.J.Smith
  • bokr
  • Ludovic Courtès
  • Maxim Cournoyer
  • Raghav Gururajan
Owner
unassigned
Submitted by
Morgan.J.Smith
Severity
normal
M
M
Morgan.J.Smith wrote on 4 Jul 2022 15:43
(address . guix-patches@gnu.org)(name . Morgan Smith)(address . Morgan.J.Smith@outlook.com)
DM5PR03MB31633E3B8D7FB6CF9CD13BE5C5BE9@DM5PR03MB3163.namprd03.prod.outlook.com
From: Morgan Smith <Morgan.J.Smith@outlook.com>

* gnu/packages/messaging.scm (gajim)[inputs]: Add hicolor-icon-theme
---

So on my system gajim crashes saying something like "icon not present in the
theme Adwaita". I have installed Adwaita system wide. Looking in the gajim
build dir at
'/gnu/store/...-gajim-1.4.5/lib/python3.9/site-packages/gajim/data/icons/'
shows that the icons are stored in a 'hicolor' directory. The proper solution
is to either figure out how to install the icons in a theme independent way or
to notify upstream

gnu/packages/messaging.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index a9906bfd29..1efcce21d5 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -1270,6 +1270,7 @@ (define-public gajim
("gtk+" ,gtk+)
("gtksourceview" ,gtksourceview)
("gupnp-igd" ,gupnp-igd)
+ ("hicolor-icon-theme" ,hicolor-icon-theme)
("libappindicator" ,libappindicator)
("libnice" ,libnice)
("libsecret" ,libsecret)
--
2.36.1
L
L
Ludovic Courtès wrote on 13 Jul 2022 00:15
(address . Morgan.J.Smith@outlook.com)
87sfn6asfz.fsf@gnu.org
Hi Morgan,

(+Cc: Raghav.)

Morgan.J.Smith@outlook.com skribis:

Toggle quote (13 lines)
> From: Morgan Smith <Morgan.J.Smith@outlook.com>
>
> * gnu/packages/messaging.scm (gajim)[inputs]: Add hicolor-icon-theme
> ---
>
> So on my system gajim crashes saying something like "icon not present in the
> theme Adwaita". I have installed Adwaita system wide. Looking in the gajim
> build dir at
> '/gnu/store/...-gajim-1.4.5/lib/python3.9/site-packages/gajim/data/icons/'
> shows that the icons are stored in a 'hicolor' directory. The proper solution
> is to either figure out how to install the icons in a theme independent way or
> to notify upstream

I can reproduce the problem with:

Toggle snippet (30 lines)
$ guix describe
Generation 221 Jul 03 2022 23:52:07 (current)
guix e069de4
repository URL: https://git.savannah.gnu.org/git/guix.git
branch: master
commit: e069de452a2c923868f5137421b4b6349c38d754
$ guix shell -CN -E DISPLAY gajim -- gajim
[…]
(org.gajim.Gajim:1): Gtk-WARNING **: 22:04:37.615: Could not find the icon 'org.gajim.Gajim-symbolic'. The 'hicolor' theme
was not found either, perhaps you need to install it.
You can get a copy from:
http://icon-theme.freedesktop.org/releases
Traceback (most recent call last):
File "/gnu/store/b3c4lsfl0swzyk0ylkvbjz2lk28caxrl-gajim-1.4.5/lib/python3.9/site-packages/gajim/gtk/application.py", line 389, in _handle_local_options
self._startup()
File "/gnu/store/b3c4lsfl0swzyk0ylkvbjz2lk28caxrl-gajim-1.4.5/lib/python3.9/site-packages/gajim/gtk/application.py", line 278, in _startup
MainWindow()
File "/gnu/store/b3c4lsfl0swzyk0ylkvbjz2lk28caxrl-gajim-1.4.5/lib/python3.9/site-packages/gajim/gtk/main.py", line 85, in __init__
self._main_stack = MainStack()
File "/gnu/store/b3c4lsfl0swzyk0ylkvbjz2lk28caxrl-gajim-1.4.5/lib/python3.9/site-packages/gajim/gtk/main_stack.py", line 45, in __init__
self._chat_page = ChatPage()
File "/gnu/store/b3c4lsfl0swzyk0ylkvbjz2lk28caxrl-gajim-1.4.5/lib/python3.9/site-packages/gajim/gtk/chat_page.py", line 60, in __init__
self._chat_stack = ChatStack()
File "/gnu/store/b3c4lsfl0swzyk0ylkvbjz2lk28caxrl-gajim-1.4.5/lib/python3.9/site-packages/gajim/gtk/chat_stack.py", line 48, in __init__
self.add_named(ChatPlaceholderBox(), 'empty')
File "/gnu/store/b3c4lsfl0swzyk0ylkvbjz2lk28caxrl-gajim-1.4.5/lib/python3.9/site-packages/gajim/gtk/chat_stack.py", line 161, in __init__
pixbuf = Gtk.IconTheme.load_icon_for_scale(
gi.repository.GLib.GError: gtk-icon-theme-error-quark: Icon 'org.gajim.Gajim-symbolic' not present in theme Adwaita (0)

Does simply adding ‘hicolor-icon-theme’ to ‘inputs’ fix the issue?

Unfortunately, Gajim fails to build for me as described in

Raghav, what should we do about it? The issue above is closed, but are
we missing the fix?

Thanks,
Ludo’.
R
R
Raghav Gururajan wrote on 13 Jul 2022 10:54
(name . Ludovic Courtès)(address . ludo@gnu.org)
ff47ca4d7bfe0148f827dac382ca6211@raghavgururajan.name
Ludo,

Toggle quote (2 lines)
> Does simply adding ‘hicolor-icon-theme’ to ‘inputs’ fix the issue?

Most gtk-based apps expect hicolor-icon-theme and adwaita-icon-theme to be in the profile. Adding these in either system or user profile would prevent this error from occurring.

Toggle quote (6 lines)
> Unfortunately, Gajim fails to build for me as described in
> <https://dev.gajim.org/gajim/gajim/-/issues/10478>.
>
> Raghav, what should we do about it? The issue above is closed, but are
> we missing the fix?

That's odd. The upstream removed those obsolete test files which were causing the build failure. Could you please confirm the commit and system-architecture you tried to build on?

Regards,
RG.
R
R
Raghav Gururajan wrote on 13 Jul 2022 18:06
(name . Ludovic Courtès)(address . ludo@gnu.org)
bc00a04c-c7f2-e556-24e1-77b59df31b35@raghavgururajan.name
Ludo,
Toggle quote (11 lines)
>> Does simply adding ‘hicolor-icon-theme’ to ‘inputs’ fix the issue?
>
> Most gtk-based apps expect hicolor-icon-theme and adwaita-icon-theme to be in the profile. Adding these in either system or user profile would prevent this error from occurring.
>
>> Unfortunately, Gajim fails to build for me as described in
>> <https://dev.gajim.org/gajim/gajim/-/issues/10478>.
>>
>> Raghav, what should we do about it? The issue above is closed, but are
>> we missing the fix?
>
> That's odd. The upstream removed those obsolete test files which were causing the build failure. Could you please confirm the commit and system-architecture you tried to build on?
It appears the build fails on CI too
different test that is failing. But same as before, it passes on my
machine and probably passes on some other machines too. Pushed the fix
as commit 29980098508e1e23a767a7c91fe27f0478418eb2, and reported the
bug upstream.
Regards,
RG.
Attachment: OpenPGP_signature
L
L
Ludovic Courtès wrote on 15 Jul 2022 15:02
(name . Raghav Gururajan)(address . rg@raghavgururajan.name)
877d4e8r79.fsf@gnu.org
Hi,

"Raghav Gururajan" <rg@raghavgururajan.name> skribis:

Toggle quote (4 lines)
>> Does simply adding ‘hicolor-icon-theme’ to ‘inputs’ fix the issue?
>
> Most gtk-based apps expect hicolor-icon-theme and adwaita-icon-theme to be in the profile. Adding these in either system or user profile would prevent this error from occurring.

Right, so the proposed patch (adding ‘hicolor-icon-theme’ to ‘inputs’,
not ‘propagated-inputs’) shouldn’t make any difference I guess?

Toggle quote (8 lines)
>> Unfortunately, Gajim fails to build for me as described in
>> <https://dev.gajim.org/gajim/gajim/-/issues/10478>.
>>
>> Raghav, what should we do about it? The issue above is closed, but are
>> we missing the fix?
>
> That's odd. The upstream removed those obsolete test files which were causing the build failure. Could you please confirm the commit and system-architecture you tried to build on?

I retried and this time it passed. Perhaps it’s non-deterministic?
Maybe has to do with running tests in parallel?

Thanks,
Ludo’.
M
M
Maxim Cournoyer wrote on 16 Jul 2022 03:38
Re: [bug#56382] [PATCH] gnu: gajim: Use hicolor-icon-theme to avoid crashing on startup
(name . Ludovic Courtès)(address . ludo@gnu.org)
87tu7hsupr.fsf@gmail.com
Hi Ludovic,

Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (11 lines)
> Hi,
>
> "Raghav Gururajan" <rg@raghavgururajan.name> skribis:
>
>>> Does simply adding ‘hicolor-icon-theme’ to ‘inputs’ fix the issue?
>>
>> Most gtk-based apps expect hicolor-icon-theme and adwaita-icon-theme to be in the profile. Adding these in either system or user profile would prevent this error from occurring.
>
> Right, so the proposed patch (adding ‘hicolor-icon-theme’ to ‘inputs’,
> not ‘propagated-inputs’) shouldn’t make any difference I guess?

I think it works as inputs because of our wrappers (perhaps
XDG_DATA_DIRS)? But it's kind at odds with our policy which is to let
users manage icons themselves.

Probably because of #20255 that wouldn't help currently (system and user
profiles are not merged), but if we fixed that bug we could make the
situation better by adding 'hicolor-icon-theme' to the default packages
of our desktop system templates.

Thanks,

Maxim
L
L
Ludovic Courtès wrote on 18 Jul 2022 11:29
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
87k08a3h0s.fsf@gnu.org
Hi,

Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:

Toggle quote (19 lines)
> Hi Ludovic,
>
> Ludovic Courtès <ludo@gnu.org> writes:
>
>> Hi,
>>
>> "Raghav Gururajan" <rg@raghavgururajan.name> skribis:
>>
>>>> Does simply adding ‘hicolor-icon-theme’ to ‘inputs’ fix the issue?
>>>
>>> Most gtk-based apps expect hicolor-icon-theme and adwaita-icon-theme to be in the profile. Adding these in either system or user profile would prevent this error from occurring.
>>
>> Right, so the proposed patch (adding ‘hicolor-icon-theme’ to ‘inputs’,
>> not ‘propagated-inputs’) shouldn’t make any difference I guess?
>
> I think it works as inputs because of our wrappers (perhaps
> XDG_DATA_DIRS)? But it's kind at odds with our policy which is to let
> users manage icons themselves.

Yeah.

Toggle quote (5 lines)
> Probably because of #20255 that wouldn't help currently (system and user
> profiles are not merged), but if we fixed that bug we could make the
> situation better by adding 'hicolor-icon-theme' to the default packages
> of our desktop system templates.

Right.

BTW, the reason the solution at https://issues.guix.gnu.org/20255#12
was rejected could be revisited. Since that time, search paths made it
into the manifest itself, which brings a speed up:

Toggle snippet (13 lines)
$ sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches '
$ time guix package -p ~/.guix-home/profile -p /run/current-system/profile --search-paths > /dev/null

real 0m0.540s
user 0m0.131s
sys 0m0.063s
$ time guix package -p ~/.guix-home/profile -p /run/current-system/profile --search-paths > /dev/null

real 0m0.135s
user 0m0.130s
sys 0m0.024s

Thoughts?

Ludo’.
M
M
Maxim Cournoyer wrote on 18 Jul 2022 13:21
(name . Ludovic Courtès)(address . ludo@gnu.org)
87edyism2j.fsf@gmail.com
Hello!

Ludovic Courtès <ludo@gnu.org> writes:

[...]

Toggle quote (34 lines)
>>> Right, so the proposed patch (adding ‘hicolor-icon-theme’ to ‘inputs’,
>>> not ‘propagated-inputs’) shouldn’t make any difference I guess?
>>
>> I think it works as inputs because of our wrappers (perhaps
>> XDG_DATA_DIRS)? But it's kind at odds with our policy which is to let
>> users manage icons themselves.
>
> Yeah.
>
>> Probably because of #20255 that wouldn't help currently (system and user
>> profiles are not merged), but if we fixed that bug we could make the
>> situation better by adding 'hicolor-icon-theme' to the default packages
>> of our desktop system templates.
>
> Right.
>
> BTW, the reason the solution at <https://issues.guix.gnu.org/20255#12>
> was rejected could be revisited. Since that time, search paths made it
> into the manifest itself, which brings a speed up:
>
> $ sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches '
> $ time guix package -p ~/.guix-home/profile -p /run/current-system/profile --search-paths > /dev/null
>
> real 0m0.540s
> user 0m0.131s
> sys 0m0.063s
> $ time guix package -p ~/.guix-home/profile -p /run/current-system/profile --search-paths > /dev/null
>
> real 0m0.135s
> user 0m0.130s
> sys 0m0.024s
>
> Thoughts?

Re-reading the bug report, we had come up with a blueprint of a possible
solution but failed short of implementing it [0]


Even the --search-paths command become 0.2 s, I don't think it'll
satisfy all parties, so the solution above still has merit, I think.
Perhaps we should try to implement it, unless you see a problem with it.

Thanks,

Maxim
B
Re: bug#20255: [bug#56382] [PATCH] gnu: gajim: Use hicolor-icon-theme to avoid crashing on startup
(name . Ludovic Courtès)(address . ludo@gnu.org)
20220718133318.GA2771@LionPure
Hi Ludo,

On +2022-07-18 11:29:55 +0200, Ludovic Courtès wrote:
Toggle quote (54 lines)
> Hi,
>
> Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:
>
> > Hi Ludovic,
> >
> > Ludovic Courtès <ludo@gnu.org> writes:
> >
> >> Hi,
> >>
> >> "Raghav Gururajan" <rg@raghavgururajan.name> skribis:
> >>
> >>>> Does simply adding ‘hicolor-icon-theme’ to ‘inputs’ fix the issue?
> >>>
> >>> Most gtk-based apps expect hicolor-icon-theme and adwaita-icon-theme to be in the profile. Adding these in either system or user profile would prevent this error from occurring.
> >>
> >> Right, so the proposed patch (adding ‘hicolor-icon-theme’ to ‘inputs’,
> >> not ‘propagated-inputs’) shouldn’t make any difference I guess?
> >
> > I think it works as inputs because of our wrappers (perhaps
> > XDG_DATA_DIRS)? But it's kind at odds with our policy which is to let
> > users manage icons themselves.
>
> Yeah.
>
> > Probably because of #20255 that wouldn't help currently (system and user
> > profiles are not merged), but if we fixed that bug we could make the
> > situation better by adding 'hicolor-icon-theme' to the default packages
> > of our desktop system templates.
>
> Right.
>
> BTW, the reason the solution at <https://issues.guix.gnu.org/20255#12>
> was rejected could be revisited. Since that time, search paths made it
> into the manifest itself, which brings a speed up:
>
> --8<---------------cut here---------------start------------->8---
> $ sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches '
> $ time guix package -p ~/.guix-home/profile -p /run/current-system/profile --search-paths > /dev/null
>
> real 0m0.540s
> user 0m0.131s
> sys 0m0.063s
> $ time guix package -p ~/.guix-home/profile -p /run/current-system/profile --search-paths > /dev/null
>
> real 0m0.135s
> user 0m0.130s
> sys 0m0.024s
> --8<---------------cut here---------------end--------------->8---
>
> Thoughts?
>
> Ludo’.

I'm sure you were just after a quick indication and know what can affect timing,
but I'm curious:

What would the above results be if you did the second timing
first, after a power down and cold start?

I'm guessing the kernel file systems are pretty clever about
caching stuff, especially if you have lots of ram :)

I.e., what cached state could the first timing have left for the second to profit from?

(I've been fooled maany times, benchmarking and timing :)

--
Regards,
Bengt Richter
R
R
Raghav Gururajan wrote on 18 Jul 2022 17:19
Re: [bug#56382] [PATCH] gnu: gajim: Use hicolor-icon-theme to avoid crashing on startup
(name . Ludovic Courtès)(address . ludo@gnu.org)
cef370c5-5239-2c74-77d5-fde7b085ceef@raghavgururajan.name
Ludo,
Toggle quote (6 lines)
>> Right, so the proposed patch (adding ‘hicolor-icon-theme’ to ‘inputs’,
>> not ‘propagated-inputs’) shouldn’t make any difference I guess?
>
> I think it works as inputs because of our wrappers (perhaps
> XDG_DATA_DIRS)? But it's kind at odds with our policy which is to let
> users manage icons themselves.
Yep, adding icons to inputs should work because of the wrappers. But the
reason Maxim mentioned, is why I haven't added icons to inputs in Gajim.
Regards,
RG.
Attachment: OpenPGP_signature
L
L
Ludovic Courtès wrote on 19 Jul 2022 10:29
Re: bug#20255: [bug#56382] [PATCH] gnu: gajim: Use hicolor-icon-theme to avoid crashing on startup
(address . bokr@bokr.com)
871quhwlmg.fsf@gnu.org
Hi,

bokr@bokr.com skribis:

Toggle quote (9 lines)
> I'm sure you were just after a quick indication and know what can affect timing,
> but I'm curious:
>
> What would the above results be if you did the second timing
> first, after a power down and cold start?
>
> I'm guessing the kernel file systems are pretty clever about
> caching stuff, especially if you have lots of ram :)

The ‘drop_caches’ command is meant to drop all caches, as if I were
doing it on a cold start.

Ludo’.
?