GNOME Bugzilla – Bug 794916
Fails to find environment file at startup when installation prefix is '/opt'
Last modified: 2018-06-30 00:06:42 UTC
Using: gnucash-3.0 on 32-bit Slackware Linux 14.2 I built gnucash-3.0 to be installed at /opt/gnucash. I used a cmake line that included: -D CMAKE_INSTALL_PREFIX=/opt/gnucash After build and install, gnucash would not start. First error was unable to find schemas, which I worked around by setting XDG_DATA_DIRS. Then it failed on unable to find modules. It turned out that "make install" created the environment file here: (1) /etc/opt/gnucash/gnucash/environment But using strace I saw Gnucash was looking for it here: (2) /opt/gnucash/etc/gnucash/environment I moved the file from (1) to (2) and then it works.
Thanks for reporting this. The issue got introduced when we replaced our autotools build system with a cmake based one. cmake makes some path tweaks when installing under /opt and our code is not (yet) capable of handling this. We will also need to double check for potential issues when installing under /usr/local as there also cmake uses adjusted paths.
While looking at this it looks like you can work around this by specifying -D ENABLE_BINRELOC=OFF to your cmake invocation. I haven't tested this yet.
And I have just now commited a fix that should allow this to work even when binreloc is enabled, although I don't think that combination makes much sense really. I have added a fix anyway because binreloc is enabled by default and it would increase the learning curve when we'd have to ask new builders each time to disable it if they want to install in /opt. The fix will first appear in gnucash 3.1.
Just for information: I have the same setup (installing into /opt) and experienced the same issue with schemas not found. Did not try the workarounds reported by lj308. Today I made a git pull for maint and started the build process all over again on commit 451bbd53d90c7f51846f93912e0dd5016752f999. Works :-)
Wonderful! Thanks for the verification.
I can confirm that adding -D ENABLE_BINRELOC=OFF to CMake 'fixes' the bug with GnuCash-3.0. Thanks for working on this issue. But I have to say I would have been happier to see it fixed with the environment file installed where we told it to go, and GnuCash finding it there. I dislike the fact that CMake is told to install files under /opt but it decides that this file really belongs somewhere else, and the fix just accommodates CMake's behavior.
OK, but that would be a CMake bug, not a GnuCash one.
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=794916. Please update any external references or bookmarks.