[GNC-dev] Gnucash built from git doesn't start

John Ralls jralls at ceridwen.us
Mon Oct 28 12:50:23 EDT 2019



> On Oct 28, 2019, at 3:19 AM, Lothar Paltins <lkpgcd at mailbox.org> wrote:
> 
> Am 27.10.19 um 16:50 schrieb John Ralls:
>> As it turns out Geert thought that he'd fixed this last year, see https://bugs.gnucash.org/show_bug.cgi?id=794916. Note the work-around in that bug report to disable binreloc by passing -DENABLE_BINRELOC=OFF to cmake. Note also that the reporter on that bug thought that writing the environment file to /etc/opt was undesirable.
> 
> Some people like the FHS, some don't. Somebody who doesn't like the FHS, can execute "cmake -DCMAKE_INSTALL_PREFIX=/opt/gnucash -DCMAKE_INSTALL_SYSCONFDIR=/opt/gnucash/etc". This installs the file /opt/gnucash/etc/gnucash/environment and it works.
> 
> But cmake installs configuration files for /opt/<subdir> to /etc/opt/<subdir>, if no other SYSCONFDIR is specified explicitly.
> 
> It seems, that the bug 794916 wasn't completely fixed. I've now used strace to see, where gnucash actually looks for the environment file. It tries to open these files:
> 
> /opt/gnucash/etc/opt/gnucash/gnucash/environment
> /opt/gnucash/etc/opt/gnucash/gnucash/environment.local
> 
> After creating this strange directory and copying the environment file to it, gnucash starts and works.
> 
> I think, there are two issues:
> 
> The first issue is only a cosmetic one. If SYSCONFDIR already specifies a private directory, e.g. /etc/opt/gnucash, then it's not necessary to create another gnucash subdirectory. That is, the environment file should be in /etc/opt/gnucash/ and not in /etc/opt/gnucash/gnucash/ or in /opt/gnucash/etc/ instead of /opt/gnucash/etc/gnucash/. But this may be hard to fix and it's not a real issue.
> 
> The second issue is more important. Gnucash should look for the file in the actual SYSCONFDIR, wherever it may be, specified by the cmake command line and the GNUInstallDirs module.

The second issue is caused by binreloc. That's a small shim that allows an app to run from a different <prefix> that the one it was built for and it doesn't work if everything isn't contained under <prefix>. That's why -DENABLE_BINRELOC=OFF is a suitable workaround for -DCMAKE_INSTALL_PREFIX=/opt/gnucash not being able to find the environment files. Perhaps the right fix is to simply force it off if installing to /opt/*.

Regards,
John Ralls



More information about the gnucash-devel mailing list