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 169324 - doesn't build if builddir != srcdir
doesn't build if builddir != srcdir
Status: RESOLVED FIXED
Product: gnome-doc-utils
Classification: Deprecated
Component: build utils
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-doc-utils maintainers
gnome-doc-utils maintainers
: 412155 (view as bug list)
Depends on:
Blocks: 414139
 
 
Reported: 2005-03-05 19:31 UTC by Christian Persch
Modified: 2007-03-28 16:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
first patch (1.67 KB, patch)
2005-03-05 19:32 UTC, Christian Persch
committed Details | Review
Display xsltproc invocation, honor its exit status, and pull the source from srcdir (486 bytes, patch)
2007-02-18 15:53 UTC, Loïc Minier
accepted-commit_now Details | Review
Drop superfluous `pwd`/ in db2omf.omf_in stringparam (610 bytes, patch)
2007-02-18 16:08 UTC, Loïc Minier
rejected Details | Review

Description Christian Persch 2005-03-05 19:31:06 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).
Comment 1 Christian Persch 2005-03-05 19:32:31 UTC
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)
Comment 2 Shaun McCance 2005-04-04 03:25:19 UTC
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?
Comment 3 Christian Persch 2005-04-04 09:53:18 UTC
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.
Comment 4 Christian Persch 2005-07-15 22:10:01 UTC
This seems fixed in cvs, not reproducible any more.
Comment 5 Loïc Minier 2007-02-18 15:46:40 UTC
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.
Comment 6 Loïc Minier 2007-02-18 15:53:14 UTC
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 »
Comment 7 Loïc Minier 2007-02-18 16:08:18 UTC
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.
Comment 8 Shaun McCance 2007-02-19 17:32:51 UTC
CCing Danilo for attachment #82826 [details]
Comment 9 Shaun McCance 2007-02-19 17:42:51 UTC
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.
Comment 10 Shaun McCance 2007-02-19 17:57:39 UTC
All right, I believe I've fixed the `pwd` issuee using $(abspath).  Let me know if it's still a problem.
Comment 11 Loïc Minier 2007-02-19 19:37:49 UTC
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.
Comment 12 Shaun McCance 2007-02-19 19:54:41 UTC
Loïc, I agree with you on that patch, but I want to get Danilo's input since it's inside xml2po.
Comment 13 Danilo Segan 2007-02-21 03:56:40 UTC
Sure, go ahead and fix this in xml2po.
Comment 14 Loïc Minier 2007-03-16 11:09:23 UTC
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.
Comment 15 Shaun McCance 2007-03-28 16:19:05 UTC
*** Bug 412155 has been marked as a duplicate of this bug. ***