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

classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Lothar Paltins
Hi,

to get the latest patches for the 3.7 release, I've cloned the
maintenance branch of gnucash:

git clone https://github.com/Gnucash/gnucash.git maint

I could successfully run cmake and make, but the generated gnucash
doesn't start, gnucash.trace contains the following warnings:

> * 15:28:21  WARN <gnc.module> Could not locate module gnucash/engine interface v.0
> * 15:28:21  WARN <gnc.module> Could not locate module gnucash/app-utils interface v.0
> * 15:28:21  WARN <gnc.module> Could not locate module gnucash/gnome-utils interface v.0
> * 15:28:21  WARN <gnc.module> Could not locate module gnucash/gnome-search interface v.0
> * 15:28:21  WARN <gnc.module> Could not locate module gnucash/register/ledger-core interface v.0
> * 15:28:21  WARN <gnc.module> Could not locate module gnucash/register/register-core interface v.0
> * 15:28:21  WARN <gnc.module> Could not locate module gnucash/register/register-gnome interface v.0
> * 15:28:21  WARN <gnc.module> Could not locate module gnucash/import-export/qif-import interface v.0
> * 15:28:21  WARN <gnc.module> Could not locate module gnucash/report/report-system interface v.0
> * 15:28:21  WARN <gnc.module> Could not locate module gnucash/report/stylesheets interface v.0
> * 15:28:21  WARN <gnc.module> Could not locate module gnucash/report/locale-specific/us interface v.0
> * 15:28:21  WARN <gnc.module> Could not locate module gnucash/report/report-gnome interface v.0
> * 15:28:21  WARN <gnc.bin> GnuCash engine failed to initialize.  Exiting.

Did I do something wrong or did I miss something?

Best regards
Lothar
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

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

Derek Atkins-3
Hi,

On Tue, October 22, 2019 9:48 am, Lothar Paltins wrote:

> Hi,
>
> to get the latest patches for the 3.7 release, I've cloned the
> maintenance branch of gnucash:
>
> git clone https://github.com/Gnucash/gnucash.git maint
>
> I could successfully run cmake and make, but the generated gnucash
> doesn't start, gnucash.trace contains the following warnings:
>
>> * 15:28:21  WARN <gnc.module> Could not locate module gnucash/engine
>> interface v.0

First, that clone command wont bring you maint branch, it will still check
out master into a directory named "maint".  You need a -b maint in there
to pull the maint branch.

Second, did you "make install"?  GnuCash is finicky about being run from
the build tree.

[snip]
>
> Did I do something wrong or did I miss something?

Still TBD ;)    Most likely missed something (see above).

> Best regards
> Lothar

-derek

--
       Derek Atkins                 617-623-3745
       [hidden email]             www.ihtfp.com
       Computer and Internet Security Consultant

_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

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

Lothar Paltins
Hi Derek,

thanks for your reply.

> First, that clone command wont bring you maint branch, it will still check
> out master into a directory named "maint".  You need a -b maint in there
> to pull the maint branch.
>
> Second, did you "make install"?  GnuCash is finicky about being run from
> the build tree.

Yes, I forgot the -b before maint in my git clone command and yes, I've
installed it to /opt/gnucash. But starting /opt/gnucash/bin/gnucash
doesn't work. Does gnucash have problems finding modules if it's
installed in a non-standard location?

Lothar
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

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

John Ralls-2


> On Oct 22, 2019, at 11:50 AM, Lothar Paltins <[hidden email]> wrote:
>
> Hi Derek,
>
> thanks for your reply.
>
>> First, that clone command wont bring you maint branch, it will still check
>> out master into a directory named "maint".  You need a -b maint in there
>> to pull the maint branch.
>> Second, did you "make install"?  GnuCash is finicky about being run from
>> the build tree.
>
> Yes, I forgot the -b before maint in my git clone command and yes, I've installed it to /opt/gnucash. But starting /opt/gnucash/bin/gnucash doesn't work. Does gnucash have problems finding modules if it's installed in a non-standard location?

