Re: [GNC-dev] flatpak environment.local

2021-05-08 Thread Chris Good
From: Geert Janssens  
Sent: Saturday, 8 May 2021 5:48 AM
To: 'Frank H. Ellenberger' ;
gnucash-devel@gnucash.org
Cc: gnucash-devel@gnucash.org; Chris Good 
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

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: [GNC-dev] flatpak environment.local

2021-05-07 Thread Geert Janssens
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
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: [GNC-dev] flatpak environment.local

2021-04-25 Thread Frank H. Ellenberger
Hi Chris,

Am 26.04.21 um 03:48 schrieb Chris Good:
> 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?

when I created the page in 2019 because of the european PSD2 directive
we had quickly to set up a way to install the then recent GnuCash 3.7
also for Ubuntu users, who still had GnuCash 2.6.x. So the page
described one way.

* In between we extended the cage from home to host;
* We offer the Flathub releases and the nightlies.
* Flatpak offers system-wide or user-specific installations;
* How behave other software managemet systems from distributions or
desktop environments like KDE's discover …
* and in your case: is it Ubuntu specific or have they mirrored it from
Debian? Perhaps repology can help you there.

There is a wide range of combinations to be checked. Feel free to
document as much as possible.

Regards
Frank
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: [GNC-dev] flatpak environment.local

2021-04-25 Thread 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?

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?

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?

As changing the LANG is probably a major reason for using environment.local,
shall I create a bug to record this problem?

Regards,
Chris Good

-Original Message-
From: Frank H. Ellenberger  
Sent: Sunday, 25 April 2021 1:09 AM
To: Chris Good ; gnucash-devel@gnucash.org
Subject: Re: [GNC-dev] flatpak environment.local

Hi Chris,

can you use strace to find the used config?
BTW you did not tell, which flatpak you are using:
Flathub, Nightly, self built; version, …

Regards
Frank

