Changes between Version 16 and Version 17 of AlternativeSelection


Ignore:
Timestamp:
Mar 28, 2007, 7:45:40 PM (19 years ago)
Author:
Dave Abrahams
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AlternativeSelection

    v16 v17  
    1 = Proposal for "Do the Right Thing" Alternative Selection =
     1= Proposal for "Do the Right Thing" Alternative Selection, by Dave Abrahams =
    22[[PageOutline(1-6, Contents)]]
    33
     
    7878=== Example 4 ===
    7979
    80 This is a real-life example that resulted in a long [http://thread.gmane.org/gmane.comp.lib.boost.testing/4202/focus=4266 thread] on the boost-testing mailing list, and was finally resolved only through an intensive back-and-forth over IRC.  I should add that it was this difficult to debug ''despite the fact that I had already written most of this proposal''; I just failed to recognize this as a manifestation of the same problem.
    81  
     80This is a real-life example that resulted in a long [http://thread.gmane.org/gmane.comp.lib.boost.testing/4202/focus=4266 thread] on the boost-testing mailing list, and was finally resolved only through an intensive back-and-forth with Martin over IRC.  I should add that it was this difficult to debug ''despite the fact that I had already written most of this proposal''; I just failed to recognize this as a manifestation of the same problem.
     81
     82Martin's test-config.jam file is shown at the bottom of http://thread.gmane.org/gmane.comp.lib.boost.testing/4202/focus=4271.  The crucial fragment is:
     83
     84{{{
     85using python : 2.3 : /usr : : ;
     86   ...
     87using gcc : 3.4.5_linux : /usr/local/gcc-3.4.5/bin/g++wrap --limit-memory=600 --limit-cpu=1800 : <root>/usr/local/gcc-3.4.5 <debug-symbols>off ;
     88using python : 2.4 : /usr/local/python/2.4/gcc-3.4.4 : : : <toolset>gcc <toolset-gcc:version>3.4.5_linux ;
     89}}}
     90
     91Here, Martin conifigures python 2.3 as the default, and then configures a specific build of python 2.4 to be used with gcc-3.4.5_linux.  Then he runs his tests, in the simplest case, with:
     92
     93{{{
     94bjam gcc-3.4.5_linux
     95}}}
     96
     97and the system uses the wrong python (2.3) to build and run these tests.  To understand the reasons, you must know that
     98
     99  {{{using python : }}} ''version'' {{{ : ... : : : }}} ''condition'' {{{;}}}
     100
     101ends up declaring a python library with the following requirements:
     102
     103 ''condition'' {{{<python>}}}''version''
     104
     105As a result of the first {{{using python}}}... invocation, the default value of {{{<python>}}} is "{{{2.3}}}".  Since "{{{python=}}}..." was not given explicitly in the build request, the current semantics add the default value to the request and thus fail to match the intended python installation.  In fact, to test with multiple toolsets and their intended versions of Python, Martin has to invoke {{{bjam}}} as follows:
     106
     107  {{{bjam gcc-3.3.6_linux gcc-3.4.5_linux/python=2.4 gcc-4.0.2_linux/python=2.4}}} ''etc...''
     108
     109This is not only inconvenient, but counterintuitive and uses a syntax that is not widely known (is it even documented?)
     110
    82111== Details of Proposed Semantics ==
    83112