Changes between Version 7 and Version 8 of AlternativeSelection
- Timestamp:
- Mar 26, 2007, 5:29:43 AM (19 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AlternativeSelection
v7 v8 37 37 Boost.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. 38 38 39 == == Consistency ====39 == Example 2 == 40 40 41 41 I 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: 42 42 43 ===== Example 2 =====44 43 {{{ 45 44 # b and c both have only one alternative. … … 48 47 }}} 49 48 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}}}.49 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 requirements for {{{c}}} contradicts the default for {{{profiling}}}, which is implicit. 51 50 52 51 The 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. 53 52 54 == == Definition of "Best" ====53 == Definition of "Best" == 55 54 56 55 Indeed, 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.
