Subject: Re: [Boost-build] allowing targets to fail
From: Stefan Seefeld (stefan_at_[hidden])
Date: 2017-04-02 22:27:53
On 01.04.2017 08:51, Rene Rivera wrote:
> On Sat, Apr 1, 2017 at 6:53 AM, Stefan Seefeld via Boost-build
> <boost-build_at_[hidden] <mailto:boost-build_at_[hidden]>> wrote:
> On 31.03.2017 13 <tel:31.03.2017%2013>:35, Steven Watanabe via
> Boost-build wrote:
> > AMDG
> > On 03/31/2017 11:14 AM, Stefan Seefeld via Boost-build wrote:
> >> Ah, interesting ! So this provides a mechanism to capture a
> >> result while still letting if fail. But it seems this comes at
> a price:
> >> To be able to capture results of individual target builds, I
> need to
> >> submit them individually (via "UPDATE_NOW"), which precludes
> >> parallelization.
> >> If I submit multiple targets at once, I only get the overall
> >> back. Correct ?
> > Yep. As a workaround, you can batch them, and
> > then call UPDATE_NOW again individually to get
> > the results. UPDATE_NOW never tries to build
> > any target more than once, no matter how many times
> > it is called from the same b2 process.
> I'm actually wondering whether that's (necessary) true: Is the bjam
> engine thread-safe ? If I run `b2 -j 8`, may I invoke UPDATE_NOW from
> one action and expect other targets to continue to be built in
> ? Would that break ? Or would that serialize the execution ?
> None of the above. Yes, the engine is parallel-safe. But that is
> irrelevant for this question. All targets are built with the same
> mechanism at the low level. The differences for UPDATE_NOW are when it
> executes the actions and how it waits for them. Regular action
> execution happens after the parsing/evaluation of the b2 files during
> the make stages. UPDATE_NOW happens during the parsing/evaluation and
> blocks it until the actions complete.
So all those config targets are executed as they are parsed, i.e.
independent on what targets are specified on the command-line ? Even if
I call `./b2 clean` ??
> So there's no question about thread safety, or parallel safety, since
> b2 is single threaded anyway.
OK, then I'm not talking about b2 :-)
Really, I'm asking whether I could (in my own Python frontend) invoke
UPDATE_NOW from within an action, and expect the rest of the evaluation
of the dependency graph to continue undisturbed.
To put it a different way: As I'm composing the dependency graph of an
arbitrary project, I expect to wanting to "build" certain targets that
are allowed to fail (such as configure checks that should result in some
values being set or not set, or tests that may fail, but which shouldn't
cause the `./b2` invocation itself to fail, so wonder whether the
required mechanism to implement that is already there (in the engine
API) or not.
-- ...ich hab' noch einen Koffer in Berlin...
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