[GNC-dev] flatpak environment.local

Chris Good goodchris96 at gmail.com
Sat May 8 03:29:35 EDT 2021


From: Geert Janssens <geert.gnucash at kobaltwit.be> 
Sent: Saturday, 8 May 2021 5:48 AM
To: 'Frank H. Ellenberger' <frank.h.ellenberger at gmail.com>;
gnucash-devel at gnucash.org
Cc: gnucash-devel at gnucash.org; Chris Good <goodchris96 at gmail.com>
Subject: Re: [GNC-dev] flatpak environment.local

 

Op maandag 26 april 2021 03:48:56 CEST schreef Chris Good:

> Hi Frank,

> 

> Your strace suggestion was successful thanks.

> I am using the flathub stable GnuCash flatpak.

> 

> 1. strace showed both environmentand & environment.local should be in

> /app/etc/gnucash to be read by GnuCash sandbox. Investigation shows that

> this comes from the host file system

> /var/lib/flatpak/app/org.gnucash.GnuCash/current/active/files/etc/gnucash.

> Sandbox /app/etc is HARD linked to host

> /var/lib/flatpak/app/org.gnucash.GnuCash/current/active/files/etc

> 

> This is the expected location for a flatpak that is for ALL users, but I

> thought I installed it just for my user. It turns out that the

> installation instructions in

> https://wiki.gnucash.org/wiki/Flatpak#Installation are wrong, at least for

> Ubuntu 20.04 flatpak 1.65. Our wiki says:

> # Install GnuCash ...

> ## for all users

> sudo flatpak install flathub org.gnucash.GnuCash

> ## or only you

> flatpak install flathub org.gnucash.GnuCash

> 

> but the Ubuntu man page says (my words):

> ## for all users

> flatpak install --system flathub org.gnucash.GnuCash

> ## or only you:

> flatpak install --user flathub org.gnucash.GnuCash

> And, although the man page doesn't say it, --system is the default and
does

> NOT need sudo, so my flatpak installed in the system location

> (/var/lib/flatpak)

> rather than the user location (~/.local/share/flatpak).

> 

> Can some-one please let me know if the GnuCash wiki is outdated, or just

> wrong, or just wrong for Ubuntu so I can update it?

> 

 

I believe --system has always been the default. I *thought* it was a distro
specific configuration to allow users (or perhaps users with admin rights
only?) to install system wide flatpaks without sudo rights. As far as I know
this is also the way it works on Fedora and has for as long as I remember.
So Ubuntu is certainly not the only distro to do this. I don't know about
other distros.

 

> 2. I just created an environment.local file in

> /var/lib/flatpak/app/org.gnucash.GnuCash/current/active/files/etc/gnucash

> from outside the sandbox, and after the sandbox is started, it is able to

> access /app/etc/gnucash/environment.local.

> I suspect that may go missing after a flatpak update - Is there a better

> way?

> 

Not based on environment.local. The environment.local method was created
with a traditional package installation in mind. It also works on Windows,
simply because the Windows installer overwrites an existing installation.
It's not working with the MacOS dmg for the same reason it doesn't work for
flatpaks. Each flatpak version is installed in a separate directory and the
manually added files are not copied over. This could use some
rearchitecting.

 

Having said that, you can define a custom environment for a flatpak
application using

flatpak override (--user|--system) --env "LANG=en_GB LANGUAGE=en_GB" \

org.gnucash.GnuCash

 

This will set these environment variables for the gnucash flatpak and this
will persist across updates.

 

> 3. Even though the GC sandbox read environment.local setting LANG=en_GB
and

> LANGUAGE={LANG}, and I checked en_GB is available in my flatpak GnuCash

> shell the trace file still shows: Effective locale set to en_AU.UTF-8

> Perhaps this message is misleading? I wonder how to check what is actually

> being used?

> 

I can't tell you that offhand (and currently am not in a position to dig in
the code...) 

 

Regards,

 

Geert

 

Hi Geert,

 

Thanks very much for that. I'll modify the Flatpak & Configuration Locations
wikis to suggest changing the flatpak environment using your method rather
than environment.local.

 

Regards,

Chris Good



More information about the gnucash-devel mailing list