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 603710 - Can't compile with introspection support
Can't compile with introspection support
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other Linux
: Normal blocker
: 0.10.29
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-12-03 17:14 UTC by Vincent Untz
Modified: 2010-04-03 13:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch that fixes the build (526 bytes, patch)
2009-12-03 17:36 UTC, Vincent Untz
needs-work Details | Review
gstreamer-plugins-base patch (1.72 KB, patch)
2009-12-04 01:35 UTC, Vincent Untz
none Details | Review
base and net need access to the un-installed .libs (1.31 KB, patch)
2010-03-29 03:51 UTC, Alan Knowles
none Details | Review
direct access to gstreamer.la (1.76 KB, patch)
2010-03-29 11:14 UTC, Alan Knowles
rejected Details | Review
minimal patch: libs: point gobject-introspection scanner to .la files (3.94 KB, patch)
2010-03-31 09:51 UTC, Tim-Philipp Müller
committed Details | Review

Description Vincent Untz 2009-12-03 17:14:28 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.
Comment 1 Vincent Untz 2009-12-03 17:36:52 UTC
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?
Comment 2 Vincent Untz 2009-12-04 01:35:01 UTC
Created attachment 149063 [details] [review]
gstreamer-plugins-base patch

Just for reference, I need a similar for plugins-base.

Still no idea why, though :/
Comment 3 Sebastian Dröge (slomo) 2009-12-04 15:37:55 UTC
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 ?
Comment 4 Vincent Untz 2009-12-04 15:49:22 UTC
(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.
Comment 5 Jan Schmidt 2010-03-25 05:12:34 UTC
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):
  • File "/usr/bin/g-ir-scanner", line 38 in <module>
    sys.exit(scanner_main(sys.argv))
  • File "/usr/lib/gobject-introspection/giscanner/scannermain.py", line 313 in scanner_main
    glibtransformer.get_get_type_functions())
  • File "/usr/lib/gobject-introspection/giscanner/dumper.py", line 231 in compile_introspection_binary
    return dc.run()
  • File "/usr/lib/gobject-introspection/giscanner/dumper.py", line 132 in run
    self._link(bin_path, o_path)
  • File "/usr/lib/gobject-introspection/giscanner/dumper.py", line 226 in _link
    subprocess.check_call(args)
  • File "/usr/lib/python2.6/subprocess.py", line 488 in check_call
    raise CalledProcessError(retcode, cmd)
ubprocess.CalledProcessError: Command '['../../../libtool', '--mode=link', '--tag=CC', '--silent', 'gcc', '-o', '/home/jan/devel/gstreamer/head/gstreamer/libs/gst/base/tmp-introspectiXPLTi/GstBase-0.10', '-L.', '-lgstbase-0.10', '-pthread', '-Wl,--export-dynamic', '-lgio-2.0', '-lgirepository-1.0', '-lgobject-2.0', '-lgmodule-2.0', '-lgthread-2.0', '-lrt', '-lffi', '-lglib-2.0', '/home/jan/devel/gstreamer/head/gstreamer/libs/gst/base/tmp-introspectiXPLTi/GstBase-0.10.o']' returned non-zero exit status 1
make: *** [GstBase-0.10.gir] Error 1
Comment 6 Sebastian Dröge (slomo) 2010-03-25 07:02:28 UTC
Jan, does it help if you add LD_LIBRARY_PATH stuff before the gobject-introspection calls in the Makefiles?
Comment 7 Jan Schmidt 2010-03-25 07:16:56 UTC
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.
Comment 8 Jan Schmidt 2010-03-25 11:47:55 UTC
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 :-/
Comment 9 Tim-Philipp Müller 2010-03-25 12:39:43 UTC
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 \
Comment 10 Vincent Untz 2010-03-25 15:12:15 UTC
Tim: nope, doesn't help.
Comment 11 Alan Knowles 2010-03-29 03:51:09 UTC
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
Comment 12 Alan Knowles 2010-03-29 04:04:17 UTC
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.
Comment 13 Jan Schmidt 2010-03-29 07:33:51 UTC
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.
Comment 14 Alan Knowles 2010-03-29 11:14:15 UTC
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@ ??
Comment 15 Tim-Philipp Müller 2010-03-29 11:25:56 UTC
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?
Comment 16 Tim-Philipp Müller 2010-03-29 17:34:07 UTC
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.
Comment 17 Tim-Philipp Müller 2010-03-31 09:51:35 UTC
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?)
Comment 18 Vincent Untz 2010-03-31 10:20:07 UTC
Builds fine for me with this patch.
Comment 19 Tim-Philipp Müller 2010-04-03 13:07:56 UTC
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.