GNOME Bugzilla – Bug 767456
Fix plugins not finding their data in jhbuild
Last modified: 2018-05-24 18:54:08 UTC
.
Created attachment 329477 [details] [review] shell: Fix crash when menu doesn't exist #0 0x00007fffef7db4a5 in g_menu_model_get_n_items (model=0x0) at gmenumodel.c:493 #1 0x00007ffff7aa07b1 in rb_application_link_shared_menus (app=0x628840, menu=0x0) at /jhbuild/rhythmbox/shell/rb-application.c:778 #2 0x00007fffca9c6444 in rb_iradio_source_new (shell=0x8df1b0, plugin=0x1172a50) at /jhbuild/rhythmbox/plugins/iradio/rb-iradio-source.c:458 #3 0x00007fffca9c523a in impl_activate (plugin=0x1172a50) at /jhbuild/rhythmbox/plugins/iradio/rb-iradio-plugin.c:89
Created attachment 329478 [details] [review] build: Fix plugins not finding their data in jhbuild Now that jhbuild launches configure from a different builddir, `pwd` isn't the root of the source tree, but the builddir. Using `dirname $0` instead means that ROOT_UNINSTALLED_DIR will be the source tree instead of the builddir.
there are more problems with srcdir != builddir uninstalled builds besides those, mostly related to plugin loading.
That was enough to make it not crash on startup on my system, when built using the latest jhbuild. There's probably more to unravel, but it will crash on startup when built from jhbuild otherwise.
Review of attachment 329477 [details] [review]: pushed as commit 396e6b5
Review of attachment 329478 [details] [review]: SHARE_UNINSTALLED_BUILDDIR and METADATA_UNINSTALLED_DIR are supposed to refer to the build directory as they're used to locate built executables, so I left those alone, but otherwise pushed as commit 8738f0d
commits b167734 and 0cdc753 fix a few more pieces, but python plugins still don't work at all. I'm not sure how to fix that.
In jhbuild, For ipod plugin: ( shared lib ) Thread 1 "rhythmbox" hit Breakpoint 1, peas_plugin_loader_load (loader=0x55ff2a7b8470, info=0x55ff2ab6fe40) at /home/dev/jhbuild/checkout/libpeas/libpeas/peas-plugin-loader.c:90 gdb) p *info $3 = { refcount = 1, loader_data = 0x0, filename = 0x55ff2ab6c430 "/home/dev/.cache/jhbuild/build/rhythmbox/data/../plugins/ipod/ipod.plugin", module_dir = 0x55ff2ab6b9e0 "/home/dev/.cache/jhbuild/build/rhythmbox/data/../plugins/ipod", data_dir = 0x55ff2ab6b930 "/home/dev/jhbuild/checkout/rhythmbox/data/../plugins/ipod", .. } For soundcloud plugin: ( python based ) (gdb) p *info $1 = { refcount = 1, loader_data = 0x0, filename = 0x55ff2ab6ea50 "/home/dev/.cache/jhbuild/build/rhythmbox/data/../plugins/soundcloud/soundcloud.plugin", module_dir = 0x55ff2ab6fd00 "/home/dev/.cache/jhbuild/build/rhythmbox/data/../plugins/soundcloud", data_dir = 0x55ff2ab710d0 "/home/dev/jhbuild/checkout/rhythmbox/data/../plugins/soundcloud", ... } In both cases, "module_dir" points to build dir, which has the .so file under ".libs/" dir. Trying to remove the .so file resulted in the following libpeas warning. (rhythmbox:10357): libpeas-WARNING **: Failed to load module 'ipod': /home/dev/.cache/jhbuild/build/rhythmbox/data/../plugins/ipod/.libs/libipod.so: cannot open shared object file: No such file or directory But, for python plugins, there is nothing to build, so there is just 2 files (Makefile / soundcloud.plugin) in build dir. libpeas loads .plugin and expects .py from the samedir, but cannot find them. Hence, the import failure.
I am not sure, what was the intention behind "USE_UNINSTALLED_DIRS". 1. In the direct git build scenario, this is disabled, and the plugins are loaded from LIBDIR. 2. In jhbuild case, USE_UNINSTALLED_DIRS is used, but it doesn't seem to work for python ( and possibly lua ) plugins.
(In reply to vrishab from comment #9) > 2. In jhbuild case, USE_UNINSTALLED_DIRS is used, but it doesn't seem to > work for python ( and possibly lua ) plugins. lua -> vala
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/rhythmbox/issues/1460.