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 587975 - Failed to find symbol 'meta_preview_get_type'
Failed to find symbol 'meta_preview_get_type'
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
: 588861 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-07-07 13:57 UTC by Patryk Zawadzki
Modified: 2009-07-17 12:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (304 bytes, patch)
2009-07-07 14:01 UTC, Patryk Zawadzki
none Details | Review
Fix confusion about MetaPreview in introspection build (2.66 KB, patch)
2009-07-17 11:58 UTC, Owen Taylor
none Details | Review

Description Patryk Zawadzki 2009-07-07 13:57:53 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
Comment 1 Patryk Zawadzki 2009-07-07 14:01:19 UTC
Created attachment 137970 [details] [review]
Proposed patch
Comment 2 Owen Taylor 2009-07-07 15:03:13 UTC
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.)
Comment 3 Patryk Zawadzki 2009-07-07 15:25:30 UTC
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
Comment 4 Owen Taylor 2009-07-10 18:17:17 UTC
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.
Comment 5 Patryk Zawadzki 2009-07-10 19:36:45 UTC
Wait, I gave the version in the earlier comment :)
Comment 6 Owen Taylor 2009-07-11 20:16:27 UTC
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.


Comment 7 Patryk Zawadzki 2009-07-11 20:23:51 UTC
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
Comment 8 Owen Taylor 2009-07-17 11:07:01 UTC
*** Bug 588861 has been marked as a duplicate of this bug. ***
Comment 9 Owen Taylor 2009-07-17 11:07:51 UTC
Retitling with a more findable title
Comment 10 Götz Waschk 2009-07-17 11:13:12 UTC
Indeed, when I disable -Wl,--as-needed, the build succeeds.
Comment 11 Owen Taylor 2009-07-17 11:52:17 UTC
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)
Comment 12 Owen Taylor 2009-07-17 11:58:33 UTC
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
Comment 13 Owen Taylor 2009-07-17 12:02:36 UTC
Pushed to master.