After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 794916 - Fails to find environment file at startup when installation prefix is '/opt'
Fails to find environment file at startup when installation prefix is '/opt'
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Build system
3.0
Other Linux
: Normal normal
: future
Assigned To: gnucash-core-maint
gnucash-core-maint
Depends on:
Blocks:
 
 
Reported: 2018-04-03 01:10 UTC by lj308
Modified: 2018-06-30 00:06 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description lj308 2018-04-03 01:10:50 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.
Comment 1 Geert Janssens 2018-04-10 08:37:09 UTC
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.
Comment 2 Geert Janssens 2018-04-16 19:58:43 UTC
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.
Comment 3 Geert Janssens 2018-04-16 21:28:24 UTC
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.
Comment 4 Carsten Rinke 2018-04-21 08:49:55 UTC
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 :-)
Comment 5 Geert Janssens 2018-04-21 15:42:34 UTC
Wonderful! Thanks for the verification.
Comment 6 lj308 2018-04-28 00:54:25 UTC
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.
Comment 7 John Ralls 2018-04-28 02:29:23 UTC
OK, but that would be a CMake bug, not a GnuCash one.
Comment 8 John Ralls 2018-06-30 00:06:42 UTC
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.