make weirdness when building docs

Mads Kiilerich mads at
Wed Dec 16 16:45:22 CST 2009

Greg Ward wrote, On 12/16/2009 11:14 PM:
> If I have docutils installed in a non-standard location -- i.e. Python
> can "import docutils", but my shell cannot find "rst2html" -- then
> "make doc" fails in a very strange way.  Example:
> $ make doc PYTHON=/usr/bin/python2.6-intelerad
> make -C doc
> make[1]: Entering directory `/home/gward/src/mercurial-intelerad/doc'
> /usr/bin/python2.6-intelerad --halt warning \
>            --strip-elements-with-class htmlonly hg.1.txt hg.1
> /usr/bin/python2.6-intelerad --halt warning \
>            --strip-elements-with-class htmlonly hgignore.5.txt hgignore.5
> /usr/bin/python2.6-intelerad --halt warning \
>            --strip-elements-with-class htmlonly hgrc.5.txt hgrc.5
> which: no in
> (/usr/kerberos/bin:/home/gward/bin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/X11R6/bin:/depot/bin:/home/gward/bin:/opt/real/RealPlayer)
> halt warning \
>            --link-stylesheet --stylesheet-path style.css hg.1.txt hg.1.html
> usage: halt [-n] [-w] [-d] [-f] [-h] [-i] [-p]
>          -n: don't sync before halting the system
>          -w: only write a wtmp reboot record and exit.
>          -d: don't write a wtmp record.
>          -f: force halt/reboot, don't call shutdown.
>          -h: put harddisks in standby mode.
>          -i: shut down all network interfaces.
>          -p: power down the system (if possible, otherwise halt).
> make[1]: [hg.1.html] Error 1 (ignored)
> [...repeat several more attempts to run 'halt'...]
> """
> Because neither rst2html nor are in my path, the make
> variable $(RST2HTML) is set to the empty string.  So make thinks the
> command to run is
>    --halt warning --link-stylesheet --stylesheet-path style.css
> hg.1.txt hg.1.html
> and of course, leading "-" means "run the command but ignore its exit
> status".  I did not know that leading "--" had the same effect, but
> apparently it does.  (GNU make 3.81 on CentOS 5.4.)
> Anyways, that's why Mercurial's build is trying to shutdown my system.
>   Good thing I wasn't building as root.  ;-)

Sorry, my bad in 7345fa5e572e.

> The workaround is obvious: pass RST2HTML=... on the make command line.
>   But I suspect the clever "($shell which rst2html ...)" trick is more
> trouble than it's worth.  Either that or it needs a little more
> trickery to die horribly if RST2HTML is empty.

Distributions install /usr/bin/rst2html, but the docutils installer 
installs, so I don't think we can avoid using some kind of 
trick. But obviuosly this trick wasn't clever enough ...


More information about the Mercurial-devel mailing list