Am 23.04.21 um 04:54 schrieb Chris Good:
> Hi Frank,
> 
> Thanks for the suggestion.
> ~/.local/share/flatpak/app does not exist in my system (Ubuntu 20.04 flatpak 
> 1.65).
> Not sure if relevant, but I installed the GnuCash flatpak for only my user - 
> i.e. NOT using sudo.
> 
> I'm not sure setting LANG=en_GB in environment.local was a good test of if 
> environment.local is being used.
> I did the same in Windows and the trace file message still shows the 
> effective local has not been altered.
> I did check en_GB is available in my flatpak GnuCash shell.
> 
> I'm happy to update the wiki when I know where environment.local should be or 
> if it is not used.
> 
> BTW jralls in 
> https://github.com/flathub/org.gnucash.GnuCash/issues/24#issuecomment-651967321
>  says:
>   I've patched guile to not do the timestamp check and just use any .go files 
> it finds. Has that helped?
> 
> And another user says it fixed the issue of .scm files being recompiled on 
> every launch.
> But I still needed to touch all the .go files in Ubuntu (and derivates as the 
> flatpak wiki says). Any idea why jralls' fix doesn't help in Ubuntu?
> 
> Regards,
> Chris Good
> 
> -Original Message-
> From: Frank H. Ellenberger 
> Sent: Thursday, 22 April 2021 11:49 PM
> To: Chris Good ; gnucash-devel@gnucash.org
> Subject: Re: [GNC-dev] flatpak environment.local
> 
> Hi Chris,
> 
> Flatpak is at first a sandbox.
> 
> I suspect you are searching for
> ~/.local/share/flatpak/app/org.gnucash.GnuCash/current/active/files/et
> c/gnucash/environment
> 
> Can you after testing update
> https://wiki.gnucash.org/wiki/Configuration_Locations and add a link 
> in https://wiki.gnucash.org/wiki/Flatpak
> 
> Regards
> Frank
> 
> Am 22.04.21 um 08:38 schrieb Chris Good:
>> Hi,
>>
>> (disclosure: I'm a flatpak newbie)
>>
>> I'm trying to update my BackupGnuCash utility
>> (https://github.com/goodvibes2/BackupGnuCashLinux) to cater for Flatpak.
>>
>> I'm trying to find out if environment.local needs to be backed up, 
>> and if so, where it should be.
>>
>> I created an environment.local containing:
>>
>> # 22/04/2021 CRG Set LANG

Re: [GNC-dev] flatpak environment.local

2021-04-24 Thread Frank H. Ellenberger
Hi Chris,

can you use strace to find the used config?
BTW you did not tell, which flatpak you are using:
Flathub, Nightly, self built; version, …

Regards
Frank

Am 23.04.21 um 04:54 schrieb Chris Good:
> Hi Frank,
> 
> Thanks for the suggestion.
> ~/.local/share/flatpak/app does not exist in my system (Ubuntu 20.04 flatpak 
> 1.65).
> Not sure if relevant, but I installed the GnuCash flatpak for only my user - 
> i.e. NOT using sudo.
> 
> I'm not sure setting LANG=en_GB in environment.local was a good test of if 
> environment.local is being used.
> I did the same in Windows and the trace file message still shows the 
> effective local has not been altered.
> I did check en_GB is available in my flatpak GnuCash shell.
> 
> I'm happy to update the wiki when I know where environment.local should be or 
> if it is not used.
> 
> BTW jralls in 
> https://github.com/flathub/org.gnucash.GnuCash/issues/24#issuecomment-651967321
>  says:
>   I've patched guile to not do the timestamp check and just use any .go files 
> it finds. Has that helped?
> 
> And another user says it fixed the issue of .scm files being recompiled on 
> every launch.
> But I still needed to touch all the .go files in Ubuntu (and derivates as the 
> flatpak wiki says). Any idea why jralls' fix doesn't help in Ubuntu?
> 
> Regards,
> Chris Good
> 
> -Original Message-
> From: Frank H. Ellenberger  
> Sent: Thursday, 22 April 2021 11:49 PM
> To: Chris Good ; gnucash-devel@gnucash.org
> Subject: Re: [GNC-dev] flatpak environment.local
> 
> Hi Chris,
> 
> Flatpak is at first a sandbox.
> 
> I suspect you are searching for
> ~/.local/share/flatpak/app/org.gnucash.GnuCash/current/active/files/etc/gnucash/environment
> 
> Can you after testing update
> https://wiki.gnucash.org/wiki/Configuration_Locations and add a link in 
> https://wiki.gnucash.org/wiki/Flatpak
> 
> Regards
> Frank
> 
> Am 22.04.21 um 08:38 schrieb Chris Good:
>> Hi,
>>
>> (disclosure: I'm a flatpak newbie)
>>
>> I'm trying to update my BackupGnuCash utility
>> (https://github.com/goodvibes2/BackupGnuCashLinux) to cater for Flatpak.
>>
>> I'm trying to find out if environment.local needs to be backed up, and 
>> if so, where it should be.
>>
>> I created an environment.local containing:
>>
>> # 22/04/2021 CRG Set LANG to en_GB to test where environment.local 
>> should be in flatpak
>> LANG=en_GB
>> LANGUAGE={LANG}
>> And put it in
>>
>> /etc/gnucash
>> and
>> /var/lib/flatpak/app/org.gnucash.GnuCash/current/active/files/etc/gnuc
>> ash
>>
>> But when GnuCash is restarted, the trace file still shows:
>>
>> INFO  [Gnucash::CoreApp::start] Effective locale set to 
>> en_AU.UTF-8.
>>
>> Can flatpak GnuCash read an environment.local file and if so, where 
>> should it be?
>>
>> Regards,
>>
>> Chris Good
>>
> 
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: [GNC-dev] flatpak environment.local

2021-04-22 Thread Chris Good
Hi Frank,

Thanks for the suggestion.
~/.local/share/flatpak/app does not exist in my system (Ubuntu 20.04 flatpak 
1.65).
Not sure if relevant, but I installed the GnuCash flatpak for only my user - 
i.e. NOT using sudo.

I'm not sure setting LANG=en_GB in environment.local was a good test of if 
environment.local is being used.
I did the same in Windows and the trace file message still shows the effective 
local has not been altered.
I did check en_GB is available in my flatpak GnuCash shell.

I'm happy to update the wiki when I know where environment.local should be or 
if it is not used.

BTW jralls in 
https://github.com/flathub/org.gnucash.GnuCash/issues/24#issuecomment-651967321 
says:
  I've patched guile to not do the timestamp check and just use any .go files 
it finds. Has that helped?

And another user says it fixed the issue of .scm files being recompiled on 
every launch.
But I still needed to touch all the .go files in Ubuntu (and derivates as the 
flatpak wiki says). Any idea why jralls' fix doesn't help in Ubuntu?

Regards,
Chris Good

-Original Message-
From: Frank H. Ellenberger  
Sent: Thursday, 22 April 2021 11:49 PM
To: Chris Good ; gnucash-devel@gnucash.org
Subject: Re: [GNC-dev] flatpak environment.local

Hi Chris,

Flatpak is at first a sandbox.

I suspect you are searching for
~/.local/share/flatpak/app/org.gnucash.GnuCash/current/active/files/etc/gnucash/environment

Can you after testing update
https://wiki.gnucash.org/wiki/Configuration_Locations and add a link in 
https://wiki.gnucash.org/wiki/Flatpak

Regards
Frank

Am 22.04.21 um 08:38 schrieb Chris Good:
> Hi,
> 
> (disclosure: I'm a flatpak newbie)
> 
> I'm trying to update my BackupGnuCash utility
> (https://github.com/goodvibes2/BackupGnuCashLinux) to cater for Flatpak.
> 
> I'm trying to find out if environment.local needs to be backed up, and 
> if so, where it should be.
> 
> I created an environment.local containing:
> 
> # 22/04/2021 CRG Set LANG to en_GB to test where environment.local 
> should be in flatpak
> LANG=en_GB
> LANGUAGE={LANG}
> And put it in
> 
> /etc/gnucash
> and
> /var/lib/flatpak/app/org.gnucash.GnuCash/current/active/files/etc/gnuc
> ash
> 
> But when GnuCash is restarted, the trace file still shows:
> 
> INFO  [Gnucash::CoreApp::start] Effective locale set to 
> en_AU.UTF-8.
> 
> Can flatpak GnuCash read an environment.local file and if so, where 
> should it be?
> 
> Regards,
> 
> Chris Good
> 

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: [GNC-dev] flatpak environment.local

2021-04-22 Thread Frank H. Ellenberger
Hi Chris,

Flatpak is at first a sandbox.

I suspect you are searching for
~/.local/share/flatpak/app/org.gnucash.GnuCash/current/active/files/etc/gnucash/environment

Can you after testing update
https://wiki.gnucash.org/wiki/Configuration_Locations and add a link in
https://wiki.gnucash.org/wiki/Flatpak


Regards
Frank

Am 22.04.21 um 08:38 schrieb Chris Good:
> Hi,
> 
>  
> 
> (disclosure: I'm a flatpak newbie)
> 
>  
> 
> I'm trying to update my BackupGnuCash utility
> (https://github.com/goodvibes2/BackupGnuCashLinux) to cater for Flatpak.
> 
>  
> 
> I'm trying to find out if environment.local needs to be backed up, and if
> so, where it should be.
> 
> I created an environment.local containing:
> 
>  
> 
> # 22/04/2021 CRG Set LANG to en_GB to test where environment.local should be
> in flatpak
> 
> LANG=en_GB
> 
> LANGUAGE={LANG}
> 
>  
> 
> And put it in 
> 
> /etc/gnucash
> 
> and
> 
> /var/lib/flatpak/app/org.gnucash.GnuCash/current/active/files/etc/gnucash
> 
>  
> 
> But when GnuCash is restarted, the trace file still shows:
> 
> INFO  [Gnucash::CoreApp::start] Effective locale set to
> en_AU.UTF-8.
> 
>  
> 
> Can flatpak GnuCash read an environment.local file and if so, where should
> it be?
> 
>  
> 
> Regards,
> 
> Chris Good
> 
>  
> 
> ___
> gnucash-devel mailing list
> gnucash-devel@gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
> 
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


[GNC-dev] flatpak environment.local

2021-04-22 Thread Chris Good
Hi,

 

(disclosure: I'm a flatpak newbie)

 

I'm trying to update my BackupGnuCash utility
(https://github.com/goodvibes2/BackupGnuCashLinux) to cater for Flatpak.

 

I'm trying to find out if environment.local needs to be backed up, and if
so, where it should be.

I created an environment.local containing:

 

# 22/04/2021 CRG Set LANG to en_GB to test where environment.local should be
in flatpak

LANG=en_GB

LANGUAGE={LANG}

 

And put it in 

/etc/gnucash

and

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

 

But when GnuCash is restarted, the trace file still shows:

INFO  [Gnucash::CoreApp::start] Effective locale set to
en_AU.UTF-8.

 

Can flatpak GnuCash read an environment.local file and if so, where should
it be?

 

Regards,

Chris Good

 

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel