diff mbox series

[bug#56382] gnu: gajim: Use hicolor-icon-theme to avoid crashing on startup

Message ID DM5PR03MB31633E3B8D7FB6CF9CD13BE5C5BE9@DM5PR03MB3163.namprd03.prod.outlook.com
State New
Headers show
Series [bug#56382] gnu: gajim: Use hicolor-icon-theme to avoid crashing on startup | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Morgan Smith July 4, 2022, 1:43 p.m. UTC
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(+)

Comments

Ludovic Courtès July 12, 2022, 10:15 p.m. UTC | #1
Hi Morgan,

(+Cc: Raghav.)

Morgan.J.Smith@outlook.com skribis:

> 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:

--8<---------------cut here---------------start------------->8---
$ 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)
--8<---------------cut here---------------end--------------->8---

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

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?

Thanks,
Ludo’.
Raghav Gururajan July 13, 2022, 8:54 a.m. UTC | #2
Ludo,

> 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?

Regards,
RG.
Raghav Gururajan July 13, 2022, 4:06 p.m. UTC | #3
Ludo,

>> 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 
[https://ci.guix.gnu.org/build/1099363/log/raw]. This time its a 
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.
Ludovic Courtès July 15, 2022, 1:02 p.m. UTC | #4
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?

>> 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’.
Maxim Cournoyer July 16, 2022, 1:38 a.m. UTC | #5
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.

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
Ludovic Courtès July 18, 2022, 9:29 a.m. UTC | #6
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’.
Maxim Cournoyer July 18, 2022, 11:21 a.m. UTC | #7
Hello!

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

[...]

>>> 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]

[0]  https://issues.guix.gnu.org/20255#35

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
Bengt Richter July 18, 2022, 1:33 p.m. UTC | #8
Hi Ludo,

On +2022-07-18 11:29:55 +0200, Ludovic Courtès wrote:
> 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
Raghav Gururajan July 18, 2022, 3:19 p.m. UTC | #9
Ludo,

>> 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.
Ludovic Courtès July 19, 2022, 8:29 a.m. UTC | #10
Hi,

bokr@bokr.com skribis:

> 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’.
diff mbox series

Patch

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)