Changes between Version 10 and Version 11 of AlternativeSelection
- Timestamp:
- Mar 26, 2007, 6:14:57 AM (19 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AlternativeSelection
v10 v11 47 47 }}} 48 48 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 .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 implicitly {{{off}}}. 50 50 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.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. 52 52 53 53 === Definition of "Best" === … … 75 75 76 76 Here Boost.Build complains because the {{{<threading>single}}} is the default. If you read ticket #16, you can see that the intended result was that Boost.Build choose the first alternative. My proposed change would accomplish that with no change in the Jamfile. We would lose the capability of specifying these alternatives in such a way that the build request {{{bjam toolset=gcc}}} causes an error. 77 78 == Details of Proposed Semantics == 79 80 The semantics I'm proposing depend on the notion of "explicitly-requested" build properties. 81 82 '''Definition:''' a top-level target's explicitly-requested build properties are those that 83 are specified on the command line, e.g. {{{bjam '''threading=multi'''}}}. A dependency 84 target's explicitly-requested build properties are those that are propagated from its dependent 85 target(s). As a special case, {{{<toolset>}}} is always considered to be explicitly requested, 86 even when not explicitly specified on the command line. 87 88 When choosing among target alternatives, the one with the greatest number of requirements matching its explicitly-requested properties is selected. An ambiguity error is only reported when two alternatives match the same number of requirements. 89 90 When searching for dependency targets, the dependent's requirements are combined with its explicitly-requested build properties to form a new set of explicitly-requested properties, to be applied to its dependencies. During combination, where a non-free feature in the dependent's requirements conflicts with its explicitly-requested properties, the requirement is selected over the the explicitly-requested value of that feature. 91 92 == Not A Pure Extension == 93 94 95 == Optional Extension to this Proposal == 96
