Opened 11 years ago

Closed 11 years ago

#5709 closed Bugs (fixed)

boost.build docutils module not working

Reported by: Stefan Seefeld Owned by: Vladimir Prus
Milestone: To Be Determined Component: Building Boost
Version: Boost 1.47.0 Severity: Problem
Keywords: Cc:

Description

I'm trying to use the docutils tool as part of boost.build, which results in errors. The reason appears to be that on my system (Fedora), there is no "rst2html.py" script, but a "rst2html" tool (a python script) in /usr/bin.

The docutils module initialization doesn't know about it, and then invokes "python -gdt ..." instead of "rst2html -gdt ..." or "python rst2html.py -gdt ...", which is clearly wrong.

I think there are two issues here to fix:

1) Instead of generating an invalid command, detect that the "rst2html.py" script doesn't exist, and bail out.

2) Allow alternate scripts, such as "rst2html". Or more conveniently, discover that script automatically, and use it as RST2XXX in docutils.jam.

(I have been attempting to debug this, by injecting "ECHO ... " commands into the docutils.jam file. However, these weren't working. Depending on where I inserted them, I received errors "ECHO: command not found" or others.

Any help would be appreciated.

Thanks,

Stefan

Attachments (1)

patch (1.0 KB ) - added by Stefan Seefeld 11 years ago.
This fixes the issue.

Download all attachments as: .zip

Change History (6)

comment:1 by Vladimir Prus, 11 years ago

Stefan,

as I've said on IRC, your first step should be to add

ECHO "Here I am" ; 

as the first statement of docbook.init, and make sure it is executed. If it's not executed, it means you are modifying wrong docbook.init, or you don't have 'using docbook', or you have 'using docbook' in wrong user-config.jam, or something similar.

After then, you should add

RST2XXX = [ common.find-tool rst2html ] ;

as the last stateme of the "if" inside docbook.init.

comment:2 by Stefan Seefeld, 11 years ago

Volodya,

I have modified tools/build/v2/tools/docutils.jam, and I can in fact see changes when I run 'bjam libs/python/doc', just not all, and just not with the effect I had hoped I would see.

In particular:

  • Into the 'init' rule, inside 'if ! $(.initialized)', I added:

RST2XXX = [ common.find-tool rst2html ] ;

ECHO "init: " $(RST2XXX) ;

but that didn't print anything.

  • Into the 'html' rule (after the RST2XXX definition) I added:

ECHO "rst2xxx: " $(RST2XXX) ;

which only prints 'rst2xxx:', i.e. no value.

  • Into the 'actions html' block, I added:

ECHO "$(RST2XXX)"

which generates an error '/bin/sh: line 1: ECHO: command not found', unless I invoke bjam with '-n', in which case the error disappears. (It still prints the '/usr/bin/python2.7' value that it seems to get from the (wrong) assignment in the html rule above.

Thanks for your help,

by Stefan Seefeld, 11 years ago

Attachment: patch added

This fixes the issue.

comment:3 by Stefan Seefeld, 11 years ago

Volodya,

the attached patch appears to be all that's needed to fix this, right ? Should I check it in ?

Thanks,

comment:4 by Vladimir Prus, 11 years ago

Stefan,

this patch is fine, thanks.

You might want to include "Fixes #5709" in the commit message to have this issue closed by magic.

Thanks, Volodya

comment:5 by Stefan Seefeld, 11 years ago

Resolution: fixed
Status: newclosed

(In [73215]) Fixes #5709

Note: See TracTickets for help on using tickets.