[GNC-dev] Fwd: Testing python

Andy Goblins andygoblins at gmx.com
Sun Apr 26 10:57:49 EDT 2020


   Mark, I do not get any of the errors you get when running with '--debug
   --test' - the python test stuff runs fine for me: it says, "Hello from
   python!" and then prints a bunch of tests.

   So I did some more playing, and discovered:
   1. If I run 'ninja install' the installed version loads the libraries
   correctly.
   2. If I re-build gnucash with a build location of /gnucash-git/build
   instead of /some/other/place/build the libraries load correctly.

   I'm guessing that most people keep their 'build' directory in the root
   of the git repository rather than in a different folder, and there must
   be some hard-coded references to this that messes up builds in
   alternative directories.


   Sent: Saturday, April 25, 2020 at 5:17 PM
   From: "Mark" <epistemik at gmail.com>
   To: "andygoblins" <andygoblins at gmx.com>
   Cc: "Geert Janssens" <geert.gnucash at kobaltwit.be>, "gnucash-devel"
   <gnucash-devel at gnucash.org>
   Subject: Re: [GNC-dev] Fwd: Testing python
   Unfortunately, we are beyond where I can help you with the build
   details, but I can at least give my experience for comparison. I had
   never tried it before, but I went to my most recent build directory and
   ran the gnucash binary directly from there. It ran fine for me, in the
   sense that it didn't give any different errors than when I run the
   installed binary. And I find that, whatever these warnings may mean
   about the build, they DO NOT prevent gnucash from opening and DO NOT
   seem to cause any problems in the functioning at all that I ever
   notice. This is my output, for information:

   2012 > bin/gnucash --version
   GnuCash 3.10
   Build ID: 3.10+(2020-04-11)
   2013 > bin/gnucash --debug --extra
   Traceback (most recent call last):
     File
   "/newdata/dev/Gnucash/RELEASES/gnucash-3.10/build_with-python_2020-04-1
   2/lib/python3.9/site-packages/gnucash/gnucash_core_c.py", line 14, in
   swig_import_helper
       return importlib.import_module(mname)
     File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in
   import_module
       return _bootstrap._gcd_import(name[level:], package, level)
     File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
     File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
     File "<frozen importlib._bootstrap>", line 986, in
   _find_and_load_unlocked
     File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
     File "<frozen importlib._bootstrap>", line 565, in module_from_spec
     File "<frozen importlib._bootstrap_external>", line 1108, in
   create_module
     File "<frozen importlib._bootstrap>", line 228, in
   _call_with_frames_removed
   ImportError:
   /newdata/dev/Gnucash/RELEASES/gnucash-3.10/build_with-python_2020-04-12
   /lib/python3.9/site-packages/gnucash/_gnucash_core_c.so: undefined
   symbol: forkpty
   During handling of the above exception, another exception occurred:
   Traceback (most recent call last):
     File
   "/newdata/dev/Gnucash/RELEASES/gnucash-3.10/build_with-python_2020-04-1
   2/share/gnucash/python/init.py", line 2, in <module>
       import gnucash._sw_app_utils as _sw_app_utils
     File
   "/newdata/dev/Gnucash/RELEASES/gnucash-3.10/build_with-python_2020-04-1
   2/lib/python3.9/site-packages/gnucash/__init__.py", line 6, in <module>
       from gnucash.gnucash_core import *
     File
   "/newdata/dev/Gnucash/RELEASES/gnucash-3.10/build_with-python_2020-04-1
   2/lib/python3.9/site-packages/gnucash/gnucash_core.py", line 31, in
   <module>
       import gnucash.gnucash_core_c as gnucash_core_c
     File
   "/newdata/dev/Gnucash/RELEASES/gnucash-3.10/build_with-python_2020-04-1
   2/lib/python3.9/site-packages/gnucash/gnucash_core_c.py", line 17, in
   <module>
       _gnucash_core_c = swig_import_helper()
     File
   "/newdata/dev/Gnucash/RELEASES/gnucash-3.10/build_with-python_2020-04-1
   2/lib/python3.9/site-packages/gnucash/gnucash_core_c.py", line 16, in
   swig_import_helper
       return importlib.import_module('_gnucash_core_c')
     File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in
   import_module
       return _bootstrap._gcd_import(name[level:], package, level)
   ModuleNotFoundError: No module named '_gnucash_core_c'
   Found Finance::Quote version 1.49.

   Mark

   [1]epistemik at gmail.com
   (613) 447-5385



   On Sat, Apr 25, 2020 at 2:54 PM andygoblins <[2]andygoblins at gmx.com>
   wrote:

   I get the same issue when running the gnucash binary out of the build
   directory. Do I need to set a different environment variable so gnucash
   loads the correct .so files?

   On April 24, 2020 12:16:22 PM UTC, Geert Janssens
   <[3]geert.gnucash at kobaltwit.be> wrote:

     Ok, so it looks like an issue with how gnucash finds its libraries
     from within the build directory, rather than from the installation
     directory.


     Can you run gnucash itself properly from the build directory ?


     Regards,


     Geert


     Op vrijdag 24 april 2020 00:37:37 CEST schreef andygoblins:

     > I'm building from git master. I just run "ninja build" without an
     install

     > and do my testing straight from the build directory.

     >

     > The last commit in my copy of master was on April 14. Does the
     master branch

     > include the 3.10 build fix?

     > On April 21, 2020 8:23:40 PM UTC, Mark <[4]epistemik at gmail.com>
     wrote:

     > >Yea, I ran 'sudo ninja install'.

     > >Andy, from your initial email, can't tell for sure but possibly
     you

     > >built a

     > >venv right after your ninja build without doing an install?

     > >

     > >*Mark*

     > >

     > >

     > >*[5]epistemik at gmail.com <[6]epistemik at gmail.com>*

     > >*(613) 447-5385*

     > >

     > >

     > >

     > >On Tue, Apr 21, 2020 at 10:18 AM Geert Janssens

     > ><[7]geert.gnucash at kobaltwit.be>

     > >

     > >wrote:

     > >> Op dinsdag 21 april 2020 15:01:33 CEST schreef Mark:

     > >> > My bindings are built from the git source code for the 3.10
     release

     > >> >

     > >> > (gnucash-3.10.tar.bz2):

     > >> >

     > >> >

     > >> >

     > >> > /opt/bin | Tue Apr 21 08:55:25 | marksa at Ares-A717-72G | bash
     4.4.20

     > >> >

     > >> > 2013 > ./gnucash --version

     > >> >

     > >> > GnuCash 3.10

     > >> >

     > >> > Build ID: 3.10+(2020-04-11)

     > >> >

     > >> >

     > >> >

     > >> > So maybe I have a slightly later version of 3.10 where this
     bug was

     > >>

     > >> already

     > >>

     > >> > fixed?

     > >>

     > >> No, I don't think so. The fix was only included on 2020-04-12
     and is

     > >

     > >not

     > >

     > >> part of the release tarball.

     > >>

     > >>

     > >>

     > >> But there are several factors at play. Do you run "make
     install" ? If

     > >

     > >so,

     > >

     > >> the python bindings would properly find the libraries in the

     > >

     > >installation

     > >

     > >> directory. If not, they should be found in the build directory,
     but I

     > >> expect that to fail without the aforementioned patch.

     > >>

     > >>

     > >>

     > >> Regards,

     > >>

     > >>

     > >>

     > >> Geert



   --
   Sent from my Android device with K-9 Mail. Please excuse my brevity.

References

   1. mailto:epistemik at gmail.com
   2. mailto:andygoblins at gmx.com
   3. mailto:geert.gnucash at kobaltwit.be
   4. mailto:epistemik at gmail.com
   5. mailto:epistemik at gmail.com
   6. mailto:epistemik at gmail.com
   7. mailto:geert.gnucash at kobaltwit.be


More information about the gnucash-devel mailing list