Everything has trouble finding modules in non-standard locations. Use LD_LIBRARY_PATH to add those non-standard locations to the search paths for ld and dlopen.

BTW, cmake puts the global config files--the ones that normally live in <prefix>/etc--in some strange subdirectory of /etc when <prefix> starts with /opt. GnuCash doesn't know about that and won't be able to find gnucash/environment, which may or may not break things. It does other strange things if <prefix> is /usr or starts with /usr/local, so life is easier if you install in a directory under $HOME, which also saves you needing to sudo for make install.

Regards,
John Ralls

_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

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

Lothar Paltins
Am 22.10.19 um 22:36 schrieb John Ralls:
> Everything has trouble finding modules in non-standard locations. Use LD_LIBRARY_PATH to add those non-standard locations to the search paths for ld and dlopen.

This doesn't seem to be an issue. The runtime paths in the binary are
correctly set to /opt/gnucash/lib64 and /opt/gnucash/lib64/gnucash.
Setting LD_LIBRARY_PATH doesn't help.

> BTW, cmake puts the global config files--the ones that normally live in <prefix>/etc--in some strange subdirectory of /etc when <prefix> starts with /opt. GnuCash doesn't know about that and won't be able to find gnucash/environment, which may or may not break things. It does other strange things if <prefix> is /usr or starts with /usr/local, so life is easier if you install in a directory under $HOME, which also saves you needing to sudo for make install.

The only strangely installed file I've found is
/etc/opt/gnucash/gnucash/environment.

As you've suggested, I've tried to install gnucash to $HOME/gnucash and
now it works. Thanks for the hint.

But IMHO this is a bug of the make and install procedure. Gnucash should
search for a file in the same location as it installed it.

Lothar
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

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

David Cousens
In reply to this post by John Ralls-2
John,

I am curious as to what problems you have encountered installing to
/usr/local and on what Linux distributions?  I have never had any problem
installing there in Linux Mint 17, 18, 19 which presumably also includes the
Ubuntu and Debian systems they are derived from but don't know about other
distributions.  According to the Linux File Heirarchy standard this is where
user software built from source should be installed.  The "sudo make
install" currently installs the libraries, share and config files in the
expected locations as follows:

/usr/local/bin/gnucash           main application
/usr/local/etc/gnucash/environment  
/usr/local/include/gnucash     gnucash heaader files
/usr/local/lib/gnucash            gnucash libraries
/usr/local/lib                           a few libraries associated with
libgnc-backend, libgnc-core-utils, libgnc-gnome, libgnc-module
                                          and libgwengui-gtk3
/usr/share/gnucash

Apart from requiring sudo privileges I have never encountered any problems
installing there since I started using GnuCash in 2010.

David



-----
David Cousens
--
Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-Dev-f1435356.html
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
David Cousens
Reply | Threaded
Open this post in threaded view
|

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

John Ralls-2


> On Oct 22, 2019, at 6:55 PM, David Cousens <[hidden email]> wrote:
>
> John,
>
> I am curious as to what problems you have encountered installing to
> /usr/local and on what Linux distributions?  I have never had any problem
> installing there in Linux Mint 17, 18, 19 which presumably also includes the
> Ubuntu and Debian systems they are derived from but don't know about other
> distributions.  According to the Linux File Heirarchy standard this is where
> user software built from source should be installed.  The "sudo make
> install" currently installs the libraries, share and config files in the
> expected locations as follows:
>
> /usr/local/bin/gnucash           main application
> /usr/local/etc/gnucash/environment  
> /usr/local/include/gnucash     gnucash heaader files
> /usr/local/lib/gnucash            gnucash libraries
> /usr/local/lib                           a few libraries associated with
> libgnc-backend, libgnc-core-utils, libgnc-gnome, libgnc-module
>                                          and libgwengui-gtk3
> /usr/share/gnucash
>
> Apart from requiring sudo privileges I have never encountered any problems
> installing there since I started using GnuCash in 2010.

