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 787768 - Aborts when glib2.0-dev is not installed
Aborts when glib2.0-dev is not installed
Status: RESOLVED FIXED
Product: gtk-doc
Classification: Platform
Component: general
1.26
Other Linux
: Normal normal
: 1.27
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on:
Blocks:
 
 
Reported: 2017-09-16 19:09 UTC by Emilio Pozuelo Monfort
Modified: 2017-10-25 19:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
possible fix (3.11 KB, patch)
2017-10-03 13:13 UTC, Christoph Reiter (lazka)
committed Details | Review
fixxref/rebase: Don't depend on glib being installed (3.18 KB, patch)
2017-10-25 17:58 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
committed Details | Review

Description Emilio Pozuelo Monfort 2017-09-16 19:09:43 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.
Comment 1 Christoph Reiter (lazka) 2017-10-03 13:13:29 UTC
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..
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2017-10-25 17:56:27 UTC
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.
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2017-10-25 17:58:45 UTC
The following fix has been pushed:
669d07a fixxref/rebase: Don't depend on glib being installed
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2017-10-25 17:58:52 UTC
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.
Comment 5 Christoph Reiter (lazka) 2017-10-25 19:08:45 UTC
Thanks!