GNOME Bugzilla – Bug 169324
doesn't build if builddir != srcdir
Last modified: 2007-03-28 16:19:05 UTC
First patch coming up; also fixes left-over files after make clean. Only fixes part of the problem; the build will still fail later on (in doc/xslt).
Created attachment 38313 [details] [review] first patch Fixes builddir != srcdir builds in xslt/. Also, was there a reason to include files installed by automake in cvs? (INSTALL and sandbox/mallard/INSTALL)
All of these seem to already be applied, except the change to the l10n.xml rule. And in fact, gdu builds in a separate builddir fine for me now, and doesn't if I apply that change. Confirm?
It doesn't even autogen from builddir: do a clean checkout of g-d-u mkdir build cd build ../autogen.sh Result: ../autogen.sh: line 29: ./gnome-autogen.sh: Aucun fichier ou répertoire de ce type After changing that line to refer to $srcdir/gnome-autogen.sh instead, autogen succeeds. But the build fails: make[2]: entrant dans le répertoire « /opt/source/gnome-2/12/Q/gnome-doc-utils/build/xml2po » sed -e "s/^VERSION =.*/VERSION = \"0.2.0\"/" \ -e "s+^submodes_path =.*+submodes_path = \"/opt/gnome-2.12/share/xml2po\"+" \ -e "s+^#!.*python.*+#!/usr/bin/python+" \ < ../../xml2po/xml2po.py > xml2po chmod +x xml2po docbook2x-man --to-stdout xml2po.1.xml >xml2po.1 I/O warning : failed to load external entity "xml2po.1.xml" /usr/bin/db2x_xsltproc: cannot parse input document Empty Stream at /usr/lib/perl5/XML/LibXML.pm line 399. at /usr/lib/perl5/XML/LibXML/SAX.pm line 63 make[2]: *** [xml2po.1] Erreur 255 make[2]: quittant le répertoire « /opt/source/gnome-2/12/Q/gnome-doc-utils/build/xml2po » xml2po.1.xml exists in the srcdir, not in the builddir.
This seems fixed in cvs, not reproducible any more.
The xml2po.1.xml reference is still incorrect in SVN, but the problem was hidden by this: xml2po.1: xml2po.1.xml -@(xsltproc --nonet xml2po.1.xml) (The - means the failure is ignored and the @ will hide the command; not sure about the reason for the parenthesis). I'm going to attach an updated patch which simply adds $(srcdir) in front of xml2po.1.xml and drops the -@() construct.
Created attachment 82826 [details] [review] Display xsltproc invocation, honor its exit status, and pull the source from srcdir This is what one would see before applying the patch: make[2]: entrant dans le répertoire « /home/lool/jhbuild-gnome-2.18/build/gnome-doc-utils/xml2po » sed -e "s/^VERSION =.*/VERSION = \"0.9.2\"/" \ -e "s+^submodes_path =.*+submodes_path = \"/home/lool/jhbuild-gnome-2.18/prefix/share/xml2po\"+" \ -e "s+^#!.*python.*+#!/usr/bin/python+" \ < /home/lool/jhbuild-gnome-2.18/checkout/gnome-doc-utils/xml2po/xml2po.py > xml2po xsltproc --nonet xml2po.1.xml warning: failed to load external entity "xml2po.1.xml" cannot parse xml2po.1.xml make[2]: [xml2po.1] Erreur 4 (ignorée) And after the patch: make[2]: entrant dans le répertoire « /home/lool/jhbuild-gnome-2.18/build/gnome-doc-utils/xml2po » sed -e "s/^VERSION =.*/VERSION = \"0.9.2\"/" \ -e "s+^submodes_path =.*+submodes_path = \"/home/lool/jhbuild-gnome-2.18/prefix/share/xml2po\"+" \ -e "s+^#!.*python.*+#!/usr/bin/python+" \ < /home/lool/jhbuild-gnome-2.18/checkout/gnome-doc-utils/xml2po/xml2po.py > xml2po chmod +x xml2po xsltproc --nonet /home/lool/jhbuild-gnome-2.18/checkout/gnome-doc-utils/xml2po/xml2po.1.xml Note: meta source : No productname or alternative xml2po Note: meta source : No refmiscinfo@class=source xml2po Note: meta version: No productnumber or alternative xml2po Note: meta version: No refmiscinfo@class=version xml2po Warn: meta source : No valid fallback. Leaving empty xml2po Note: meta manual : No ancestor with title xml2po Note: meta manual : No refmiscinfo@class=manual xml2po Warn: meta manual : No valid fallback. Leaving empty xml2po Note: Writing xml2po.1 make[2]: quittant le répertoire « /home/lool/jhbuild-gnome-2.18/build/gnome-doc-utils/xml2po »
Created attachment 82828 [details] [review] Drop superfluous `pwd`/ in db2omf.omf_in stringparam Another failure occurs subsequently which looks like this: Making all in gnome-doc-make make[2]: entrant dans le répertoire « /home/lool/jhbuild-gnome-2.18/build/gnome-doc-utils/doc/gnome-doc-make » gawk -f /home/lool/jhbuild-gnome-2.18/checkout/gnome-doc-utils/doc/gnome-doc-make/gnome-doc-make.awk /home/lool/jhbuild-gnome-2.18/checkout/gnome-doc-utils/tools/gnome-doc-utils.make > /home/lool/jhbuild-gnome-2.18/checkout/gnome-doc-utils/doc/gnome-doc-make/C/make-ref.xml xsltproc -o gnome-doc-make-C.omf --stringparam db2omf.basename gnome-doc-make --stringparam db2omf.format 'docbook' --stringparam db2omf.dtd "-//OASIS//DTD DocBook XML V4.4//EN" --stringparam db2omf.lang C --stringparam db2omf.omf_dir "/home/lool/jhbuild-gnome-2.18/prefix/share/omf" --stringparam db2omf.help_dir "/home/lool/jhbuild-gnome-2.18/prefix/share/gnome/help" --stringparam db2omf.omf_in "/home/lool/jhbuild-gnome-2.18/checkout/gnome-doc-utils/doc/gnome-doc-make//home/lool/jhbuild-gnome-2.18/checkout/gnome-doc-utils/doc/gnome-doc-make/gnome-doc-make.omf.in" --stringparam db2omf.scrollkeeper_cl "`scrollkeeper-config --pkgdatadir`/Templates/C/scrollkeeper_cl.xml" /home/lool/jhbuild-gnome-2.18/checkout/gnome-doc-utils/xslt/docbook/omf/db2omf.xsl /home/lool/jhbuild-gnome-2.18/checkout/gnome-doc-utils/doc/gnome-doc-make/C/gnome-doc-make.xml || { rm -f "gnome-doc-make-C.omf"; exit 1; } warning: failed to load external entity "/home/lool/jhbuild-gnome-2.18/checkout/gnome-doc-utils/doc/gnome-doc-make//home/lool/jhbuild-gnome-2.18/checkout/gnome-doc-utils/doc/gnome-doc-make/gnome-doc-make.omf.in" db2omf: Could not construct the OMF subject element. Add either a subject element to /home/lool/jhbuild-gnome-2.18/checkout/gnome-doc-utils/doc/gnome-doc-make//home/lool/jhbuild-gnome-2.18/checkout/gnome-doc-utils/doc/gnome-doc-make/gnome-doc-make.omf.in. make[2]: *** [gnome-doc-make-C.omf] Erreur 1 make[2]: quittant le répertoire « /home/lool/jhbuild-gnome-2.18/build/gnome-doc-utils/doc/gnome-doc-make » make[1]: *** [all-recursive] Erreur 1 make[1]: quittant le répertoire « /home/lool/jhbuild-gnome-2.18/build/gnome-doc-utils/doc » make: *** [all-recursive] Erreur 1 *** error during stage build of gnome-doc-utils: ########## Error running make *** [1/1] This is due to db2omf_args passing the stringparam db2omf.omf_in as `pwd`/$(_DOC_OMF_IN) but $(_DOC_OMF_IN) already contains srcdir: _DOC_OMF_IN = $(if $(DOC_MODULE),$(wildcard $(srcdir)/$(DOC_MODULE).omf.in)) So, simply dropping the `pwd`/ is enough which is what this second patch does.
CCing Danilo for attachment #82826 [details]
Unfortunately, the patch in attachment #82828 [details] breaks build when buildir == srcdir. If a relative path is passed for db2omf.omf_in, then it's taken relative to the location of the XSLT file that loads it. So we need to ensure we pass an absolute path, but do it less stupidly than my `pwd` hack.
All right, I believe I've fixed the `pwd` issuee using $(abspath). Let me know if it's still a problem.
Shaun, yes, there's still the xsltproc issue from the other patch. It currently fails when srcdir != builddir, and I have no idea why one would want to hide the command or ignore the exit status. I think you can safely drop the @, parenthesis, and add $(srcdir); I don't know about the exit code, but I would honor it and address bugs which are reported after this change.
Loïc, I agree with you on that patch, but I want to get Danilo's input since it's inside xml2po.
Sure, go ahead and fix this in xml2po.
Committed in trunk as r903; no gnome-2-18 branch yet. 2007-03-16 Loïc Minier <lminier@svn.gnome.org> * Makefile.am: Display xsltproc invocation, honor its exit status, and pull the source from srcdir; this might expose some bugs; bug #169324.
*** Bug 412155 has been marked as a duplicate of this bug. ***