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 780447 - @datarootdir@ in python scripts are replaced with invalid paths
@datarootdir@ in python scripts are replaced with invalid paths
Status: RESOLVED DUPLICATE of bug 780497
Product: gtk-doc
Classification: Platform
Component: general
unspecified
Other FreeBSD
: Normal normal
: ---
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on:
Blocks:
 
 
Reported: 2017-03-23 14:32 UTC by Ting-Wei Lan
Modified: 2017-03-24 12:49 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ting-Wei Lan 2017-03-23 14:32:30 UTC
In gtkdoc-mkhtml.in, several output variables are used to find installation directory at runtime:

    prefix='@prefix@'
    datarootdir='@datarootdir@'
    gtkdocdir='@datadir@/gtk-doc/data'
    styledir=gtkdocdir


However, they are replaced with paths including shell variables, which cannot be expanded by python:

    prefix='/home/lantw44/gnome/devinstall'
    datarootdir='${prefix}/share'
    gtkdocdir='${datarootdir}/gtk-doc/data'
    styledir=gtkdocdir


This causes error when building glib with --enable-gtk-doc:

  DOC   Building HTML
warning: failed to load external entity "${datarootdir}/gtk-doc/data/gtk-doc.xsl"
cannot parse ${datarootdir}/gtk-doc/data/gtk-doc.xsl
Traceback (most recent call last):
  • File "/home/lantw44/gnome/devinstall/bin/gtkdoc-mkhtml", line 90 in <module>
    document])
  • File "/home/lantw44/gnome/devinstall/bin/gtkdoc-mkhtml", line 66 in run_xsltproc
    subprocess.check_call([xsltproc] + args)
  • File "/usr/local/lib/python2.7/subprocess.py", line 186 in check_call
    raise CalledProcessError(retcode, cmd)
ubprocess.CalledProcessError: Command '['/usr/local/bin/xsltproc', '--nonet', '--xinclude', '--stringparam', 'gtkdoc.bookname', 'glib', '--stringparam', 'gtkdoc.version', '1.25.1', '--stringparam', 'chunk.quietly', '1', '--stringparam', 'chunker.output.quiet', '1', '\${datarootdir}/gtk-doc/data/gtk-doc.xsl', '../glib-docs.xml']' returned non-zero exit status 4
gmake[4]: *** [Makefile:943: html-build.stamp] Error 1
gmake[4]: Leaving directory '/home/lantw44/gnome/build/glib/docs/reference/glib'


According to the documentation of autoconf (
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Installation-Directory-Variables.html), installation directory variables can only be used in makefiles. They cannot be used in python scripts because they can have unexpanded variables.
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2017-03-24 12:49:27 UTC
Thanks for the report we've just migrated those from shell scripts and this was overlooked. It is *not* intentional.
Patches in the other bug.

*** This bug has been marked as a duplicate of bug 780497 ***