After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 792068 - Make it work with Flatpak
Make it work with Flatpak
Status: RESOLVED FIXED
Product: devhelp
Classification: Applications
Component: General
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: devhelp-maint
devhelp-maint
Depends on:
Blocks:
 
 
Reported: 2017-12-30 16:27 UTC by Sébastien Wilmet
Modified: 2018-01-12 20:26 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sébastien Wilmet 2017-12-30 16:27:23 UTC
When the Devhelp application is launched with Flatpak, by default no books are found, it is empty, which is a bit sad.

It should instead find the books installed on the host (e.g. installed with traditional Linux distro packages).

See the populate() function in DhBookManager, it searches books in g_get_user_data_dir() and g_get_system_data_dirs(), at least that's what it does in 2017. Inside Flatpak those functions probably return something different.
Comment 1 Sébastien Wilmet 2018-01-11 07:02:56 UTC
Here is the list of data dirs inside Flatpak:
/home/seb/.var/app/org.gnome.Devhelp/data
/app/share
/usr/share
/usr/share/runtime/share
/run/host/share

After installing org.gnome.Sdk.Docs, inside the Flatpak sandbox we see its documentation in /usr/share/gtk-doc/html/. But the content of that directory is different than on the host. Inside the Flatpak sandbox, /usr/share/gtk-doc/html is actually a symbolic link to /usr/share/runtime/docs/gtk-doc/html.

So currently with Devhelp-Flatpak, we can see the docs of org.gnome.Sdk.Docs if installed. But not the documentation installed on the host (system-wide).
Comment 2 Sébastien Wilmet 2018-01-11 07:37:06 UTC
If --filesystem=host is added to the flatpak build-finish args, then the documentation which is available on the host in /usr/share/gtk-doc/html/, is available inside the Flatpak sandbox in /run/host/usr/share/gtk-doc/html/.

But g_get_system_data_dirs() inside Flatpak doesn't return /run/host/usr/share.
Comment 3 Sébastien Wilmet 2018-01-11 08:42:59 UTC
I've filed: https://github.com/flatpak/flatpak/issues/1299

Comment from TingPing:
> Personally I don't think this is behavior that should be used in practice, host
> state is exactly what Flatpak's shouldn't be using, host is just a workaround to
> keep applications working and not desired behavior IMO.

To solve that problem longer-term, there is for example bug #761284. When Devhelp will download API docs, it can save them in a location accessible from Flatpak.
Comment 4 Sébastien Wilmet 2018-01-11 16:25:08 UTC
OK so it's normal that XDG_DATA_DIRS doesn't contain /run/host/usr/share, see the flatpak issue.

It's quite easy in DhBookManager to find books in one more datadir, with the path hard-coded. This could be enabled with a compile-time configuration option (--enable-flatpak for example).
Comment 5 Sébastien Wilmet 2018-01-12 20:26:19 UTC
Done: commit 011f46edfce6d16860cfa2724a3174e28e622def