David,

See https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html for what cmake does with special case prefixes. It generally affects just <prefix>/etc/gnucash/environment.

Regards,
John Ralls

_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

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

John Ralls-2
In reply to this post by Lothar Paltins


> On Oct 22, 2019, at 3:18 PM, Lothar Paltins <[hidden email]> wrote:
>
> Am 22.10.19 um 22:36 schrieb John Ralls:
>> Everything has trouble finding modules in non-standard locations. Use LD_LIBRARY_PATH to add those non-standard locations to the search paths for ld and dlopen.
>
> This doesn't seem to be an issue. The runtime paths in the binary are correctly set to /opt/gnucash/lib64 and /opt/gnucash/lib64/gnucash. Setting LD_LIBRARY_PATH doesn't help.
>
>> BTW, cmake puts the global config files--the ones that normally live in <prefix>/etc--in some strange subdirectory of /etc when <prefix> starts with /opt. GnuCash doesn't know about that and won't be able to find gnucash/environment, which may or may not break things. It does other strange things if <prefix> is /usr or starts with /usr/local, so life is easier if you install in a directory under $HOME, which also saves you needing to sudo for make install.
>
> The only strangely installed file I've found is /etc/opt/gnucash/gnucash/environment.
>
> As you've suggested, I've tried to install gnucash to $HOME/gnucash and now it works. Thanks for the hint.
>
> But IMHO this is a bug of the make and install procedure. Gnucash should search for a file in the same location as it installed it.

