Changes between Version 7 and Version 8 of AlternativeSelection


Ignore:
Timestamp:
Mar 26, 2007, 5:29:43 AM (19 years ago)
Author:
Dave Abrahams
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AlternativeSelection

    v7 v8  
    3737Boost.Build generates an error because the default value of the {{{<profiling>}}} feature is "{{{off}}}".  Boost.Build combines that default value with the explicit build request to get {{{<debug-symbols>on <profiling>off}}}, which does not match the 2nd alternative.
    3838
    39 ==== Consistency ====
     39== Example 2 ==
    4040
    4141I know at this point you're probably saying "that makes sense; you asked for something for which there's no alternative with matching requirements."  However, "no matching requirements" is currently ''not'' an error when there's only one alternative declared:
    4242
    43 ===== Example 2 =====
    4443{{{
    4544# b and c both have only one alternative.
     
    4847}}}
    4948
    50 in this case, {{{bjam debug-symbols=on}}} happily builds both {{{b}}} (with debug-symbols off) and {{{c}}} (with profiling on) despite the fact that the requirements for {{{b}}} directly contradict the explicit build request and that the default for {{{profiling}}}, which is added to the build request, contradicts the requirements for {{{c}}}.
     49in this case, {{{bjam debug-symbols=on}}} happily builds both {{{b}}} (with debug-symbols off) and {{{c}}} (with profiling on) despite the fact that the requirements for {{{b}}} directly contradict the explicit build request and that the requirements for {{{c}}} contradicts the default for {{{profiling}}}, which is implicit.
    5150
    5251The behavior in example 2 may seem counterintuitive, but it is widely regarded as desirable to succeed in building something, even if it doesn't exactly match what the user asked for, than to cause an error.  I'm not challenging that premise in this proposal.  In fact, the point of this proposal is to make the case where there are multiple alternatives more consistent with that principle.
    5352
    54 ==== Definition of "Best" ====
     53== Definition of "Best" ==
    5554
    5655Indeed, the error message didn't say "there's no matching alternative;" it said there's "no ''best'' alternative."  Whether or not we accept this proposal turns on how we define "best."  I propose that in example 1, the fact that alternative 2 matches an ''explicitly specified'' build property should make it "better" than alternative 1.