I did some investigation in why the skype snap, both latest
and insider
channels, doesn’t work with ibus on my Focal box. The problem has annoyed me for quite awhile. Actually it also doesn’t work with fcitx on 19.10 and 20.04 but I didn’t look deep into what’s wrong. Below are my findings after I’ve done a lot of snap try
.
First I run the skype binary directly, because it can show the exact errors:
$ /snap/skype/current/usr/share/skypeforlinux/skypeforlinux
[...]
(skypeforlinux:944077): Gtk-WARNING **: 19:18:26.196: /lib/x86_64-linux-gnu/libibus-1.0.so.5: undefined symbol: g_get_language_names_with_category
(skypeforlinux:944077): Gtk-WARNING **: 19:18:26.196: Loading IM context type 'ibus' failed
There is a version check in ibus that g_get_language_names_with_category
is only called if glib >= 2.58: https://github.com/ibus/ibus/blob/master/src/ibusenginesimple.c#L1796
However, glib in Bionic is 2.56 and is used in the snap, this version doesn’t have this symbol. This is an incompatibility between host’s libibus and snap’s glib.
As there is no libibus in the snap, I tried putting Bionic’s libibus shared object into the snap, then I got another error:
$ /snap/skype/current/usr/share/skypeforlinux/skypeforlinux
[...]
(skypeforlinux:967589): Gtk-WARNING **: 19:44:00.867: /usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules/im-ibus.so: undefined symbol: ibus_input_context_set_client_commit_preedit
(skypeforlinux:967589): Gtk-WARNING **: 19:44:00.867: Loading IM context type 'ibus' failed
So im-ibus immodule on the host is used. I performed the following steps to make ibus fully work:
-
Copy Bionic’s
im-ibus.so
to$SNAP/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules/im-ibus.so
(it’s absent in the snap) -
Make a copy of
immodules.cache
to$SNAP/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules.cache
and edit the paths in the file to point to files in the snap. -
In
$SNAP/bin/electron-launch
, add the following section before the lineexport HOME=$SNAP_USER_COMMON
:export GTK_IM_MODULE_FILE=$SNAP/usr/lib/$ARCH/gtk-3.0/3.0.0/immodules.cache
IBUS_BUS=$SNAP_USER_COMMON/.config/ibus/bus
[ -d $IBUS_BUS -a ! -L $IBUS_BUS ] && rmdir $IBUS_BUS
ln -sf $HOME/.config/ibus/bus/ $SNAP_USER_COMMON/.config/ibus/bus
I’m not sure if this is a snapd or snapcraft bug, because everything above can be fixed in the snap itself. May be once the skype snap is confined the problems will go away, but before that happens I wish Skype snap developers can take a look.