GNOME Bugzilla – Bug 747697
Documentation fails to build because of mismatching libraries
Last modified: 2015-06-07 21:18:25 UTC
$ cd bld/docs ... $ make clean ... $ make Making all in libs make[1]: Entering directory '/src/mingw/gst-plugins-bad-1.0-git-d8dd4be-1/bld/docs/libs' DOC Preparing build DOC Scanning header files DOC Introspecting gobjects (gst-plugins-bad-libs-scan.exe:9616): GStreamer-WARNING **: Failed to load plugin 'F:/e43/src/mingw/gst-plugins-bad-1.0-git-d8dd4be-1/bld\ext\dash\.libs\libgstdashdemux.dll': 'F:/e43/src/mingw/gst-plugins-bad-1.0-git-d8dd4be-1/bld\ext\dash\.libs\libgstdashdemux.dll': The specified module could not be found. (gst-plugins-bad-libs-scan.exe:9616): GLib-GObject-WARNING **: specified instance size for type 'GstGLBaseMixerPad' is smaller than the parent type's 'GstVideoAggregatorPad' instance size (gst-plugins-bad-libs-scan.exe:9616): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed $ ntldd F:/e43/src/mingw/gst-plugins-bad-1.0-git-d8dd4be-1/bld/ext/dash/.libs/libgstdashdemux.dll libgstadaptivedemux-1.0-0.dll => not found libgcc_s_sjlj-1.dll => F:\e43\mingw\bin\libgcc_s_sjlj-1.dll (0x00430000) libglib-2.0-0.dll => F:\e43\mingw\bin\libglib-2.0-0.dll (0x00780000) libgobject-2.0-0.dll => F:\e43\mingw\bin\libgobject-2.0-0.dll (0x00780000) libgstbase-1.0-0.dll => F:\e43\mingw\bin\libgstbase-1.0-0.dll (0x00780000) libgstreamer-1.0-0.dll => F:\e43\mingw\bin\libgstreamer-1.0-0.dll (0x00820000) libgsttag-1.0-0.dll => F:\e43\mingw\bin\libgsttag-1.0-0.dll (0x00430000) KERNEL32.dll => C:\Windows\system32\KERNEL32.dll (0x00780000) msvcrt.dll => C:\Windows\system32\msvcrt.dll (0x00780000) libxml2-2.dll => F:\e43\mingw\bin\libxml2-2.dll (0x00780000) <add $(top_builddir)/gst-libs/gst/adaptivedemux/libgstadaptivedemux-@GST_API_VERSION@.la \ to GTKDOC_LIBS> $ make Making all in libs make[1]: Entering directory '/src/mingw/gst-plugins-bad-1.0-git-d8dd4be-1/bld/docs/libs' cd ../../../gst-plugins-bad-d8dd4bea00c0809cb21f57a0a67d1625675af5e1 && /bin/sh /src/mingw/gst-plugins-bad-1.0-git-d8dd4be-1/gst-plugins-bad-d8dd4bea00c0809cb21f57a0a67d1625675af5e1/missing automake-1.15 --gnu docs/libs/Makefile configure.ac:68: warning: The 'AM_PROG_MKDIR_P' macro is deprecated, and its use is discouraged. configure.ac:68: You should use the Autoconf-provided 'AC_PROG_MKDIR_P' macro instead, configure.ac:68: and use '$(MKDIR_P)' instead of '$(mkdir_p)'in your Makefile.am files. cd ../.. && /bin/sh ./config.status docs/libs/Makefile config.status: creating docs/libs/Makefile DOC Scanning header files DOC Introspecting gobjects (gst-plugins-bad-libs-scan.exe:17312): GLib-GObject-WARNING **: specified instance size for type 'GstGLBaseMixerPad' is smaller than the parent type's 'GstVideoAggregatorPad' instance size (gst-plugins-bad-libs-scan.exe:17312): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed <add $(top_builddir)/gst-libs/gst/video/libgstbadvideo-@GST_API_VERSION@.la \ to GTKDOC_LIBS> $ make Making all in libs make[1]: Entering directory '/src/mingw/gst-plugins-bad-1.0-git-d8dd4be-1/bld/docs/libs' cd ../../../gst-plugins-bad-d8dd4bea00c0809cb21f57a0a67d1625675af5e1 && /bin/sh /src/mingw/gst-plugins-bad-1.0-git-d8dd4be-1/gst-plugins-bad-d8dd4bea00c0809cb21f57a0a67d1625675af5e1/missing automake-1.15 --gnu docs/libs /Makefile configure.ac:68: warning: The 'AM_PROG_MKDIR_P' macro is deprecated, and its use is discouraged. configure.ac:68: You should use the Autoconf-provided 'AC_PROG_MKDIR_P' macro instead, configure.ac:68: and use '$(MKDIR_P)' instead of '$(mkdir_p)'in your Makefile.am files. cd ../.. && /bin/sh ./config.status docs/libs/Makefile config.status: creating docs/libs/Makefile DOC Scanning header files DOC Introspecting gobjects DOC Building XML <and it goes on to spew the usual documentation warnings, but eventually builds>
Created attachment 301360 [details] [review] Add adaptivedemux and badvideo to the list of scanned
Why would the documentation scanner need to link to these libraries directly if it doesn't use any of those libraries' APIs directly ? It seems to me more like there's something not quite right with dashdemux's linking or libtool or libgstadaptivedemux? (Not sure what it is though, the hls plugin doesn't seem to have the same problem, or does it?)
dash uses adaptivedemux (see gst_dash_demux_setup_all_streams(), for example)
> dash uses adaptivedemux Yes, of course. > $ ntldd > F:/e43/src/mingw/gst-plugins-bad-1.0-git-d8dd4be-1/bld/ext/dash/.libs/ > libgstdashdemux.dll > libgstadaptivedemux-1.0-0.dll => not found What I meant is that it seems to me that this here is the underlying problem, and your proposed patch is just a workaround.
Created attachment 301368 [details] [review] Add adaptivedemux and badvideo to the link-list for the docscanner
Things "just work" because LD="${builddir}/libtool --mode=link ...", gtkdoc uses it to link the scanner, libtool fills the $dllsearchpath variable and puts it into the scanner wrapper, which uses it to modify PATH before running the scanner proper. $dllsearchpath is populated in two ways: 1) from -L arguments to libtool 2) from $sys_lib_dlsearch_path (LT_SYS_LIBRARY_PATH) LT_SYS_LIBRARY_PATH is supposed to be user-defined (passed to configure), so we can't use it to tell libtool to add adaptivedemux library dir to the path. That leaves -L. See the attachment 301368 [details] [review].
Review of attachment 301368 [details] [review]: ::: docs/libs/Makefile.am @@ +60,3 @@ $(top_builddir)/gst-libs/gst/gl/libgstgl-@GST_API_VERSION@.la \ + -L$(top_srcdir)/gst-libs/gst/adaptivedemux \ + -L$(top_srcdir)/gst-libs/gst/video \ Shouldn't this also use the .la files as for all the others above?
(In reply to Sebastian Dröge (slomo) from comment #7) > Review of attachment 301368 [details] [review] [review]: > > ::: docs/libs/Makefile.am > @@ +60,3 @@ > $(top_builddir)/gst-libs/gst/gl/libgstgl-@GST_API_VERSION@.la \ > + -L$(top_srcdir)/gst-libs/gst/adaptivedemux \ > + -L$(top_srcdir)/gst-libs/gst/video \ > > Shouldn't this also use the .la files as for all the others above? Scroll up the bug page, that was attachment 301360 [details] [review].
After thinking a bit about this and the confusion this issue appears to be causing to the developers, here's some thoughts: The problem is that doc-scanner scans *libraries* (GTKDOC_LIBS only has names from gst-libs), but ends up loading plugins too (because it runs gst_init, which updates the registry). libtool, when it runs the scanner, knows nothing about plugins and their dependencies, and has no way to know that it needs to have some extra DLLs (libgstadaptivemux) in PATH. Which is why dash plugin fails to load. The other problem has the same roots: installed libgstbadvideo (from 1.4.5) is loaded instead of the one that was just built (from git). It has different size of the GstVideoAggregatorPad structure, hence the warning and, eventually, hangup (because initialization critically fails). attachment 301368 [details] [review] is, IMHO, an acceptable workaround. One could change PATH instead of adding -L directories, but that would be too overtly windows-oriented.
When no -bad is installed at all, this is what i get when building without any extra patches: make[3]: Entering directory '/src/mingw/gst-plugins-bad-1.0-git-d8dd4be-1/bld/docs/libs' DOC Preparing build DOC Scanning header files DOC Introspecting gobjects (gst-plugins-bad-libs-scan.exe:2364): GStreamer-WARNING **: Failed to load plugin 'F:/e43/src/mingw/gst-plugins-bad-1.0-git-d8dd4be-1/bld\ext\dash\.libs\libgstdashdemux.dll': 'F:/e43/src/mingw/gst-plugins-bad-1.0-git-d8dd4be-1/bld\ext\dash\.libs\libgstdashdemux.dll': The specified module could not be found. (gst-plugins-bad-libs-scan.exe:2364): GStreamer-WARNING **: Failed to load plugin 'F:/e43/src/mingw/gst-plugins-bad-1.0-git-d8dd4be-1/bld\ext\gl\.libs\libgstopengl.dll': 'F:/e43/src/mingw/gst-plugins-bad-1.0-git-d8dd4be-1/bld\ext\gl\.libs\libgstopengl.dll': The specified module could not be found. (gst-plugins-bad-libs-scan.exe:2364): GStreamer-WARNING **: Failed to load plugin 'F:/e43/src/mingw/gst-plugins-bad-1.0-git-d8dd4be-1/bld\ext\hls\.libs\libgstfragmented.dll': 'F:/e43/src/mingw/gst-plugins-bad-1.0-git-d8dd4be-1/bld\ext\hls\.libs\libgstfragmented.dll': The specified module could not be found. (gst-plugins-bad-libs-scan.exe:2364): GStreamer-WARNING **: Failed to load plugin 'F:/e43/src/mingw/gst-plugins-bad-1.0-git-d8dd4be-1/bld\ext\smoothstreaming\.libs\libgstsmoothstreaming.dll': 'F:/e43/src/mingw/gst-plugins-bad-1.0-git-d8dd4be-1/bld\ext\smoothstreaming\.libs\libgstsmoothstreaming.dll': The specified module could not be found. (gst-plugins-bad-libs-scan.exe:2364): GStreamer-WARNING **: Failed to load plugin 'F:/e43/src/mingw/gst-plugins-bad-1.0-git-d8dd4be-1/bld\gst\audiomixer\.libs\libgstaudiomixer.dll': 'F:/e43/src/mingw/gst-plugins-bad-1.0-git-d8dd4be-1/bld\gst\audiomixer\.libs\libgstaudiomixer.dll': The specified module could not be found. (gst-plugins-bad-libs-scan.exe:2364): GStreamer-WARNING **: Failed to load plugin 'F:/e43/src/mingw/gst-plugins-bad-1.0-git-d8dd4be-1/bld\gst\compositor\.libs\libgstcompositor.dll': 'F:/e43/src/mingw/gst-plugins-bad-1.0-git-d8dd4be-1/bld\gst\compositor\.libs\libgstcompositor.dll': The specified module could not be found. (gst-plugins-bad-libs-scan.exe:2364): GStreamer-WARNING **: Failed to load plugin 'F:/e43/src/mingw/gst-plugins-bad-1.0-git-d8dd4be-1/bld\gst-libs\gst\video\.libs\libgstbadvideo-1.0-0.dll': 'F:/e43/src/mingw/gst-plugins-bad-1.0-git-d8dd4be-1/bld\gst-libs\gst\video\.libs\libgstbadvideo-1.0-0.dll': The specified module could not be found. DOC Building XML And then proceeds to build the documentation. That is, the fatal error was the "specified instance size for type 'GstGLBaseMixerPad' is smaller than the parent type's 'GstVideoAggregatorPad' instance size" cause by linking to incompatible libgstbadvideo-1.0, not the inability to load some plugins. I don't know why libgstbadvideo-1.0-0.dll is among the plugins it tries to load.
Comment on attachment 301368 [details] [review] Add adaptivedemux and badvideo to the link-list for the docscanner Marked obsolete. $(top_srcdir) is not the right directory to -L, think...Testing various variants of this patch in '-bad-is-not-installed' configuration.
Created attachment 301581 [details] [review] Add adaptivedemux, badvideo and badbase to the link-list for the docscanner This works both when no -bad is installed *and* when old & incompatible -bad is installed. This patch is also aimed at complete elimination of plugin loading problems for the scranner. Eliminating *only* the critical error (that prevents documentation building) requires adding only gst-libs/video/.libs (probably, haven't checked yet)
I don't understand why that works :) It's only adding linker paths... but the problem is with finding the libraries at runtime.
See above. libtool figures out: "Okay, i've linked a program to some libraries deep in the buildtree, but how the hell is it going to find these libraries when it runs, huh? Well, no worries, i'll just tuck it into .libs subdirectory and present a wrapper instead, and code the wrapper to populate PATH with anything it might need, starting with all the directories that were passed with -L, and some other stuff". So -L is just me exploiting libtool implementation detail. Adding .la instead would be more mainstream, BUT would cause gtk-doc to scan these libraries, which __tim said is a big no-no.
It's all very weird, I don't like it :) But it makes sense in a way, and it doesn't look like there's anything else we can do other than setting up $PATH ourselves.
Please push then. I don't have commit access.
commit 12ffc7f5e48102a3ad069b09fe80c4607206686b Author: Руслан Ижбулатов <lrn1986@gmail.com> Date: Sat Apr 11 04:20:43 2015 +0000 Add adaptivedemux, badvideo and badbase to the link-list for the docscanner https://bugzilla.gnome.org/show_bug.cgi?id=747697
I fixed this differently in http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=02c75e52d69c54b54e9069a13cc6f5cbdb6e811f and http://cgit.freedesktop.org/gstreamer/common/commit/?id=21ba2e575a0ecb8c51b46fa31d4b9cfd699da8b2 let me know if this causes problems on windows.