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 655350 - [PATCH] Use srcdir to find C/ pages
[PATCH] Use srcdir to find C/ pages
Status: RESOLVED FIXED
Product: yelp-tools
Classification: Core
Component: yelp.m4
git master
Other Linux
: Normal normal
: ---
Assigned To: Yelp maintainers
Yelp maintainers
Depends on:
Blocks:
 
 
Reported: 2011-07-26 14:19 UTC by Michael Terry
Modified: 2013-07-13 16:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (1.81 KB, patch)
2011-07-26 14:19 UTC, Michael Terry
none Details | Review
Fix make pot (916 bytes, patch)
2012-11-01 08:23 UTC, Michael Terry
committed Details | Review

Description Michael Terry 2011-07-26 14:19:35 UTC
Created attachment 192670 [details] [review]
Proposed patch

During a distcheck (or any time builddir != srcdir), yelp.m4 doesn't correctly find the C/ pages.  I believe the attached patch fixes that.
Comment 1 Shaun McCance 2011-09-15 13:19:16 UTC
I've never had any problems building with builddir != srcdir, and I run distcheck with the current code all the time. In the rule for $(_HELP_LC_FILES), this line is supposed to take care of this:

if test -f "C/$(notdir [$]@)"; then d="../"; else d="$(abs_srcdir)/"; fi;

That is, if the file exists in the builddir, use it. Otherwise, read the files from $(abs_srcdir). This supports the case where you actually generate your page files. (It occurs to me now, though, that this might not work right when you have a mix of generated and static files. That's a separate problem that will require more work.)

What kinds of errors are you getting when you use a builddir? I just built gnome-user-docs inside a builddir, and everything worked correctly. I need to reproduce the problem before I can take action.
Comment 2 Michael Terry 2011-09-15 15:35:14 UTC
I get the following when I distcheck my project, deja-dup:

make[3]: Entering directory `/home/mike/Code/deja-dup/20/deja-dup-19.92/_build/help'
  GEN    deja-dup-help.pot
I/O warning : failed to load external entity "C/backup-auto.page"
Traceback (most recent call last):
  • File "/usr/bin/itstool", line 912 in <module>
    doc = Document(filename, messages)
  • File "/usr/bin/itstool", line 293 in __init__
    ctxt = libxml2.createFileParserCtxt(filename)
  • File "/usr/lib/python2.7/dist-packages/libxml2.py", line 1416 in createFileParserCtxt
    if ret is None:raise parserError('xmlCreateFileParserCtxt() failed')
libxml2.parserError: xmlCreateFileParserCtxt() failed
make[3]: *** [deja-dup-help.pot] Error 1
make[3]: Leaving directory `/home/mike/Code/deja-dup/20/deja-dup-19.92/_build/help'
make[2]: *** [update-pot] Error 2
make[2]: Leaving directory `/home/mike/Code/deja-dup/20/deja-dup-19.92/_build'
make[1]: *** [distdir] Error 2
make[1]: Leaving directory `/home/mike/Code/deja-dup/20/deja-dup-19.92/_build'
make: *** [distcheck] Error 1

Using my patch (and re-autogening) fixes this for me.

(Also, distcheck failed if I didn't add DISTCLEANFILES=deja-dup-help.pot, which maybe yelp.m4 should do automatically.)

You can test this yourself with the deja-dup module in jhbuild.
Comment 3 Michael Terry 2012-11-01 08:23:54 UTC
Created attachment 227781 [details] [review]
Fix make pot

I finally got around to figuring out why it works for you but not me.  Because I was running make pot as part of a dist-hook.

The pot target did not have support for srcdir != builddir.  So here's a patch to add that.
Comment 4 Shaun McCance 2013-07-13 16:17:51 UTC
That's not quite right. $(AM_V_GEN) shouldn't be put after a line continuation like that, and $(_HELP_LC_VERBOSE) is only meant for outputting a message for building the various lang directories. Actual code modifications look right though. Fixed and committed.