Subject: Re: [Boost-build] adding to the "clean" target
From: Vladimir Prus (vladimir.prus_at_[hidden])
Date: 2015-05-21 03:02:15
On 5/19/2015 3:20 AM, Stefan Seefeld wrote:
> On 18/05/15 03:03 AM, Vladimir Prus wrote:
>> On 5/16/2015 9:01 PM, Stefan Seefeld wrote:
>>> I'm building examples in Boost.Python's examples folder(s). Running
>>> `bjam clean` will clean up some of the files, but no all. How can I
>>> augment the "clean" rule to do additional cleanup ?
>> the best way to is to identify those files, and make sure that
>> python.jam creates targets for them. Typically, it's done by
>> making sure these files are listed as outputs of corresponding
>> Does this help?
> Sorry, I'm not very familiar with boost.build, and don't kow what
> "output of generators" means.
That's documented at:
> I'm looking at
> https://github.com/boostorg/python/blob/master/example/Jamroot, which
> defines a new 'run-test' rule and some test targets. When I run `bjam
> test` it builds (and runs) those tests, but `bjam clean` fails to remove
> any of the files generated in the process. I'm wondering what is missing.
Could you be more specific as to what files are not removed?
> (For example: could the 'run-test' rule itself declare the additional
> output to be removed via the 'clean' target ? If not, what would be the
> appropriate way to do that ?)
The 'run-test' function declares a metatarget. When that metatarget is
constructed with particular build properties, a generator is invoked
to produce actual targets, which are either build, or cleaned - by
running whatever commands are necessary.
Therefore, the best way to make sure everything is cleaned to to make
sure that the set of targets produced by the generator is equal to the
set of files produced by whatever command invocations.
The generator is defined in python.jam, lines 1181 and below:
[ new python-test-generator python.capture-output : :
RUN_PYD_OUTPUT ] ;
: RUN_PYD_OUTPUT : RUN_PYD ;
So, so creates two targets. One, RUN_PYD_OUTPUT, with the extension of
.output, contains the output of the test run. Second, RUN_PYD with the
extension of .test is an empty file that's created only if test passes.
Which files are not removed?
>>> PS: http://www.boost.org/build/doc/html/bbv2/faq/names.html mentions
>>> "b2" to be the new name instead of "bjam", since release 1.47. However,
>>> I'm running Fedora 22, which contains boost 1.55, and the executable is
>>> still called "bjam". It might be worthwhile referencing that name in the
>>> docs a little longer...
>> It would be awkward to write "b2 or bjam" everywhere in docs, and I
>> think this passage is sufficient.
> That's only part of a FAQ, and it's actually inaccurate (as it would
> make me believe that for the boost version I have I need 'b2', which
> doesn't exist.
That's a problem to be reported for Fedora, really. They must not have
updated .spec files, or something.
> All I'm saying is that there might be a more prominent place, and the
> wording could be a little less exclusive.
Maybe, but it seems a relatively low thing to fix unless you have a pull
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