[GNC-dev] Gnucash built from git doesn't start
geert.gnucash at kobaltwit.be
Wed Jan 22 15:52:08 EST 2020
Op maandag 28 oktober 2019 21:27:23 CET schreef Lothar Paltins:
> Am 28.10.19 um 17:50 schrieb John Ralls:
> > 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/*.
> Thanks, John, ENABLE_BINRELOC=OFF fixes this issue. I didn't test it
> before, because Geert Janssens wrote in a comment to bug 794916, that he
> commited a fix for it already in gnucash 3.1. So I would only suggest to
> make this really the default or to add this option to the documentation
> lation_locations for the /opt target.
> Best regards
I'm revisiting this issue now. Re-reading my fix does indeed show my assumptions were flawed.
Regardless of what angle I'm approaching this from I have now come to the conclusion binreloc
is not compatible with the FHS directory structure to use in case of a /opt/xyz prefix.
Both binreloc and /opt installations have their use, albeit in different contexts.
So I plan to rewrite the gnc-path code based on the following design:
- binreloc remains enabled by default (to not trip up newcomers)
- if a build is started with a /opt/xyz prefix, binreloc will be disabled and a configure warning will
be printed. This will handle the /opt case on systems that don't relocate. At the same time this
means systems that do relocate won't be able to use the /opt prefix. gnucash will simply fail to
start on such systems. This is currently on Windows and MacOS where the application is
packaged and the package will eventually decide where gnucash will end up on the system.
Linux distro's typically stick to the paths set at configure time for their final installation.
- For the non-/opt prefix case, whenever a path is to be determined, the binreloc calculated
prefix is compared with the one set at build time (which is stored as PREFIX in gncla.h).
* If both return the same value we can assume gnucash was not relocated post install and
gnucash will ignore binreloc, continuing with the file paths set at compile time instead.
* If they are different, we assume gnucash was relocated post-install and we will use the values
returned by binreloc.
I think that should cover all possible use cases and will only activate binreloc when it makes
How does that look ?
More information about the gnucash-devel