Boost logo

Boost-Build :

Subject: Re: [Boost-build] rule execution order
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2016-10-16 18:07:27


AMDG

On 10/16/2016 02:55 PM, Stefan Seefeld wrote:
>
> I have managed to write a rule "numpy" that builds the numpy documentation.
>
> I invoke that rule explicitly in my doc's Jamfile. The output I get from
> running `.../b2` tells me that the "numpy" rule is executed before
> anything else, and the individual commands appear out-of-order. For
> example, I get this output:
>
>
> $ ../../../b2
> building numpy docs
> running sphinx-build
> Performing configuration checks
>
> <snip>
>
> Why is the "numpy" rule executed before even configuration has taken
> place (and how can I fix that) ?
>

numpy is executed when the Jamfile is loaded. (on line 82).

> And, an issue that I suspect is related to the above: As can be seen in
> the "numpy" definition
> (https://github.com/stefanseefeld/boost.python/commit/420278c3a74108aa109ff913b14fec9806008b01#diff-bd663991b879b8c98d283dad74d2dd5bR27),
> following Steven's suggestion I'm using the "install" rule to copy the
> source files into the build directory, where I invoke the "make" command
> via the "SHELL" rule, before issuing another "install" to get the
> generated html files back to the final destination. Invoking this yields
> the error
>

  SHELL is executed immediately at the point
it is called. It does not create a target.
install, on the other hand, creates a target
which will be updated in a later phase.

>
> ...
>
> $ ../../../b2
> building numpy docs
> running sphinx-build
> sh: line 0: cd: ../../../bin.v2/libs/python/doc/numpy: No such file or
> directory
> Performing configuration checks
> ...
>
>
> which demonstrates that the copying of the source files into the build
> directory hasn't been done by the point where I invoke the sphinx build
> (which includes a "cd"). Does the "install" rule merely register an
> action to be performed later, while my rule above expects it to be done
> "imperatively" ?
>

Yes.

> Any idea what I'm missing ? Should I use some other means to copy my
> files around ?
>

  It's impossible to use install to copy
the results like this. You have to know
all the files that you're going to copy
before you build anything. Since the
files that you need to copy are dependent
on the results of running make, it's
problematic.

  Is there any reason you can't just
call sphynx-build directly from the Jamfile
without going through make?

In Christ,
Steven Watanabe


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk