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

[Feature Request] Packaging IBus engines with flatpak #3019

Open
subins2000 opened this issue Jul 20, 2019 · 19 comments
Open

[Feature Request] Packaging IBus engines with flatpak #3019

subins2000 opened this issue Jul 20, 2019 · 19 comments

Comments

@subins2000
Copy link

@subins2000 subins2000 commented Jul 20, 2019

Linux distribution and version

Linux Mint 19 Tara

Flatpak version

Flatpak 1.0.8

Description of the problem

I'm trying to package this IBus engine. Here's the packaging repo. I gave enough permissions for the engine to connect to parent ibus-daemon but it fails :

GLib-GIO _g_io_module_get_default: Found default implementation local (GLocalVfs) for ?gio-vfs?
IBUS ibus_factory_new: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
GLib-GObject g_object_ref_sink: assertion 'G_IS_OBJECT (object)' failed
IBUS ibus_factory_add_engine: assertion 'IBUS_IS_FACTORY (factory)' failed
IBUS ibus_bus_call_sync: assertion 'ibus_bus_is_connected (bus)' failed

To test if it's a connection problem, I ran the default ibus-tmpl engine, but that also fails establishing a connection :

Traceback (most recent call last):
  File "main.py", line 121, in <module>
    main()
  File "main.py", line 118, in main
    launch_engine(exec_by_ibus)
  File "main.py", line 78, in launch_engine
    IMApp(exec_by_ibus).run()
  File "main.py", line 59, in __init__
    self.__factory = IBus.Factory.new(self.__bus.get_connection())
TypeError: Argument 0 does not allow None as a value

So it seems that it is failing in a connection to ibus. I read #675, perhaps flatpak is limiting the access of an engine ?

Does flatpak's implementation of ibus portal supports packaging an engine ?
Or am I doing it wrong ? Here are the permissions :

"finish-args": [
        "--share=ipc",
        "--own-name=org.freedesktop.IBus.EnchantPython",
        "--talk-name=org.freedesktop.DBus",
        "--talk-name=org.freedesktop.IBus",
        "--talk-name=org.freedesktop.portal.IBus",
        "--filesystem=xdg-run/dconf",
        "--filesystem=~/.config/dconf:ro",
        "--talk-name=ca.desrt.dconf",
        "--env=DCONF_USER_CONFIG_DIR=.config/dconf"
],
@AnwarShah
Copy link

@AnwarShah AnwarShah commented Aug 6, 2019

I have a similar problem, though I haven't started packaging yet

Loading

@subins2000
Copy link
Author

@subins2000 subins2000 commented Aug 11, 2019

@AnwarShah what problem do you face ? Is the debug/error message similar to this ?

Loading

@AnwarShah
Copy link

@AnwarShah AnwarShah commented Aug 13, 2019

I haven't gone to packaging. I am assessing whether it is possible to use flatpak for providing ibus engine to be used by system ibus.

Loading

@mominul
Copy link

@mominul mominul commented Aug 15, 2019

I am maintaining an iBus engine, so I am also interested in this issue.

Loading

@subins2000
Copy link
Author

@subins2000 subins2000 commented Aug 15, 2019

@mominul Nice to see there's a Bangla ibus engine :)

Can you try packaging yours ? Perhaps another set of eyes will help in making it work. I don't know C much and haven't got into the engine's code. I'm just trying to package it.

Loading

@mominul
Copy link

@mominul mominul commented Aug 15, 2019

@subins2000 Thanks for your appreciation!

But I want to know about is it possible to pack IMEs with Flatpak in the first place as IME(ibus engines) might require special permissions. I don't have enough knowledge of dbus or Flatpak to know if this is possible. It'd be great if a person familiar with Flatpak would help us.

cc @fujiwarat @matthiasclasen

Loading

@fujiwarat
Copy link

@fujiwarat fujiwarat commented Aug 21, 2019

Loading

@subins2000
Copy link
Author

@subins2000 subins2000 commented Aug 21, 2019

@fujiwarat This should included in the flatpak package ?

How do I know if I have it or not ? Is this a host thing or a package thing ?

Loading

@fujiwarat
Copy link

