GNOME Bugzilla – Bug 787768
Aborts when glib2.0-dev is not installed
Last modified: 2017-10-25 19:08:45 UTC
Hi, Apparently gtk-doc since 1.26 (since the python switch) aborts now when glib2.0-dev (or its pkg-config file, actually) is not installed, e.g.: | cd html && gtkdoc-mkhtml $mkhtml_options --path=/<<PKGBUILDDIR>>/build-deb/../libkmod/docs/doc --path=/<<PKGBUILDDIR>>/build-deb/libkmod/docs/doc libkmod ../libkmod-docs.xml | Computing chunks... | Writing libkmod-libkmod.html for refentry(libkmod-libkmod) | Writing libkmod-libkmod-list.html for refentry(libkmod-libkmod-list) | Writing libkmod-libkmod-config.html for refentry(libkmod-libkmod-config) | Writing libkmod-libkmod-module.html for refentry(libkmod-libkmod-module) | Writing libkmod-libkmod-loaded.html for refentry(libkmod-libkmod-loaded) | Writing ch01.html for chapter | Writing api-index-full.html for index(api-index-full) | Writing index.html for book(index) | Writing libkmod.devhelp2 for book(index) | gtkdoc-fixxref --module=libkmod --module-dir=html --html-dir=/usr/share/gtk-doc/html | Package glib-2.0 was not found in the pkg-config search path. | Perhaps you should add the directory containing `glib-2.0.pc' | to the PKG_CONFIG_PATH environment variable | No package 'glib-2.0' found | Traceback (most recent call last): | File "/usr/bin/gtkdoc-fixxref", line 57, in <module> | fixxref.Run(options) | File "/usr/share/gtk-doc/python/gtkdoc/fixxref.py", line 74, in Run | dir = common.GetModuleDocDir('glib-2.0') | File "/usr/share/gtk-doc/python/gtkdoc/common.py", line 104, in GetModuleDocDir | path = subprocess.check_output([config.pkg_config, '--variable=prefix', module_name], universal_newlines=True) | File "/usr/lib/python2.7/subprocess.py", line 219, in check_output | raise CalledProcessError(retcode, cmd, output=output) | subprocess.CalledProcessError: Command '['/usr/bin/pkg-config', '--variable=prefix', 'glib-2.0']' returned non-zero exit status 1 | Makefile:667: recipe for target 'html-build.stamp' failed | make[3]: *** [html-build.stamp] Error 1 | Makefile:2117: recipe for target 'all-recursive' failed | make[2]: *** [all-recursive] Error 1 | Makefile:1170: recipe for target 'all' failed With previous versions, perl didn't abort and kept running: gtkdoc-fixxref --module=libkmod --module-dir=html --html-dir=/usr/share/gtk-doc/html Package glib-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `glib-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'glib-2.0' found touch html-build.stamp I guess the glib dirs are just optional and we need to catch and handle the exceptions in case pkg-config fails.
Created attachment 360834 [details] [review] possible fix I've been hitting the same problem when trying to build glib on Windows and worked around the issue for now with the attached patch by ignoring the error. But I don't know if it's the right thing to do here..
Yes, it is the right thing to do, since the adding glib-2.0 by default is mostly a backwards compat thing. I'll add some deprecation mark as well.
The following fix has been pushed: 669d07a fixxref/rebase: Don't depend on glib being installed
Created attachment 362281 [details] [review] fixxref/rebase: Don't depend on glib being installed As is the case when you build docs for glib itself.
Thanks!