Boost logo

Boost-Build :

Subject: Re: [Boost-build] rule execution order
From: Rene Rivera (grafikrobot_at_[hidden])
Date: 2016-10-18 00:17:10

On Mon, Oct 17, 2016 at 10:01 PM, Stefan Seefeld <stefan_at_[hidden]>

> On 17.10.2016 22:53, Rene Rivera wrote:
> > Almost missed this email. Sorry about the delayed response..
> No worries. Thanks for the explanation ! I'll make sure to add the
> 'numpy' rule to the boostdoc and boostrelease targets.

In your case it would only be to the "boostrelease" target :-) IIUC you are
building non-integrated docs.

> But first I need to fix the numpy rule to correctly perform the build,
> involving:
> 1) a copy of a set of files from the source tree to the build tree

2) the invocation of a command ('make' or 'sphinx-build') inside that
> build tree
> 3) a copy of a set of generated files from the build tree to the
> destination (which is AFAIU in the source tree).
> and I still don't know how to do the copying imperatively, i.e. not as
> part of the ("functional") evaluation of a dependency graph.
> The "common" module has some support code to copy files around (though
> the "copy" rule itself is empty !?). Is there no way to invoke some
> "common.copy" with explicit file arguments (the result of a glob() call) ?
> (Among the many reasons I think using the "install" rule for this is
> inappropriate is the fact that I don't know upfront what files to copy
> back. Which files are generated in the process depends on the content
> itself, which I'd rather not inspect to code the build logic.)

Not sure what your intent is so I may get this wrong. But from reading your
Jamfile and the Makefile. Here's what I think you should do..

path-constant here : . ;
if [ ] = NT {
make numpydoc.txt : numpy/make.bat : @numpydoc
    [ conditional <depends> : [ glob-tree-ex numpy : *.rst ] ] ;
action numpydoc
    rd /S /Q "$(>:D)/_build"
    cd "$(>:D)"
    call "$(>:D=)" && echo "done" > "$(<)"
} else {
make numpydoc.txt : numpy/Makefile : @numpydoc ;
action numpydoc
    rm -rf "$(>:D)/_build"
    cd "$(>:D)"
    make "$(>:D=)" && echo "done" > "$(<)"

The one key difference is that the above builds it in-place. But since
that's the same effect you had by trying to copy to the build dir and then
copy back I think that's OK. Also, the numpydoc.txt placeholder target
depends only on the RST sources. I.e. it will not catch changes of PNG,
CSS, HTML, etc files as it would be a circular dependency. But that could
be remedied with some different globs.

And, caveat.. The above is untested off the cuff code :-)

And one last item.. Are you aware that there's a built in RST->HTML using
docutils transformation?

-- Rene Rivera
-- Grafik - Don't Assume Anything
-- Robot Dreams -
-- rrivera/ (msn) - grafikrobot/aim,yahoo,skype,efnet,gmail

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at