Sorry, I was thinking of the wrong part of module loading. The messages you got are from before the module is passed to dlopen and come from gnc_module_load_common (https://github.com/Gnucash/gnucash/blob/maint/libgnucash/gnc-module/gnc-module.c#L447).

That function does search, using the path set in $GNC_MODULE_PATH, and cmake writes that into <prefix>/etc/gnucash/environment. But if you specify <prefix> to be /opt/... or /usr/... in which case the <prefix> part is dropped and it goes to /etc/opt or just /etc respectively (see https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html). The defect in GnuCash's code is that it doesn't trap that SYSCONFDIR adjustment so it doesn't load the environment file, doesn't set GNC_MODULE_PATH, and so can't find the modules.


Regards,
John Ralls

_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

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

Lothar Paltins
Am 23.10.19 um 06:14 schrieb John Ralls:
> That function does search, using the path set in $GNC_MODULE_PATH, and cmake writes that into <prefix>/etc/gnucash/environment. But if you specify <prefix> to be /opt/... or /usr/... in which case the <prefix> part is dropped and it goes to /etc/opt or just /etc respectively (see https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html). The defect in GnuCash's code is that it doesn't trap that SYSCONFDIR adjustment so it doesn't load the environment file, doesn't set GNC_MODULE_PATH, and so can't find the modules.

I think there are two issues. The environment file should be installed
to the directory /etc/opt/gnucash/ and not to /etc/opt/gnucash/gnucash/.
And gnucash should know, where it's installed and load it from there.

Lothar


_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

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

Geert Janssens-4
Op woensdag 23 oktober 2019 11:56:03 CEST schreef Lothar Paltins:

> Am 23.10.19 um 06:14 schrieb John Ralls:
> > That function does search, using the path set in $GNC_MODULE_PATH, and
> > cmake writes that into <prefix>/etc/gnucash/environment. But if you
> > specify <prefix> to be /opt/... or /usr/... in which case the <prefix>
> > part is dropped and it goes to /etc/opt or just /etc respectively (see
> > https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html). The
> > defect in GnuCash's code is that it doesn't trap that SYSCONFDIR
> > adjustment so it doesn't load the environment file, doesn't set
> > GNC_MODULE_PATH, and so can't find the modules.
> I think there are two issues. The environment file should be installed
> to the directory /etc/opt/gnucash/ and not to /etc/opt/gnucash/gnucash/.
> And gnucash should know, where it's installed and load it from there.
>
That's reasonable.

I'm curious, if you move the file to /etc/opt/gnucash, will gnucash then find
it ?

Regards,

Geert


_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

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

Lothar Paltins
Hi Geert,

> I'm curious, if you move the file to /etc/opt/gnucash, will gnucash then find
> it ?

No, it doesn't. I've tried to copy the file to /etc/opt/gnucash and
/etc/gnucash and I did set several environment variables, all to no avail.

Lothar
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

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

Derek Atkins-3
In reply to this post by Lothar Paltins
Hi,

Lothar Paltins <[hidden email]> writes:

> Yes, I forgot the -b before maint in my git clone command and yes,
> I've installed it to /opt/gnucash. But starting
> /opt/gnucash/bin/gnucash doesn't work. Does gnucash have problems
> finding modules if it's installed in a non-standard location?

How did you configure gnucash during the build in order to install it to
/opt/gnucash?  You need to tell gnucash where it is being installed when
you build it, so it will look in the right place for its files.

> Lothar

-derek
--
       Derek Atkins                 617-623-3745
       [hidden email]             www.ihtfp.com
       Computer and Internet Security Consultant
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

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

Derek Atkins-3
In reply to this post by Lothar Paltins
Lothar Paltins <[hidden email]> writes:

> Hi Geert,
>
>> I'm curious, if you move the file to /etc/opt/gnucash, will gnucash then find
>> it ?
>
> No, it doesn't. I've tried to copy the file to /etc/opt/gnucash and
> /etc/gnucash and I did set several environment variables, all to no
> avail.

If "prefix" is /opt/gnucash, then shouldn't the file live in
/opt/gnucash/etc/environment?

> Lothar

-derek

--
       Derek Atkins                 617-623-3745
       [hidden email]             www.ihtfp.com
       Computer and Internet Security Consultant
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

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

Lothar Paltins
Am 25.10.19 um 15:11 schrieb Derek Atkins:

> How did you configure gnucash during the build in order to install it to
> /opt/gnucash?  You need to tell gnucash where it is being installed when
> you build it, so it will look in the right place for its files.

cmake -DCMAKE_INSTALL_PREFIX=/opt/gnucash ..
make
make install

That's the "official" way to set the install directory. But cmake tries
to be smart and tries to follow the file hierarchy standard if the path
starts with /opt. According to the standard, optional packages should be
installed to /opt/<name>, editable config files to /etc/opt/<name> and
log files should go to /var/opt/<name>. But cmake (or the cmake
configuration of gnucash) isn't smart enough, because it doesn't work
correctly.

Am 25.10.19 um 15:13 schrieb Derek Atkins:
> If "prefix" is /opt/gnucash, then shouldn't the file live in
> /opt/gnucash/etc/environment?

No, see above. It doesn't matter for a single workstation, but in a
multi-workstation configuration, the splitting of the directories does
make sense. The directory /opt will then contain only invariable files
and it could be mounted read only from a central server. All variable
files will be in the local directories /etc/opt and /var/opt on each
workstation.

Lothar
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

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

Geert Janssens-4
Op vrijdag 25 oktober 2019 17:19:14 CEST schreef Lothar Paltins:

> Am 25.10.19 um 15:11 schrieb Derek Atkins:
> > How did you configure gnucash during the build in order to install it to
> > /opt/gnucash?  You need to tell gnucash where it is being installed when
> > you build it, so it will look in the right place for its files.
>
> cmake -DCMAKE_INSTALL_PREFIX=/opt/gnucash ..
> make
> make install
>
> That's the "official" way to set the install directory. But cmake tries
> to be smart and tries to follow the file hierarchy standard if the path
> starts with /opt. According to the standard, optional packages should be
> installed to /opt/<name>, editable config files to /etc/opt/<name> and
> log files should go to /var/opt/<name>. But cmake (or the cmake
> configuration of gnucash) isn't smart enough, because it doesn't work
> correctly.
>
Gnucash historically was using the autotools build system. As far as I know
that system did put the config files in /opt/gnucash/etc/gnucash and not in /
etc/opt/gnucash(/gnucash)

Although the gnucash project since has migrated to exclusively use cmake, it
may very well be it still expects the files to be in /opt/gnucash/etc/gnucash.

Does it work if you copy the files in that subdirectory ?

Not that it matters that much, we should eventually fix it to work with the
paths as prescribed in the fhs.

Regards,

Geert


_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

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

Lothar Paltins
Am 25.10.19 um 21:27 schrieb Geert Janssens:
> Gnucash historically was using the autotools build system. As far as I know
> that system did put the config files in /opt/gnucash/etc/gnucash and not in /
> etc/opt/gnucash(/gnucash)

Yes, if you run "configure --prefix=/opt/gnucash". There's no automagic
splitting of the subdirectories depending on the path. But you could
easily split the installation paths if you want to follow the FHS by
adding "--sysconfdir=/etc/opt/gnucash --localstatedir=/var/opt/gnucash"
and maybe other options.

> Although the gnucash project since has migrated to exclusively use cmake, it
> may very well be it still expects the files to be in /opt/gnucash/etc/gnucash.
>
> Does it work if you copy the files in that subdirectory ?

No, it doesn't.

> Not that it matters that much, we should eventually fix it to work with the
> paths as prescribed in the fhs.

I've seen, that the FHS splitting isn't done by cmake itself, it's done
because gnucash includes the GNUInstallDirs module. But as far as I see,
the directories can be overwritten by the user by setting the
appropriate variables. Therefore gnucash shouldn't assume fixed paths,
instead it should use the actual installation paths chosen by the user
and by cmake.

Lothar
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

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

John Ralls-2


> On Oct 27, 2019, at 3:19 AM, Lothar Paltins <[hidden email]> wrote:
>
> Am 25.10.19 um 21:27 schrieb Geert Janssens:
>> Gnucash historically was using the autotools build system. As far as I know
>> that system did put the config files in /opt/gnucash/etc/gnucash and not in /
>> etc/opt/gnucash(/gnucash)
>
> Yes, if you run "configure --prefix=/opt/gnucash". There's no automagic splitting of the subdirectories depending on the path. But you could easily split the installation paths if you want to follow the FHS by adding "--sysconfdir=/etc/opt/gnucash --localstatedir=/var/opt/gnucash" and maybe other options.
>
>> Although the gnucash project since has migrated to exclusively use cmake, it
>> may very well be it still expects the files to be in /opt/gnucash/etc/gnucash.
>> Does it work if you copy the files in that subdirectory ?
>
> No, it doesn't.
>
>> Not that it matters that much, we should eventually fix it to work with the
>> paths as prescribed in the fhs.
>
> I've seen, that the FHS splitting isn't done by cmake itself, it's done because gnucash includes the GNUInstallDirs module. But as far as I see, the directories can be overwritten by the user by setting the appropriate variables. Therefore gnucash shouldn't assume fixed paths, instead it should use the actual installation paths chosen by the user and by cmake.

Yes, the GNUInstallDirs module is needed to get the build to work correctly for the Linux distros.

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.

Regards,
John Ralls

_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

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

Lothar Paltins
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.

Best regards
Lothar
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

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

John Ralls-2


> On Oct 28, 2019, at 3:19 AM, Lothar Paltins <[hidden email]> 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

_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

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

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
in
https://wiki.gnucash.org/wiki/Building_On_Linux#System_wide_multiuser_installation_locations 
for the /opt target.

Best regards
Lothar
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel