Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r79601 - trunk/tools/build/v2/build
From: jurko.gospodnetic_at_[hidden]
Date: 2012-07-19 10:32:32


Author: jurko
Date: 2012-07-19 10:32:31 EDT (Thu, 19 Jul 2012)
New Revision: 79601
URL: http://svn.boost.org/trac/boost/changeset/79601

Log:
Fixed a Boost Build bug causing scanner targets to be rebuilt every time if their base target has already been marked as including another target with a newer timestamp. For example, this occurred every time a single action generated both the scanned and the included target and did so slowly enough that the included target got a newer timestamp. Fix originally prepared by Steven Watanabe.
Text files modified:
   trunk/tools/build/v2/build/virtual-target.jam | 30 +++++++++++++++++++++++++-----
   1 files changed, 25 insertions(+), 5 deletions(-)

Modified: trunk/tools/build/v2/build/virtual-target.jam
==============================================================================
--- trunk/tools/build/v2/build/virtual-target.jam (original)
+++ trunk/tools/build/v2/build/virtual-target.jam 2012-07-19 10:32:31 EDT (Thu, 19 Jul 2012)
@@ -153,11 +153,7 @@
             if ! $(self.made.$(name))
             {
                 self.made.$(name) = true ;
-
- DEPENDS $(name) : $(actual-name) ;
-
                 actualize-location $(name) ;
-
                 scanner.install $(scanner) : $(name) ;
             }
             return $(name) ;
@@ -574,7 +570,31 @@
 
     rule actualize-location ( target )
     {
- if $(self.action)
+ # Scanner targets are always bound to already existing files in already
+ # existing folder. They need to be marked as depending on their base
+ # target (i.e. the target being scanned) but, unlike regular
+ # dependencies set up by the DEPENDS rule, they must not depend on any
+ # targets already marked as included by the base target. Otherwise such
+ # an included file being newer than the file being scanned would cause
+ # the scanner target to be updated, further causing any target depending
+ # on that scanner target to be rebuild. This is the exact relationship
+ # as set up by Boost Jam's SEARCH binding method (needed to support
+ # searching for generated targets) so we want to bind scanner targets
+ # using this methon instead of explicitly specifying their location
+ # using LOCATE.
+ #
+ # FIXME: We recognize scanner targets by their given name being
+ # different from this target's actual name. This is a hack and should be
+ # cleaned up by reorganizing who knows about scanners in the
+ # virtual-target/abstract-file-target/file-target/notfile-target/
+ # searched-lib-target/... class hierarchy.
+ local is-scanner-target ;
+ if $(target) != [ actual-name ]
+ {
+ is-scanner-target = true ;
+ }
+
+ if $(self.action) && ! $(is-scanner-target)
         {
             # This is a derived file.
             local path = [ path ] ;


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