Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65165 - trunk/tools/build/v2/build
From: ghost_at_[hidden]
Date: 2010-09-01 05:02:53


Author: vladimir_prus
Date: 2010-09-01 05:02:49 EDT (Wed, 01 Sep 2010)
New Revision: 65165
URL: http://svn.boost.org/trac/boost/changeset/65165

Log:
Prevent double initialization of Jamfile in some cases.

Fixes #4570.
Thanks to Brian Freyburger for the patch.

Text files modified:
   trunk/tools/build/v2/build/project.jam | 25 +++++++++++++++----------
   trunk/tools/build/v2/build/project.py | 17 ++++++++---------
   2 files changed, 23 insertions(+), 19 deletions(-)

Modified: trunk/tools/build/v2/build/project.jam
==============================================================================
--- trunk/tools/build/v2/build/project.jam (original)
+++ trunk/tools/build/v2/build/project.jam 2010-09-01 05:02:49 EDT (Wed, 01 Sep 2010)
@@ -294,18 +294,22 @@
           : "Filenames are: " $(jamfile-to-load:D=) ;
     }
     
- # Initialize the Jamfile module before loading.
- #
- initialize $(jamfile-module) : [ path.parent $(jamfile-to-load) ]
- : $(jamfile-to-load:BS) ;
-
- local saved-project = $(.current-project) ;
- # Now load the Jamfile in it's own context. Initialization might have loaded
- # parent Jamfiles, which might have loaded the current Jamfile with
- # use-project. Do a final check to make sure it's not loaded already.
+ # Now load the Jamfile in it's own context.
+ # The call to 'initialize' may load parent Jamfile, which might have
+ # 'use-project' statement that causes a second attempt to load the
+ # same project we're loading now. Checking inside .jamfile-modules
+ # prevents that second attempt from messing up.
     if ! $(jamfile-module) in $(.jamfile-modules)
     {
         .jamfile-modules += $(jamfile-module) ;
+
+ # Initialize the Jamfile module before loading.
+ #
+ initialize $(jamfile-module) : [ path.parent $(jamfile-to-load) ]
+ : $(jamfile-to-load:BS) ;
+
+ local saved-project = $(.current-project) ;
+
         mark-as-user $(jamfile-module) ;
         modules.load $(jamfile-module) : [ path.native $(jamfile-to-load) ] : . ;
         if [ MATCH ($(JAMROOT)) : $(jamfile-to-load:BS) ]
@@ -316,7 +320,7 @@
                 load-aux $(jamfile-module) : [ path.native $(jamfile) ] ;
             }
         }
- }
+
     # Now do some checks.
     if $(.current-project) != $(saved-project)
     {
@@ -346,6 +350,7 @@
             }
         }
     }
+ }
 }
 
 

Modified: trunk/tools/build/v2/build/project.py
==============================================================================
--- trunk/tools/build/v2/build/project.py (original)
+++ trunk/tools/build/v2/build/project.py 2010-09-01 05:02:49 EDT (Wed, 01 Sep 2010)
@@ -312,23 +312,22 @@
         dir = os.path.dirname(jamfile_to_load)
         if not dir:
             dir = "."
- # Initialize the jamfile module before loading.
- #
- self.initialize(jamfile_module, dir, os.path.basename(jamfile_to_load))
 
         saved_project = self.current_project
 
         self.used_projects[jamfile_module] = []
         
- # Now load the Jamfile in it's own context.
- # Initialization might have load parent Jamfiles, which might have
- # loaded the current Jamfile with use-project. Do a final check to make
- # sure it's not loaded already.
+ # Now load the Jamfile in it's own context.
+ # The call to 'initialize' may load parent Jamfile, which might have
+ # 'use-project' statement that causes a second attempt to load the
+ # same project we're loading now. Checking inside .jamfile-modules
+ # prevents that second attempt from messing up.
         if not jamfile_module in self.jamfile_modules:
             self.jamfile_modules[jamfile_module] = True
 
- # FIXME:
- # mark-as-user $(jamfile-module) ;
+ # Initialize the jamfile module before loading.
+ #
+ self.initialize(jamfile_module, dir, os.path.basename(jamfile_to_load))
 
             bjam.call("load", jamfile_module, jamfile_to_load)
             basename = os.path.basename(jamfile_to_load)


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