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

With --filesystem=host, XDG_DATA_DIRS doesn't include /run/host/usr/share #1299

Closed
ghost opened this issue Jan 11, 2018 · 5 comments
Closed

Comments

@ghost
Copy link

ghost commented Jan 11, 2018

Context: I'm trying to make Devhelp work with Flatpak, to see the API docs installed by traditional Linux distro packages, see:
https://bugzilla.gnome.org/show_bug.cgi?id=792068

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 when --filesystem=host is specified, XDG_DATA_DIRS inside Flatpak doesn't include /run/host/usr/share.

I've tried adding --env=XDG_DATA_DIRS=$XDG_DATA_DIRS:/run/host/usr/share to the build-finish args, but $XDG_DATA_DIRS is taken literally as a string, not a variable. The flatpak-build-finish manpage doesn't explain how to add a directory to an environment variable like XDG_DATA_DIRS.

@TingPing
Copy link
Member

TingPing commented Jan 11, 2018

You just make a wrapper script to set dynamic env vars.

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

@ghost
Copy link
Author

ghost commented Jan 11, 2018

The goal is to make Devhelp-Flatpak a bit more useful in the current state of the Devhelp implementation. It can require a lot of work (relative to the size of Devhelp) to make Devhelp a first-class Flatpak citizen. It'll still probably take several years.

When I set --filesystem=host, I expect Flatpak to automatically adjust XDG_DATA_DIRS to add /run/host/usr/share.

@TingPing
Copy link
Member

In the narrow case of Devhelp /run/host/usr/share may "just work" but in the scheme of all software that exists giving data files from a wrong prefix mounted in a different location is probably more likely to break than work.

@alexlarsson
Copy link
Member

Yeah, i understand where you're coming from, but all sorts of things will break if we add all host config to each app, which is totally opposite to the entire point of flatpak.

That said, if you verify that it works for your app then you can have a wrapper script that sets up the right env vars. But, i don't thing XDG_DATA_DIRS is the right thing, because all sorts of libraries will start reading files from there, like dconf, dbus, service files, mimetypes, etc. It would be preferable to have something that targeted just gtk-doc files.

@ghost
Copy link
Author

ghost commented Jan 11, 2018

OK, thanks for your answers. It's easy in Devhelp to add more hard-coded directories, and this can be done with a compile-time configuration option (--enable-flatpak for example).

@ghost ghost closed this as completed Jan 11, 2018
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants