Boost logo

Boost-Commit :

From: ghost_at_[hidden]
Date: 2008-05-09 04:03:36


Author: vladimir_prus
Date: 2008-05-09 04:03:35 EDT (Fri, 09 May 2008)
New Revision: 45245
URL: http://svn.boost.org/trac/boost/changeset/45245

Log:
Don't assign build properties as target's usage requirements when it fails to
generate.

We try to avoid building the same target twice, by caching the result of
previous calls to target.generate, and returning it if a build request
with the same property set is made. When the target fails to generate,
for example due to <build>no property, we used to store the entire
build property set as the usage requirements of the build. This is clearly,
wrong, this patch makes us store <build>no as usage requirements instead.

Fixes #1816.

Text files modified:
   trunk/tools/build/v2/build/targets.jam | 16 ++++++++++++++--
   1 files changed, 14 insertions(+), 2 deletions(-)

Modified: trunk/tools/build/v2/build/targets.jam
==============================================================================
--- trunk/tools/build/v2/build/targets.jam (original)
+++ trunk/tools/build/v2/build/targets.jam 2008-05-09 04:03:35 EDT (Fri, 09 May 2008)
@@ -1169,7 +1169,7 @@
             local fn = [ full-name ] ;
             ECHO [ targets.indent ] "Building target '$(fn)'" ;
             targets.increase-indent ;
- ECHO [ targets.indent ] "Build request: " [ $(property-set).raw ] ;
+ ECHO [ targets.indent ] "Build request: " $(property-set) [ $(property-set).raw ] ;
             local cf = [ build-system.command-line-free-features ] ;
             ECHO [ targets.indent ] "Command line free features: " [ $(cf).raw ] ;
             ECHO [ targets.indent ] "Target requirements: " [ $(self.requirements).raw ] ;
@@ -1274,7 +1274,16 @@
                 # properties, or there's <build>no in properties. In the latter
                 # case we don't want any diagnostic. In the former case, we need
                 # diagnostics. FIXME
- self.generated.$(property-set) = $(rproperties) ;
+
+ # If this target fails to build, add <build>no to properties
+ # to cause any parent target to fail to build. Except that it
+ # - does not work now, since we check for <build>no only in
+ # common properties, but not in properties that came from
+ # dependencies
+ # - it's not clear if that's a good idea anyway. The alias
+ # target, for example, should not fail to build if a dependency
+ # fails.
+ self.generated.$(property-set) = [ property-set.create <build>no ] ;
             }
         }
         else
@@ -1282,6 +1291,9 @@
             if [ modules.peek : .debug-building ]
             {
                 ECHO [ targets.indent ] "Already built" ;
+ local ur = $(self.generated.$(property-set)) ;
+ ur = $(ur[0]) ;
+ ECHO [ targets.indent ] " Usage requirements " [ $(ur).raw ] ;
             }
         }
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk