GNOME Bugzilla – Bug 623889
wrong gtk used by mutter gir scanner while building Shell gir leads to failure of build
Last modified: 2010-07-09 20:31:13 UTC
(mutter:15312): GLib-GObject-WARNING **: specified class size for type `ShellEmbeddedWindow' is smaller than the parent type's `GtkWindow' class size : GLib-CRITICAL **: g_once_init_leave: assertion `initialization_value != 0' failed Invalid GType: 'shell_embedded_window_get_type' Command '['mutter', '--mutter-plugins=/home/nuno/work/gnome-shell/source/gnome-shell/src/libgnome-shell.la', '--introspect-dump=/tmp/tmp-introspect_vP5yM/types.txt,/tmp/tmp-introspect_vP5yM/dump.xml']' returned non-zero exit status -11 make[3]: *** [Shell-0.1.gir] Error 1 this is while compiling gnome-shell against a set of gtk+-3 libs into /usr/local. All configured with defaults. I fixed this one by rebuilding mutter with ./configure --with-gtk=3.0 instead of the current 2.0 default. As the GtkWindowClass that this SellEmbeddedWindowClass inherit from are not the same this mismatch is detected and abort the build. There needs some way to detect the version of gtk mutter was build against. This will fix this bug.
Created attachment 165557 [details] [review] [configure] Check that mutter was compiled with GTK+-3.0 If mutter was compiled with GTK+-2.0, the build will fail with a rather cryptic message - better fail early during configure with a proper error message. This approach uses a javascript test to check the Gtk-version of the Meta-typelib - I think that's quite realistic. It should be possible to come up with a C test if this approach is too hackish.
Review of attachment 165557 [details] [review]: ::: configure.ac @@ +168,3 @@ + imports.gi.versions.Gtk = '3.0'; +cat >conftest.js <<_ACEOF +AC_MSG_CHECKING([if mutter was compiled with GTK+-3.0]) Eeek. "pkg-config --print-requires mutter-plugins | grep gtk+-3" makes more sense to me.
(In reply to comment #2) > Eeek. "pkg-config --print-requires mutter-plugins | grep gtk+-3" makes more > sense to me. That would require a patch to mutter though ...
(In reply to comment #3) > (In reply to comment #2) > > Eeek. "pkg-config --print-requires mutter-plugins | grep gtk+-3" makes more > > sense to me. > > That would require a patch to mutter though ... Yes. But the current mutter-plugins.pc file is wrong anyways; in reality you need gtk+ and clutter.
Created attachment 165563 [details] [review] [configure] Check that mutter was compiled with GTK+-3.0 What walters said, but using libmutter-private instead of mutter-plugins (as the former already has a gtk+ dependency).
Review of attachment 165563 [details] [review]: ::: configure.ac @@ +156,3 @@ AC_SUBST(mutter) +if $PKG_CONFIG --print-requires libmutter-private | grep gtk+-3 >/dev/null; then +AC_MSG_CHECKING([if mutter was compiled with GTK+-3.0]) I personally prefer grep -q over redirecting to /dev/null, but either way fine by me.
Attachment 165563 [details] pushed as d9eb470 - [configure] Check that mutter was compiled with GTK+-3.0 OK (grep -q keeps the line length under 80 characters, so I changed that before pushing ;) )
The autoconf manual actually says: Some of the options required by Posix are not portable in practice. Don't use `grep -q' to suppress output, because many `grep' implementations (e.g., Solaris) do not support `-q'. No idea if that applies to versions of Solaris from this millenium.
(In reply to comment #8) > The autoconf manual actually says: > > Some of the options required by Posix are not portable in practice. > Don't use `grep -q' to suppress output, because many `grep' > implementations (e.g., Solaris) do not support `-q'. > > No idea if that applies to versions of Solaris from this millenium. Apparently[0] yes. Should I update the patch? [0] http://docs.sun.com/app/docs/doc/816-5165/grep-1?a=view
I'd say just fix it quickly, since we're thinking about it now and have done the research, and it might get cut-and-pasted somewhere else if we don't change it.
I am using Ubuntu Lucid and I get the following error: checking if mutter was compiled with GTK+-3.0... --print-requires: unknown option This causes the building of gnome-shell to fail. I also removed this check from configure.ac. It still complains about g_varaint_new_bytestring.
(In reply to comment #11) > checking if mutter was compiled with GTK+-3.0... --print-requires: unknown > option Yeah, sorry - this assumed a more recent version of pkg-config. It's fixed in master. > I also removed this check from configure.ac. It still complains about > g_varaint_new_bytestring. That's bug 623952 - no idea what's happening there though :(