@fujiwarat fujiwarat commented Aug 22, 2019

ibus-portal is running in the host side. and sandbox also should include GTK IM module for IBus.
I mean old IBus version does not implement ibus-portal.

Loading

@subins2000
Copy link
Author

@subins2000 subins2000 commented Aug 25, 2019

@fujiwarat I'm using Ubuntu 18.04. Is ibus-portal installed from the default ibus package (ibus amd64 1.5.17-3ubuntu5) in official repos ? How do I know if it's running ?

How do I include GTK IM module in sandbox ? Any examples ?

Loading

@mominul
Copy link

@mominul mominul commented Aug 26, 2019

I think you have to use the latest version https://github.com/ibus/ibus/releases

Loading

@fujiwarat
Copy link

@fujiwarat fujiwarat commented Aug 26, 2019

ibus 1.5.17 has ibus-portal. You can check it's running with ps command.
You can find im-ibus.so with find command in your sandbox. E.g. org.freedesktop.Platform and org.gnome.Platform includes IBus GTK IM module.
If your application uses Atom applications, you need ibus 1.5.20 or later.

Loading

@subins2000
Copy link
Author

@subins2000 subins2000 commented Aug 27, 2019

@fujiwarat Just checked, I have 1.5.17, ibus-portal is running and the sandbox has im-ibus.so (org.freedesktop.Platform). But the error still comes. Here's the full output :

sh-4.4$ ./ibus-engine-varnam  --ibus -l ml -n "varnam.ml"
(null) varnamd is not running. Launching a new instance
GLib posix_spawn avoided (automatic reaping requested) (fd close requested) (null) Failed to start varnamd. Failed to execute child process ?varnamd? (No such file or directory)
(null) Failed to start varnamd. Sync will be disabled
GVFS-RemoteVolumeMonitor Error: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: org.freedesktop.DBus.Error.ServiceUnknown
GVFS cannot open directory /usr/share/gvfs/remote-volume-monitors: Error opening directory ?/usr/share/gvfs/remote-volume-monitors?: No such file or directoryGVFS org.gtk.vfs.MountTracker.listMountableInfo call failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: org.freedesktop.DBus.Error.ServiceUnknown (g-dbus-error-quark, 2)
GLib-GIO _g_io_module_get_default: Found default implementation local (GLocalVfs) for ?gio-vfs?IBUS ibus_factory_new: assertion 'G_IS_DBUS_CONNECTION (connection)' failedGLib-GObject g_object_ref_sink: assertion 'G_IS_OBJECT (object)' failedIBUS ibus_factory_add_engine: assertion 'IBUS_IS_FACTORY (factory)' failedIBUS ibus_bus_call_sync: assertion 'ibus_bus_is_connected (bus)' failed

Loading

@fujiwarat
Copy link

@fujiwarat fujiwarat commented Aug 28, 2019

Sorry, I misread your issue. You tries to package an ibus engine but not application.
IBus assumes to run IBus engines in the host side but not sandbox.
You can run applications in the sandbox.

Loading

@subins2000
Copy link
Author

@subins2000 subins2000 commented Aug 28, 2019

@fujiwarat so there's no way to package an IBus engine with flatpak ? Or any workarounds or something ?

Loading

@fujiwarat
Copy link

@fujiwarat fujiwarat commented Aug 28, 2019

There is no way and necessary for ibus engines.

Loading

@subins2000
Copy link
Author

@subins2000 subins2000 commented Aug 29, 2019

@fujiwarat It would be useful for packaging and distributing engines across various distros with ease. So I guess this issue would be a feature request for flatpak and IBus.

Loading

@subins2000 subins2000 changed the title Unable to establish a IBus connection [Feature Request] Packaging IBus engines with flatpak Aug 30, 2019
@fujiwarat
Copy link

@fujiwarat fujiwarat commented Sep 5, 2019

There is no reason to run ibus-daemon in host and engines in sandbox.

Loading

@TingPing
Copy link
Member

@TingPing TingPing commented Sep 5, 2019

Flatpak cannot install libs to the host so this isn't even a feature request for Flatpak. It seems this is just how ibus is designed and intended to work.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants