On 8/6/06, Vladimir Prus <ghost@cs.msu.su> wrote:
Rene Rivera <grafikrobot <at> gmail.com> writes:

>
> Vladimir Prus wrote:
> > On 8/2/06, Rene Rivera <grafik <at> users.sourceforge.net> wrote:
>
> >> Skip targets that can't be generated like BBv1 does.
> >
> > Just as a check -- did you run V2 testsuite before and after this
> > change, to
> > verify it causes no regressions?
>
> No, but that was because I didn't have the time. I'll get to that this
> weekend.

Hmm, generally it's better to run regression tests *before* checkin. That's
what I do, at the very least.

>
> > Index: generators.jam
> >> +    # Indicates if this generator can handle building the given target
> >> +    # combination.
> >
> > I think this comment is not sufficient.
>
> It seems as sufficient as some of the other commented methods in that
> class.

Are you saying those other comments are not sufficient too? That most likely
true, but that does not mean we should not try to improve commenting for new
checkings. Those other comments were probably written years ago, when I did not
realize how really important comments are.

> It says exactly what it means and nothing else. Perhaps comments
> need to be added to where can-build is called to explain what effect it
> has there.
>
> > How returning false from this rule
> > is different from
> > returning nothing from the 'run' rule?
>
> I have no clue. But then again the run rule doesn't say what happens
> when it returns nothing.

I can fix that part; but that does not change the fact that 'can-build' is
under-commented.

>
> > I think there are some differences,
> > but the comment does not say what they are.
>
> Perhaps... What do you think are the differences?

Well, returning nothing from 'run' method means the generator failed.
If all possible generators fail, then building a targets failed and an error
is produced. As for 'can-build' returning false, you know better, but it seem
to be some "half-failed" situation.
 
 
On a second though, it looks like 'can-build' returning false make generator fail during find-viable-generators call, instead of failing in 'run' method. So, it's a mechanism for making generator fail earlier. I'm not sure if we need this second mechanism, given that 'run' can return nothing already.
 
- Volodya