GNOME Bugzilla – Bug 587975
Failed to find symbol 'meta_preview_get_type'
Last modified: 2009-07-17 12:02:36 UTC
This seems wrong, either the preview widget should be converted to export its functionality through external API or it should be removed from libmutterinclude_base_headers. Current state of things results in the header being installed and breaks G-I-R build because g-ir-scanner cannot find a public symbol for mutter_preview_get_type() defined in ui/preview-widget.h
Created attachment 137970 [details] [review] Proposed patch
What do you mean by "G-I-R" build? gir-repository will not be scanning mutter headers. Mutter.gir is built as part of the Mutter build repository and is set up for plugins running inside the Mutter process. Also, preview-widget.c is included in libmutter-private, which is why preview-widget.h is a "public" header. (libmutter-private descends from libmetacity-private - which is the library metacity installed for the control-center theme viewer and similar.)
I mean it exports symbols that are not public so installing this file along with libmutter-private is useless. Also g-ir-scanner gets confused when seeing this symbol and not encountering it in mutter binary (Makefile.am tells g-ir-scanner to scan ./mutter binary, not libmutter-private.la). In the end it does not produce Mutter-2.27.gir at all. I had to apply the attached patch in order to build mutter with .gir and .typelib data. You can try to reproduce by running "make distclean" or "make clean" in the git tree and trying to build it again. The exact error I get is: Invalid GType: 'meta_preview_get_type' failed to dump: Failed to find symbol 'meta_preview_get_type' Which is correct as there is no such symbol: $ nm -D .libs/mutter | grep meta_preview_get_type | wc -l 0 $ rpm -q gir-repository-devel gobject-introspection-devel gir-repository-devel-0.6.3-1.x86_64 gobject-introspection-devel-0.6.3-2.x86_64
Buids fine for me. I don't know what version the above referenced gobject-introspection is, but I suspect it's too old. Going to close as OBSOLETE. If you can reproduce with current gobject-introspection master, please repoen.
Wait, I gave the version in the earlier comment :)
What I was saying is "0.6.3" doesn't mean much to me. I didn't know when the tarball was made. (it actually seems to be pretty recent looking at http://ftp.acc.umu.se/pub/GNOME/sources/gobject-introspection/0.6/) Unfortunately, I can't reproduce the problem, and your explaination of the problem doesn't compute for me: "Makefile.am tells g-ir-scanner to scan ./mutter binary, not libmutter-private.la" Yes, that's the way it is supposed to work; mutter links to libmetacity-private so the symbols in libmetacity-private will be available there as well. "Failed to find symbol 'meta_preview_get_type'" It's in libmetacity-private. And of course, what is being scanned has nothing to do with what headers are installed. Maybe some problem with your libtool? Maybe you are actually using an older gobject-introspection? I'll reopen the bug for now.
It sure is in libmutter-private but does not end up in mutter binary for me. Could be because we do all linking with --as-needed so it strips unused symbols and libraries. $ nm -D src/.libs/libmutter-private.so | grep preview_get_type | wc -l 1 $ nm -D src/.libs/mutter | grep preview_get_type | wc -l 0
*** Bug 588861 has been marked as a duplicate of this bug. ***
Retitling with a more findable title
Indeed, when I disable -Wl,--as-needed, the build succeeds.
Ah, I see what's going on: - Source files are duplicated between libmutter-private and the mutter executable in the assumption that mutter will *not* be linked against libmutter-private - mutter *is* linked against libmutter-private - With --as-needed, the dependency on libmutter-private is dropped because of the duplicated source files You could argue either way about whether duplicating the source files or linking against libmutter-private is the better way to do it. I'm not really sure. But since it looks like I only accidentally added the linking when first adding introspection, I'm going to revert that out and go back to the old way of doing things. (And exclude meta-preview.h from introspection)
Created attachment 138586 [details] [review] Fix confusion about MetaPreview in introspection build MetaPreview is only built into libmutter-private, and not included in the mutter executable. Linking mutter against libmutter-private was inadvertently added when the introspection build process was set up, but isn't actually needed, and if -Wl,-as-needed is added during the build process, then the libmutter-private dependency will be skipped. * Don't link mutter (or the test programs) against libmutter-private * Exclude meta-preview.h from the set of headers we feed into the introspection build process Reported by Patryk Zawadzki
Pushed to master.