GNOME Bugzilla – Bug 603710
Can't compile with introspection support
Last modified: 2010-04-03 13:09:29 UTC
When I compile a rpm of gstreamer 0.10.25 with introspection, it always fails with: libtool: link: (cd ".libs" && rm -f "libgstcheck-0.10.so.0" && ln -s "libgstcheck-0.10.so.0.22.0" "libgstcheck-0.10.so.0") libtool: link: (cd ".libs" && rm -f "libgstcheck-0.10.so" && ln -s "libgstcheck-0.10.so.0.22.0" "libgstcheck-0.10.so") libtool: link: ( cd ".libs" && rm -f "libgstcheck-0.10.la" && ln -s "../libgstcheck-0.10.la" "libgstcheck-0.10.la" ) /usr/src/packages/BUILD/gstreamer-0.10.25/gst/gstutils.h:503: syntax error, unexpected INTEGER ERROR: can't resolve libraries to shared libraries: gstcheck-0.10 make[6]: *** [GstCheck-0.10.gir] Error 1 The weird thing is that chrooting into the build root and typing make, it works fine.
Created attachment 149020 [details] [review] Patch that fixes the build The attached patch fixes the build for me. What's interesting is that it only occurs for gstcheck, and it works fine everywhere else. Any idea what could be wrong?
Created attachment 149063 [details] [review] gstreamer-plugins-base patch Just for reference, I need a similar for plugins-base. Still no idea why, though :/
I don't know either... which version of gobject-introspection are you using? It works fine with the latest release for me. Also is there something special about your build process or is it normal ./configure && make ?
(In reply to comment #3) > I don't know either... which version of gobject-introspection are you using? It > works fine with the latest release for me. gobject-introspection 0.6.5, which is the latest one, afaik. > Also is there something special about your build process or is it normal > ./configure && make ? We do: $ ./autogen.sh => needed because some Makefile.am files are changed by a patch $ export CFLAGS="-O2 -g -m32 -march=i686 -mtune=i686 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -fno-strict-aliasing" => (standard stuff) $ ./configure --host=%{_host} --build=%{_build} \ --target=%{_target_platform} \ --program-prefix=%{?_program_prefix} \ --prefix=%{_prefix} \ --exec-prefix=%{_exec_prefix} \ --bindir=%{_bindir} \ --sbindir=%{_sbindir} \ --sysconfdir=%{_sysconfdir} \ --datadir=%{_datadir} \ --includedir=%{_includedir} \ --libdir=%{_libdir} \ --libexecdir=%{_libexecdir} \ --localstatedir=%{_localstatedir} \ --sharedstatedir=%{_sharedstatedir} \ --mandir=%{_mandir} \ --infodir=%{_infodir} \ --enable-introspection \ --disable-static => (standard stuff too) $ make -jX => sounds normal too Again, the weird thing is that it worked fine when chrooting in the build root and typing make. Also, it's worth noting that it works fine for all other packages using introspection.
I have problems building core today. It looks like the gobject-introspection compiler pulls in the wrong libgstreamer from the system install, so the new symbols are unavailable and everything fails. That's pretty bad of it. Here's the end of the build output: PKG_CONFIG_PATH="/home/jan/.install/lib/pkgconfig:/home/jan/devel/gstreamer/head/totem-pl-parser:/home/jan/devel/gstreamer/head/prefix/lib/pkgconfig:/home/jan/devel/gstreamer/head/gstreamer/pkgconfig:/home/jan/devel/gstreamer/head/gst-plugins-base/pkgconfig:/home/jan/devel/gstreamer/head/gst-plugins-good/pkgconfig:/home/jan/devel/gstreamer/head/gst-python/pkgconfig:/home/jan/devel/gstreamer/head/gst-rtsp-server/pkgconfig:/home/jan/devel/gstreamer/head/gstreamer-sharp/pkgconfig:/home/jan/.install/lib/pkgconfig:/home/jan/.install/lib/pkgconfig:/home/jan/.install/lib/pkgconfig:../../../pkgconfig" \ /usr/bin/g-ir-scanner -v --namespace GstBase \ --nsversion=0.10 \ --strip-prefix=Gst \ -I../../.. \ --c-include='gst/base/gstadapter.h' --c-include='gst/base/gstbasesink.h' --c-include='gst/base/gstbasesrc.h' --c-include='gst/base/gstbasetransform.h' --c-include='gst/base/gstbitreader.h' --c-include='gst/base/gstbytereader.h' --c-include='gst/base/gstbytewriter.h' --c-include='gst/base/gstcollectpads.h' --c-include='gst/base/gstpushsrc.h' --c-include='gst/base/gsttypefindhelper.h' --c-include='gst/base/gstdataqueue.h' \ --add-include-path=../../../gst \ --library=gstbase-0.10 \ --include=Gst-0.10 \ --libtool="../../../libtool" \ --pkg gstreamer-0.10 \ --output GstBase-0.10.gir \ ./gstadapter.h ./gstbasesink.h ./gstbasesrc.h ./gstbasetransform.h ./gstbitreader.h ./gstbytereader.h ./gstbytewriter.h ./gstcollectpads.h ./gstpushsrc.h ./gsttypefindhelper.h ./gstdataqueue.h \ ./gstadapter.c ./gstbasesink.c ./gstbasesrc.c ./gstbasetransform.c ./gstbitreader.c ./gstbytereader.c ./gstbytewriter.c ./gstcollectpads.c ./gstpushsrc.c ./gsttypefindhelper.c ./gstdataqueue.c /home/jan/devel/gstreamer/head/gstreamer/libs/gst/base/.libs/libgstbase-0.10.so: undefined reference to `gst_message_set_qos_values' /home/jan/devel/gstreamer/head/gstreamer/libs/gst/base/.libs/libgstbase-0.10.so: undefined reference to `gst_message_set_qos_stats' /home/jan/devel/gstreamer/head/gstreamer/libs/gst/base/.libs/libgstbase-0.10.so: undefined reference to `gst_message_new_qos' collect2: ld returned 1 exit status Traceback (most recent call last):
+ Trace 221083
sys.exit(scanner_main(sys.argv))
glibtransformer.get_get_type_functions())
return dc.run()
self._link(bin_path, o_path)
subprocess.check_call(args)
raise CalledProcessError(retcode, cmd)
make: *** [GstBase-0.10.gir] Error 1
Jan, does it help if you add LD_LIBRARY_PATH stuff before the gobject-introspection calls in the Makefiles?
I tried a bunch of LD_LIBRARY_PATH attempts (setting it in the environment, running make LD_LIBRARY_PATH, adding it in the Makefile.am). None made any difference. Also, annoyingly, it leaves behind a new 'tmp-introspectiXXXXXX' directory on every failure.
Dang - my problem disappeared. After trying a build with --prefix=/usr it went away, and it's still gone after switching back to the prefix I normally use. Before all of that, I had tried a build with 'git clean -f -d -x'... which should have completely scrubbed the tree, so I have no idea what's going on. Either way, I can't reproduce it now :-/
Vincent: does this help in your case? (the libs in -plugins-base also have it the wrong way round) diff --git a/libs/gst/check/Makefile.am b/libs/gst/check/Makefile.am index a526afc..a94df7d 100644 --- a/libs/gst/check/Makefile.am +++ b/libs/gst/check/Makefile.am @@ -111,7 +111,7 @@ gir_sources=$(patsubst %,$(srcdir)/%, $(libgstcheck_@GST_MAJORMINOR@_la_SOURCES) gir_cincludes=$(patsubst %,--c-include='gst/check/%',$(libgstcheck_@GST_MAJORMINOR@include_HEADERS)) GstCheck-@GST_MAJORMINOR@.gir: $(INTROSPECTION_SCANNER) libgstcheck-@GST_MAJORMINOR@.la - $(AM_V_GEN)PKG_CONFIG_PATH="$(PKG_CONFIG_PATH):$(top_builddir)/pkgconfig" \ + $(AM_V_GEN)PKG_CONFIG_PATH="$(top_builddir)/pkgconfig:$(PKG_CONFIG_PATH)" \ $(INTROSPECTION_SCANNER) -v --namespace GstCheck \ --nsversion=@GST_MAJORMINOR@ \ --strip-prefix=Gst \
Tim: nope, doesn't help.
Created attachment 157347 [details] [review] base and net need access to the un-installed .libs The net/base issue is due to the problem with not having access to the not yet installed libraries. - it only occurs if the gstreamer library has not already been installed (often by system packages). This patch may also help. - it's upstream on introspection as well. +++ b/giscanner/dumper.py @@ -197,6 +198,11 @@ class DumpCompiler(object): # Search the current directory first args.append('-L.') + #I've not been able to reproduce more than once, but I suspect + #Gtk needs -L../gdk/.libs adding to Makefile.. and this adding + for libpath in self._options.library_paths: + args.append('-L' + libpath) + uninst_builddir = os.environ.get('UNINSTALLED_INTROSPECTION_BUILDDIR') # hack for building GIRepository.gir, skip -lgirepository-1.0 since # libgirepository-1.0.la is not in current directory and we refer to it
Forgot to mention there's a little fix to one of the files at the bottom of that patch, using the wrong name for a type.
Anything which requires passing the libtool .libs directory as a path is the wrong answer. If the problem is libtool, then we should be looking at how to get gobject-introspection to invoke libtool appropriately.
Created attachment 157372 [details] [review] direct access to gstreamer.la here's a better version - point to $(top_builddir)/gst/libgstreamer-@GST_MAJORMINOR@.la I'm guessing the other 0.10 stuff should also change to @GST_MAJORMINOR@ ??
As it turns out, there are problems with the [ 0.10.25, 0.10.28 ] releases and gobject-introspection when builddir != srcdir. This: $ tar xjf gstreamer-0.10.28.tar.bz2 $ cd gstreamer-0.10.28 $ mkdir _build $ cd _build $ ../configure --prefix=/foo/bar $ make will lead to warnings about includes it can't find when building the gobject-introspection info, which may be related. This should be fixed in current git though, so it would be good if Regarding the patches that pass the .la directly in some way or another: I don't understand why this should be needed. It should get this info from the in-tree gstreamer-0.10-uninstalled.pc via pkg-config as far as I can tell. Why does that not work?
Ok, so looking at the Makefile.introspection that ships with gobject-introspection, we should indeed be passing --library=libgstcheck-0.10.la instead of --library=gstcheck-0.10, so I guess Vincent's patch (attachement #149020) is correct then. No idea why it only fails for gstcheck and not elsewhere. Maybe we should use this opportunity to move our 'homegrown' Makefile.am stuff over to that Makefile included with gobject-introspection while we're at it.
Created attachment 157564 [details] [review] minimal patch: libs: point gobject-introspection scanner to .la files Does this minimal patch work for the both of you (Vincent, Alan)? libs: point gobject-introspection scanner to .la files Point g-ir-scanner to the .la file of our library, which hopefully makes it find the right dependencies in all cases (ie. our locally built libgstreamer and not the system-installed one). This is also how it's done in Gtk+ and how it's documented in the wiki, see http://live.gnome.org/GObjectIntrospection/AutotoolsIntegration Based on patches by Vincent Untz and Alan Knowles. Hopefully fixes #603710. (PS: I'm using gobject-introspection 0.6.8 if it matters, maybe earlier versions didn't can for the .la file automatically?)
Builds fine for me with this patch.
Ok, thanks for confirming. Committed that and the same for -base (but changed it for all libraries there): commit 764c899215f6e61b45be92a041b92687bd2afa0b Author: Vincent Untz <vuntz@gnome.org> Date: Sat Apr 3 14:03:45 2010 +0100 libs: point gobject-introspection scanner to .la files Point g-ir-scanner to the .la file of our library, which hopefully makes it find the right dependencies in all cases (ie. our locally built libgstreamer and not the system-installed one). This is also how it's done in Gtk+ and how it's documented in the wiki, see http://live.gnome.org/GObjectIntrospection/AutotoolsIntegration Fixes #603710. Sorry it took so long to fix.