|
Boost-Build : |
From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-06-03 00:49:28
On Thursday 02 June 2005 20:45, David Abrahams wrote:
> Vladimir Prus <ghost_at_[hidden]> writes:
> > As a bit of history, I believe some of the above decisions were due to a
> > certain use case:
> >
> > CPP <------- WHL
> > \
> > WD
> > /
> > CPP <------- DLP
> >
> > Here, a source file is converted to two targets with one command, and
> > each produced file is converted to CPP. Our generators search would
> > notice that there are two generators for CPP: the WHL->CPP and DPL->CPP
> > generators. Neither is better that the other so both are tried, and
> > produce (CPP, DPL) and (CPP, WHL) pairs of targets. To avoid reporting an
> > ambiguity, we'd try to convert, DLP to CPP and WHL to CPP, do it
> > successfully, notice that produced targets are the same and decide that
> > there's no ambiguity.
> >
> > However, this is rather complex logic for a relatively rare case. It can
> > be handled by writing another WD->CPP generator that would handle
> > disambiguation itself.
>
> This sounds awfully familiar to me ;-)
;-)
> Does this finally allow the algorithm of
> tools/build/v2/generators_prototype.py to be used?
I'd suspect that no. Unless I forgot something, my change is in exactly
opposite direction. The generators_prototype.py, IIRC, tries to use A*
search, or some other heuristic search to find the "best" transformation.
The problem with that, in my opinion, is that it would be very hard to tune
those heuristic in a way that always produces results that are intuitive for
the user. Of course, I can be wrong.
My change, OTOH, removes quite a bit of smarts from the generator search. Some
cases which magically worked before no longer work and require explicit
disambiguation. That's extra work, but reduces core algorithm complexity and
avoids surprises.
- Volodya
-- Vladimir Prus http://vladimir_prus.blogspot.com Boost.Build V2: http://boost.org/boost-build2
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