Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83781 - in trunk/tools/build/v2: . build test util
From: steven_at_[hidden]
Date: 2013-04-06 17:40:56


Author: steven_watanabe
Date: 2013-04-06 17:40:55 EDT (Sat, 06 Apr 2013)
New Revision: 83781
URL: http://svn.boost.org/trac/boost/changeset/83781

Log:
Implement caching for configuration checks.
Text files modified:
   trunk/tools/build/v2/build-system.jam | 4 ++++
   trunk/tools/build/v2/build/configure.jam | 38 ++++++++++++++++++++++++++++++++++----
   trunk/tools/build/v2/test/BoostBuild.py | 1 +
   trunk/tools/build/v2/test/build_dir.py | 1 +
   trunk/tools/build/v2/util/doc.jam | 1 +
   5 files changed, 41 insertions(+), 4 deletions(-)

Modified: trunk/tools/build/v2/build-system.jam
==============================================================================
--- trunk/tools/build/v2/build-system.jam (original)
+++ trunk/tools/build/v2/build-system.jam 2013-04-06 17:40:55 EDT (Sat, 06 Apr 2013)
@@ -12,6 +12,7 @@
 import builtin ;
 import "class" : new ;
 import configure ;
+import config-cache ;
 import feature ;
 import generators ;
 import make ;
@@ -692,6 +693,7 @@
     local first-project-root = [ project.target $(first-project-root-module) ] ;
     local first-build-build-dir = [ $(first-project-root).build-dir ] ;
     configure.set-log-file $(first-build-build-dir)/config.log ;
+ config-cache.load $(first-build-build-dir)/project-cache.jam ;
 
     # Now that we have a set of targets to build and a set of property sets to
     # build the targets with, we can start the main build process by using each
@@ -718,6 +720,8 @@
         actual-targets += [ $(t).actualize ] ;
     }
 
+ config-cache.save ;
+
 
     # If XML data output has been requested prepare additional rules and targets
     # so we can hook into Jam to collect build data while its building and have

Modified: trunk/tools/build/v2/build/configure.jam
==============================================================================
--- trunk/tools/build/v2/build/configure.jam (original)
+++ trunk/tools/build/v2/build/configure.jam 2013-04-06 17:40:55 EDT (Sat, 06 Apr 2013)
@@ -16,6 +16,7 @@
 import property ;
 import property-set ;
 import targets ;
+import config-cache ;
 
 
 rule log-summary ( )
@@ -134,7 +135,11 @@
     {
         .$(what)-tested.$(ps) = true ;
 
- local targets = [ targets.generate-from-reference
+ local cache-name = $(what) [ $(ps).raw ] ;
+ cache-name = $(cache-name:J=-) ;
+ local value = [ config-cache.get $(cache-name) ] ;
+
+ local targets = [ targets.generate-from-reference
             $(metatarget-reference) : $(project) : $(ps) ] ;
 
         local jam-targets ;
@@ -142,10 +147,24 @@
         {
             jam-targets += [ $(t).actualize ] ;
         }
-
- if ! UPDATE_NOW in [ RULENAMES ]
+
+ if $(value)
         {
- # Cannot determine. Assume existence.
+ local x = [ PAD " - $(what)" : $(.width) ] ;
+ if $(value) = true
+ {
+ .$(what)-supported.$(ps) = yes ;
+ result = true ;
+ log-check-result "$(x) : yes (cached)" ;
+ }
+ else
+ {
+ log-check-result "$(x) : no (cached)" ;
+ }
+ }
+ else if ! UPDATE_NOW in [ RULENAMES ]
+ {
+ # Cannot determine. Assume existance.
         }
         else
         {
@@ -162,6 +181,17 @@
                 log-check-result "$(x) : no" ;
             }
         }
+ if ! $(value)
+ {
+ if $(result)
+ {
+ config-cache.set $(cache-name) : true ;
+ }
+ else
+ {
+ config-cache.set $(cache-name) : false ;
+ }
+ }
         return $(result) ;
     }
     else

Modified: trunk/tools/build/v2/test/BoostBuild.py
==============================================================================
--- trunk/tools/build/v2/test/BoostBuild.py (original)
+++ trunk/tools/build/v2/test/BoostBuild.py 2013-04-06 17:40:55 EDT (Sat, 06 Apr 2013)
@@ -702,6 +702,7 @@
         # Boost Build's 'configure' functionality (unfinished at the time)
         # produces this file.
         self.ignore("bin/config.log")
+ self.ignore("bin/project-cache.jam")
 
         # Compiled Python files created when running Python based Boost Build.
         self.ignore("*.pyc")

Modified: trunk/tools/build/v2/test/build_dir.py
==============================================================================
--- trunk/tools/build/v2/test/build_dir.py (original)
+++ trunk/tools/build/v2/test/build_dir.py 2013-04-06 17:40:55 EDT (Sat, 06 Apr 2013)
@@ -37,6 +37,7 @@
 # Test that building from child projects work.
 t.run_build_system(subdir='src')
 t.ignore("build/config.log")
+t.ignore("build/project-cache.jam")
 t.expect_nothing_more()
 
 # Test that project can override build dir.

Modified: trunk/tools/build/v2/util/doc.jam
==============================================================================
--- trunk/tools/build/v2/util/doc.jam (original)
+++ trunk/tools/build/v2/util/doc.jam 2013-04-06 17:40:55 EDT (Sat, 06 Apr 2013)
@@ -260,6 +260,7 @@
     print.list-item "-d+2 Show commands as they are executed" ;
     print.list-item "-d0 Supress all informational messages" ;
     print.list-item "-q Stop at first error" ;
+ print.list-item "--reconfigure Rerun all configuration checks" ;
     print.list-item "--debug-configuration Diagnose configuration" ;
     print.list-item "--debug-building Report which targets are built with what properties" ;
     print.list-item "--debug-generator Diagnose generator search/execution" ;


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