Boost logo

Boost-Build :

Subject: Re: [Boost-build] duplicate dependencies in bjam backend
From: Stefan Seefeld (stefan_at_[hidden])
Date: 2016-12-16 14:26:05

On 16.12.2016 14:16, Steven Watanabe wrote:
> On 12/16/2016 11:55 AM, Stefan Seefeld wrote:
>> this question is about the low-level bjam Python module and its use.
>> It happens that in my Python layer I'm occasionally declaring a
>> dependency more than once (for example in the context of generators,
>> where a meta-target instantiates multiple variants of a target).
>> It appears the backend happily accepts that, and then simply invokes the
>> registered action multiple times (on the same target). Is that to be
>> expected ?
> Yes.
>> How does b2 deal with that ? Does it internally guards against multiply
>> declared dependencies ? Or does it have some other mechanism to avoid that ?
>> Specific example: If I declare an "exe" with a source file "hello.cpp",
>> then instantiate that twice (with two sets of features), I get a
>> dependency for "hello.o" -> "hello.cpp" twice. Does b2 always make sure
>> that the feature-dependent "hello.o" target ends up in a different
>> directory, thereby causing these two "hello.o" targets to use different
>> names ? Or is there some other trick I'm overlooking ?
> There are two different mechanisms that affect this:
> - virtual-targets are uniqued by virtual-target.register,
> so that identical actions are only run once.
> - The build directory is based on the non-free features,
> so targets with different features are built in
> different directories.

By "non-free" I assume you mean features with explicitly defined values
(as opposed to default ones) ?
That seems to imply that your generated paths (directories) are uniquely
mapped from features, i.e. no two feature values could result in the
same path (and thus target). Am I understanding that correctly ?

I was pondering about that exact situation. Assume the case of a shared
and a static library build. On unix that typically means that object
files for the shared library are built with -fPIC, while for static libs
they don't any special treatment.

In those circumstances, how would a user request that both library
variants are to be generated from the same set of object files ? (Say,
to save space, and to speed up the compilation process) ? Does b2 allow
that at all ?


> In Christ,
> Steven Watanabe
> _______________________________________________
> Unsubscribe & other changes:

      ...ich hab' noch einen Koffer in Berlin...

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