In case anyone else finds this in a Google search in the future, this was an interaction between Vala and libpeas. If you annotate a function with [ModuleInit] like we do here: https://github.com/jangernert/FeedReader/blob/master/plugins/backend/feedbin/feedbinInterface.vala#L750 <https://github.com/jangernert/FeedReader/blob/master/plugins/backend/feedbin/feedbinInterface.vala#L750>, then link it into a library, the Vala compiler magically turns the entire library into a libpeas module. Since I was directly linking the module, the peas_register_types function wasn't being called and the types didn't exist.
I couldn't figure out how to call that function manually, so we just don't link that peas_register_types function <https://github.com/jangernert/FeedReader/blob/master/plugins/backend/feedbin/meson.build> in our tests. Long term we'll probably just have a file with nothing but that function so we can test everything else easily. > On Apr 22, 2018, at 12:56 PM, Brendan Long <s...@brendanlong.com> wrote: > > I'm not sure if this is a Glib, Meson or Vala thing, but I don't even > understand why this glib error would ever happen so I hope this is the right > place to ask (I know it means "this type is null", but I have no idea why > that would ever be the case). > > I'm trying to convert a Vala project that uses dynamically loaded plugins to > Meson: > > https://github.com/jangernert/FeedReader/pull/662 > <https://github.com/jangernert/FeedReader/pull/662> > > For some reason, linking a test exectable with one of our plugins causes > errors like: > > $ ./plugins/backend/feedbin/test_feedbin > /feedbinapi/construct: > (./plugins/backend/feedbin/test_feedbin:27002): GLib-GObject-CRITICAL **: > g_object_new_with_properties: assertion 'G_TYPE_IS_OBJECT (object_type)' > failed > Trace/breakpoint trap (core dumped) > > The file is just a simple class that extends GLib.object: > https://github.com/brendanlong/FeedReader/blob/meson/plugins/backend/feedbin/feedbinAPI.vala > > <https://github.com/brendanlong/FeedReader/blob/meson/plugins/backend/feedbin/feedbinAPI.vala> > The meson build is here, if that matters: > https://github.com/brendanlong/FeedReader/blob/meson/plugins/backend/feedbin/meson.build > > <https://github.com/brendanlong/FeedReader/blob/meson/plugins/backend/feedbin/meson.build> > > We were getting similar issues when linking our main library statically, but > it's a shared library now (and the plugin has always been a shared library). > > The only things I could find on Google were versioning issues, but I get this > error in Docker, where no other version of FeedReader is installed: > > https://circleci.com/gh/brendanlong/FeedReader/206 > <https://circleci.com/gh/brendanlong/FeedReader/206> > > Can someone help me understand what's going wrong, and what I might do to fix > it? >
_______________________________________________ gtk-list mailing list gtk-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-list