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 776938 - installed tests cannot load libregress.so
installed tests cannot load libregress.so
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2017-01-06 11:42 UTC by Lionel Landwerlin
Modified: 2017-01-13 05:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
installed-tests: Fix script test Exec line (790 bytes, patch)
2017-01-12 06:09 UTC, Philip Chimento
committed Details | Review
installed-tests: Prepend pkglibdir to library path (1.42 KB, patch)
2017-01-12 06:09 UTC, Philip Chimento
committed Details | Review

Description Lionel Landwerlin 2017-01-06 11:42:30 UTC
Running :

gnome-desktop-testing-runner gjs/testFundamental.test

Yields an error on loading libregress.so :

     JS G NS: Found info type OBJECT for 'TestFundamentalSubObject' in namespace 'Regress'

** (process:4055): WARNING **: Failed to load shared library 'libregress.so' referenced by the typelib: libregress.so: cannot open shared object file: No such file or directory
     JS G NS: Failed to define info 'TestFundamentalSubObject'
not ok 1 Fundamental type support constructs a subtype of a fundamental type
# Message: Expected function not to throw, but it threw Error: Unsupported type void, deriving from fundamental void.


Looks like we're missing the path to $libdir/gjs in LD_LIBRARY_PATH.
Comment 1 Philip Chimento 2017-01-07 08:35:45 UTC
Thanks for reporting! I can't reproduce this though; let's diagnose. $libdir/gjs shouldn't be in LD_LIBRARY_PATH because those aren't public libraries. What's the path to the libregress.so shared library listed in your built copy of Regress-1.0.gir?
Comment 2 Lionel Landwerlin 2017-01-08 10:52:52 UTC
I can't see any path to libregress.so in the built gir file.
Here is the namespace :

 <namespace name="Regress"
            version="1.0"
            shared-library="libregress.so"
            c:identifier-prefixes="Regress"
            c:symbol-prefixes="regress">

What I find a bit disturbing is that Regress-1.0.gir isn't installed in the build directory. So I understand how that could work with the installed tests. Maybe I'm missing something?
Comment 3 Philip Chimento 2017-01-10 06:06:54 UTC
It looks like this for me, at least on macOS:

  <namespace name="Regress"
             version="1.0"
             shared-library="/Users/fliep/install/lib/gjs/libregress.dylib"
             c:identifier-prefixes="Regress"
             c:symbol-prefixes="regress">

I usually run the tests uninstalled on my Linux machine, where presumably the namespace looks like yours. So maybe that's why I'm not running into this problem. I'll dig into this more soon.
Comment 4 Philip Chimento 2017-01-12 06:09:27 UTC
Created attachment 343341 [details] [review]
installed-tests: Fix script test Exec line

The script tests should be executed with a shell, not GJS.
Comment 5 Philip Chimento 2017-01-12 06:09:31 UTC
Created attachment 343342 [details] [review]
installed-tests: Prepend pkglibdir to library path

Typelibs don't include the full path to the shared library on every
platform, so we need to add pkglibdir to GIRespository's library search
path when running the tests installed.
Comment 6 Philip Chimento 2017-01-12 06:10:18 UTC
Here's what fixed it for me, let me know if that works for you as well.
Comment 7 Lionel Landwerlin 2017-01-12 12:15:35 UTC
Yey! It all works now :)
Thanks!
Comment 8 Philip Chimento 2017-01-13 05:44:21 UTC
Attachment 343341 [details] pushed as f993a3a - installed-tests: Fix script test Exec line
Attachment 343342 [details] pushed as 880c623 - installed-tests: Prepend pkglibdir to library path