GnuCash
Contact   Instructions
Bug 794916 - Fails to find environment file at startup when installation prefix is '/opt'
Summary: Fails to find environment file at startup when installation prefix is '/opt'
Status: RESOLVED FIXED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: Build system (show other bugs)
Version: 3.0
Hardware: Other Linux
: Normal normal
Target Milestone: future
Assignee: core
QA Contact: core
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-02 21:10 EDT by lj618
Modified: 2018-04-21 04:49 EDT (History)
7 users (show)

See Also:


Attachments

Description lj618 2018-04-02 21:10:54 EDT
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 04:37:13 EDT
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 15:58:47 EDT
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 17:28:28 EDT
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 04:49:59 EDT
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 11:42:38 EDT
Wonderful! Thanks for the verification.
Comment 6 lj618 2018-04-27 20:54:29 EDT
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-27 22:29:27 EDT
OK, but that would be a CMake bug, not a GnuCash one.

Note You need to log in before you can comment on or make changes to this bug.