Cool! Thanks for that, this could help with vs2012 support issues on scons builds.
Am 15.06.2013 um 21:52 schrieb Nathan Letwory <[email protected]>: > Revision: 57478 > > http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57478 > Author: jesterking > Date: 2013-06-15 19:52:45 +0000 (Sat, 15 Jun 2013) > Log Message: > ----------- > Long overdue update for our bundled SCons version, from 1.2.0 (20090223) to > current stable 2.3.0. > > Modified Paths: > -------------- > trunk/blender/scons/scons-time.py > trunk/blender/scons/scons.py > trunk/blender/scons/sconsign.py > > Added Paths: > ----------- > trunk/blender/scons/scons-local/ > trunk/blender/scons/scons-local/SCons/ > trunk/blender/scons/scons-local/SCons/Action.py > trunk/blender/scons/scons-local/SCons/Builder.py > trunk/blender/scons/scons-local/SCons/CacheDir.py > trunk/blender/scons/scons-local/SCons/Conftest.py > trunk/blender/scons/scons-local/SCons/Debug.py > trunk/blender/scons/scons-local/SCons/Defaults.py > trunk/blender/scons/scons-local/SCons/Environment.py > trunk/blender/scons/scons-local/SCons/Errors.py > trunk/blender/scons/scons-local/SCons/Executor.py > trunk/blender/scons/scons-local/SCons/Job.py > trunk/blender/scons/scons-local/SCons/Memoize.py > trunk/blender/scons/scons-local/SCons/Node/ > trunk/blender/scons/scons-local/SCons/Node/Alias.py > trunk/blender/scons/scons-local/SCons/Node/FS.py > trunk/blender/scons/scons-local/SCons/Node/Python.py > trunk/blender/scons/scons-local/SCons/Node/__init__.py > trunk/blender/scons/scons-local/SCons/Options/ > trunk/blender/scons/scons-local/SCons/Options/BoolOption.py > trunk/blender/scons/scons-local/SCons/Options/EnumOption.py > trunk/blender/scons/scons-local/SCons/Options/ListOption.py > trunk/blender/scons/scons-local/SCons/Options/PackageOption.py > trunk/blender/scons/scons-local/SCons/Options/PathOption.py > trunk/blender/scons/scons-local/SCons/Options/__init__.py > trunk/blender/scons/scons-local/SCons/PathList.py > trunk/blender/scons/scons-local/SCons/Platform/ > trunk/blender/scons/scons-local/SCons/Platform/__init__.py > trunk/blender/scons/scons-local/SCons/Platform/aix.py > trunk/blender/scons/scons-local/SCons/Platform/cygwin.py > trunk/blender/scons/scons-local/SCons/Platform/darwin.py > trunk/blender/scons/scons-local/SCons/Platform/hpux.py > trunk/blender/scons/scons-local/SCons/Platform/irix.py > trunk/blender/scons/scons-local/SCons/Platform/os2.py > trunk/blender/scons/scons-local/SCons/Platform/posix.py > trunk/blender/scons/scons-local/SCons/Platform/sunos.py > trunk/blender/scons/scons-local/SCons/Platform/win32.py > trunk/blender/scons/scons-local/SCons/SConf.py > trunk/blender/scons/scons-local/SCons/SConsign.py > trunk/blender/scons/scons-local/SCons/Scanner/ > trunk/blender/scons/scons-local/SCons/Scanner/C.py > trunk/blender/scons/scons-local/SCons/Scanner/D.py > trunk/blender/scons/scons-local/SCons/Scanner/Dir.py > trunk/blender/scons/scons-local/SCons/Scanner/Fortran.py > trunk/blender/scons/scons-local/SCons/Scanner/IDL.py > trunk/blender/scons/scons-local/SCons/Scanner/LaTeX.py > trunk/blender/scons/scons-local/SCons/Scanner/Prog.py > trunk/blender/scons/scons-local/SCons/Scanner/RC.py > trunk/blender/scons/scons-local/SCons/Scanner/__init__.py > trunk/blender/scons/scons-local/SCons/Script/ > trunk/blender/scons/scons-local/SCons/Script/Interactive.py > trunk/blender/scons/scons-local/SCons/Script/Main.py > trunk/blender/scons/scons-local/SCons/Script/SConsOptions.py > trunk/blender/scons/scons-local/SCons/Script/SConscript.py > trunk/blender/scons/scons-local/SCons/Script/__init__.py > trunk/blender/scons/scons-local/SCons/Sig.py > trunk/blender/scons/scons-local/SCons/Subst.py > trunk/blender/scons/scons-local/SCons/Taskmaster.py > trunk/blender/scons/scons-local/SCons/Tool/ > trunk/blender/scons/scons-local/SCons/Tool/386asm.py > trunk/blender/scons/scons-local/SCons/Tool/BitKeeper.py > trunk/blender/scons/scons-local/SCons/Tool/CVS.py > trunk/blender/scons/scons-local/SCons/Tool/FortranCommon.py > trunk/blender/scons/scons-local/SCons/Tool/GettextCommon.py > trunk/blender/scons/scons-local/SCons/Tool/JavaCommon.py > trunk/blender/scons/scons-local/SCons/Tool/MSCommon/ > trunk/blender/scons/scons-local/SCons/Tool/MSCommon/__init__.py > trunk/blender/scons/scons-local/SCons/Tool/MSCommon/arch.py > trunk/blender/scons/scons-local/SCons/Tool/MSCommon/common.py > trunk/blender/scons/scons-local/SCons/Tool/MSCommon/netframework.py > trunk/blender/scons/scons-local/SCons/Tool/MSCommon/sdk.py > trunk/blender/scons/scons-local/SCons/Tool/MSCommon/vc.py > trunk/blender/scons/scons-local/SCons/Tool/MSCommon/vs.py > trunk/blender/scons/scons-local/SCons/Tool/Perforce.py > trunk/blender/scons/scons-local/SCons/Tool/PharLapCommon.py > trunk/blender/scons/scons-local/SCons/Tool/RCS.py > trunk/blender/scons/scons-local/SCons/Tool/SCCS.py > trunk/blender/scons/scons-local/SCons/Tool/Subversion.py > trunk/blender/scons/scons-local/SCons/Tool/__init__.py > trunk/blender/scons/scons-local/SCons/Tool/aixc++.py > trunk/blender/scons/scons-local/SCons/Tool/aixcc.py > trunk/blender/scons/scons-local/SCons/Tool/aixf77.py > trunk/blender/scons/scons-local/SCons/Tool/aixlink.py > trunk/blender/scons/scons-local/SCons/Tool/applelink.py > trunk/blender/scons/scons-local/SCons/Tool/ar.py > trunk/blender/scons/scons-local/SCons/Tool/as.py > trunk/blender/scons/scons-local/SCons/Tool/bcc32.py > trunk/blender/scons/scons-local/SCons/Tool/c++.py > trunk/blender/scons/scons-local/SCons/Tool/cc.py > trunk/blender/scons/scons-local/SCons/Tool/cvf.py > trunk/blender/scons/scons-local/SCons/Tool/default.py > trunk/blender/scons/scons-local/SCons/Tool/dmd.py > trunk/blender/scons/scons-local/SCons/Tool/dvi.py > trunk/blender/scons/scons-local/SCons/Tool/dvipdf.py > trunk/blender/scons/scons-local/SCons/Tool/dvips.py > trunk/blender/scons/scons-local/SCons/Tool/f03.py > trunk/blender/scons/scons-local/SCons/Tool/f77.py > trunk/blender/scons/scons-local/SCons/Tool/f90.py > trunk/blender/scons/scons-local/SCons/Tool/f95.py > trunk/blender/scons/scons-local/SCons/Tool/filesystem.py > trunk/blender/scons/scons-local/SCons/Tool/fortran.py > trunk/blender/scons/scons-local/SCons/Tool/g++.py > trunk/blender/scons/scons-local/SCons/Tool/g77.py > trunk/blender/scons/scons-local/SCons/Tool/gas.py > trunk/blender/scons/scons-local/SCons/Tool/gcc.py > trunk/blender/scons/scons-local/SCons/Tool/gettext.py > trunk/blender/scons/scons-local/SCons/Tool/gfortran.py > trunk/blender/scons/scons-local/SCons/Tool/gnulink.py > trunk/blender/scons/scons-local/SCons/Tool/gs.py > trunk/blender/scons/scons-local/SCons/Tool/hpc++.py > trunk/blender/scons/scons-local/SCons/Tool/hpcc.py > trunk/blender/scons/scons-local/SCons/Tool/hplink.py > trunk/blender/scons/scons-local/SCons/Tool/icc.py > trunk/blender/scons/scons-local/SCons/Tool/icl.py > trunk/blender/scons/scons-local/SCons/Tool/ifl.py > trunk/blender/scons/scons-local/SCons/Tool/ifort.py > trunk/blender/scons/scons-local/SCons/Tool/ilink.py > trunk/blender/scons/scons-local/SCons/Tool/ilink32.py > trunk/blender/scons/scons-local/SCons/Tool/install.py > trunk/blender/scons/scons-local/SCons/Tool/intelc.py > trunk/blender/scons/scons-local/SCons/Tool/ipkg.py > trunk/blender/scons/scons-local/SCons/Tool/jar.py > trunk/blender/scons/scons-local/SCons/Tool/javac.py > trunk/blender/scons/scons-local/SCons/Tool/javah.py > trunk/blender/scons/scons-local/SCons/Tool/latex.py > trunk/blender/scons/scons-local/SCons/Tool/lex.py > trunk/blender/scons/scons-local/SCons/Tool/link.py > trunk/blender/scons/scons-local/SCons/Tool/linkloc.py > trunk/blender/scons/scons-local/SCons/Tool/m4.py > trunk/blender/scons/scons-local/SCons/Tool/masm.py > trunk/blender/scons/scons-local/SCons/Tool/midl.py > trunk/blender/scons/scons-local/SCons/Tool/mingw.py > trunk/blender/scons/scons-local/SCons/Tool/msgfmt.py > trunk/blender/scons/scons-local/SCons/Tool/msginit.py > trunk/blender/scons/scons-local/SCons/Tool/msgmerge.py > trunk/blender/scons/scons-local/SCons/Tool/mslib.py > trunk/blender/scons/scons-local/SCons/Tool/mslink.py > trunk/blender/scons/scons-local/SCons/Tool/mssdk.py > trunk/blender/scons/scons-local/SCons/Tool/msvc.py > trunk/blender/scons/scons-local/SCons/Tool/msvs.py > trunk/blender/scons/scons-local/SCons/Tool/mwcc.py > trunk/blender/scons/scons-local/SCons/Tool/mwld.py > trunk/blender/scons/scons-local/SCons/Tool/nasm.py > trunk/blender/scons/scons-local/SCons/Tool/packaging/ > trunk/blender/scons/scons-local/SCons/Tool/packaging/__init__.py > trunk/blender/scons/scons-local/SCons/Tool/packaging/ipk.py > trunk/blender/scons/scons-local/SCons/Tool/packaging/msi.py > trunk/blender/scons/scons-local/SCons/Tool/packaging/rpm.py > trunk/blender/scons/scons-local/SCons/Tool/packaging/src_tarbz2.py > trunk/blender/scons/scons-local/SCons/Tool/packaging/src_targz.py > trunk/blender/scons/scons-local/SCons/Tool/packaging/src_zip.py > trunk/blender/scons/scons-local/SCons/Tool/packaging/tarbz2.py > trunk/blender/scons/scons-local/SCons/Tool/packaging/targz.py > trunk/blender/scons/scons-local/SCons/Tool/packaging/zip.py > trunk/blender/scons/scons-local/SCons/Tool/pdf.py > trunk/blender/scons/scons-local/SCons/Tool/pdflatex.py > trunk/blender/scons/scons-local/SCons/Tool/pdftex.py > trunk/blender/scons/scons-local/SCons/Tool/qt.py > trunk/blender/scons/scons-local/SCons/Tool/rmic.py > trunk/blender/scons/scons-local/SCons/Tool/rpcgen.py > trunk/blender/scons/scons-local/SCons/Tool/rpm.py > trunk/blender/scons/scons-local/SCons/Tool/rpmutils.py > trunk/blender/scons/scons-local/SCons/Tool/sgiar.py > trunk/blender/scons/scons-local/SCons/Tool/sgic++.py > trunk/blender/scons/scons-local/SCons/Tool/sgicc.py > trunk/blender/scons/scons-local/SCons/Tool/sgilink.py > trunk/blender/scons/scons-local/SCons/Tool/sunar.py > trunk/blender/scons/scons-local/SCons/Tool/sunc++.py > trunk/blender/scons/scons-local/SCons/Tool/suncc.py > trunk/blender/scons/scons-local/SCons/Tool/sunf77.py > trunk/blender/scons/scons-local/SCons/Tool/sunf90.py > trunk/blender/scons/scons-local/SCons/Tool/sunf95.py > trunk/blender/scons/scons-local/SCons/Tool/sunlink.py > trunk/blender/scons/scons-local/SCons/Tool/swig.py > trunk/blender/scons/scons-local/SCons/Tool/tar.py > trunk/blender/scons/scons-local/SCons/Tool/tex.py > trunk/blender/scons/scons-local/SCons/Tool/textfile.py > trunk/blender/scons/scons-local/SCons/Tool/tlib.py > trunk/blender/scons/scons-local/SCons/Tool/wix.py > trunk/blender/scons/scons-local/SCons/Tool/xgettext.py > trunk/blender/scons/scons-local/SCons/Tool/yacc.py > trunk/blender/scons/scons-local/SCons/Tool/zip.py > trunk/blender/scons/scons-local/SCons/Util.py > trunk/blender/scons/scons-local/SCons/Variables/ > trunk/blender/scons/scons-local/SCons/Variables/BoolVariable.py > trunk/blender/scons/scons-local/SCons/Variables/EnumVariable.py > trunk/blender/scons/scons-local/SCons/Variables/ListVariable.py > trunk/blender/scons/scons-local/SCons/Variables/PackageVariable.py > trunk/blender/scons/scons-local/SCons/Variables/PathVariable.py > trunk/blender/scons/scons-local/SCons/Variables/__init__.py > trunk/blender/scons/scons-local/SCons/Warnings.py > trunk/blender/scons/scons-local/SCons/__init__.py > trunk/blender/scons/scons-local/SCons/compat/ > trunk/blender/scons/scons-local/SCons/compat/__init__.py > trunk/blender/scons/scons-local/SCons/compat/_scons_builtins.py > trunk/blender/scons/scons-local/SCons/compat/_scons_collections.py > trunk/blender/scons/scons-local/SCons/compat/_scons_dbm.py > trunk/blender/scons/scons-local/SCons/compat/_scons_hashlib.py > trunk/blender/scons/scons-local/SCons/compat/_scons_io.py > trunk/blender/scons/scons-local/SCons/compat/_scons_sets.py > trunk/blender/scons/scons-local/SCons/compat/_scons_subprocess.py > trunk/blender/scons/scons-local/SCons/cpp.py > trunk/blender/scons/scons-local/SCons/dblite.py > trunk/blender/scons/scons-local/SCons/exitfuncs.py > > Removed Paths: > ------------- > trunk/blender/scons/scons-local-1.2.0.d20090223/ > > Added: trunk/blender/scons/scons-local/SCons/Action.py > =================================================================== > --- trunk/blender/scons/scons-local/SCons/Action.py > (rev 0) > +++ trunk/blender/scons/scons-local/SCons/Action.py 2013-06-15 19:52:45 > UTC (rev 57478) > @@ -0,0 +1,1257 @@ > +"""SCons.Action > + > +This encapsulates information about executing any sort of action that > +can build one or more target Nodes (typically files) from one or more > +source Nodes (also typically files) given a specific Environment. > + > +The base class here is ActionBase. The base class supplies just a few > +OO utility methods and some generic methods for displaying information > +about an Action in response to the various commands that control printing. > + > +A second-level base class is _ActionAction. This extends ActionBase > +by providing the methods that can be used to show and perform an > +action. True Action objects will subclass _ActionAction; Action > +factory class objects will subclass ActionBase. > + > +The heavy lifting is handled by subclasses for the different types of > +actions we might execute: > + > + CommandAction > + CommandGeneratorAction > + FunctionAction > + ListAction > + > +The subclasses supply the following public interface methods used by > +other modules: > + > + __call__() > + THE public interface, "calling" an Action object executes the > + command or Python function. This also takes care of printing > + a pre-substitution command for debugging purposes. > + > + get_contents() > + Fetches the "contents" of an Action for signature calculation > + plus the varlist. This is what gets MD5 checksummed to decide > + if a target needs to be rebuilt because its action changed. > + > + genstring() > + Returns a string representation of the Action *without* > + command substitution, but allows a CommandGeneratorAction to > + generate the right action based on the specified target, > + source and env. This is used by the Signature subsystem > + (through the Executor) to obtain an (imprecise) representation > + of the Action operation for informative purposes. > + > + > +Subclasses also supply the following methods for internal use within > +this module: > + > + __str__() > + Returns a string approximation of the Action; no variable > + substitution is performed. > + > + execute() > + The internal method that really, truly, actually handles the > + execution of a command or Python function. This is used so > + that the __call__() methods can take care of displaying any > + pre-substitution representations, and *then* execute an action > + without worrying about the specific Actions involved. > + > + get_presig() > + Fetches the "contents" of a subclass for signature calculation. > + The varlist is added to this to produce the Action's contents. > + > + strfunction() > + Returns a substituted string representation of the Action. > + This is used by the _ActionAction.show() command to display the > + command/function that will be executed to generate the target(s). > + > +There is a related independent ActionCaller class that looks like a > +regular Action, and which serves as a wrapper for arbitrary functions > +that we want to let the user specify the arguments to now, but actually > +execute later (when an out-of-date check determines that it's needed to > +be executed, for example). Objects of this class are returned by an > +ActionFactory class that provides a __call__() method as a convenient > +way for wrapping up the functions. > + > +""" > + > +# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, > 2011, 2012, 2013 The SCons Foundation > +# > +# Permission is hereby granted, free of charge, to any person obtaining > +# a copy of this software and associated documentation files (the > +# "Software"), to deal in the Software without restriction, including > +# without limitation the rights to use, copy, modify, merge, publish, > +# distribute, sublicense, and/or sell copies of the Software, and to > +# permit persons to whom the Software is furnished to do so, subject to > +# the following conditions: > +# > +# The above copyright notice and this permission notice shall be included > +# in all copies or substantial portions of the Software. > +# > +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY > +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE > +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND > +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE > +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION > +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION > +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. > + > +__revision__ = "src/engine/SCons/Action.py 2013/03/03 09:48:35 garyo" > + > +import SCons.compat > + > +import dis > +import os > +# compat layer imports "cPickle" for us if it's available. > +import pickle > +import re > +import sys > +import subprocess > + > +from SCons.Debug import logInstanceCreation > +import SCons.Errors > +import SCons.Executor > +import SCons.Util > +import SCons.Subst > + > +# we use these a lot, so try to optimize them > +is_String = SCons.Util.is_String > +is_List = SCons.Util.is_List > + > +class _null(object): > + pass > + > +print_actions = 1 > +execute_actions = 1 > +print_actions_presub = 0 > + > +def rfile(n): > + try: > + return n.rfile() > + except AttributeError: > + return n > + > +def default_exitstatfunc(s): > + return s > + > +try: > + SET_LINENO = dis.SET_LINENO > + HAVE_ARGUMENT = dis.HAVE_ARGUMENT > +except AttributeError: > + remove_set_lineno_codes = lambda x: x > +else: > + def remove_set_lineno_codes(code): > + result = [] > + n = len(code) > + i = 0 > + while i < n: > + c = code[i] > + op = ord(c) > + if op >= HAVE_ARGUMENT: > + if op != SET_LINENO: > + result.append(code[i:i+3]) > + i = i+3 > + else: > + result.append(c) > + i = i+1 > + return ''.join(result) > + > +strip_quotes = re.compile('^[\'"](.*)[\'"]$') > + > + > +def _callable_contents(obj): > + """Return the signature contents of a callable Python object. > + """ > + try: > + # Test if obj is a method. > + return _function_contents(obj.im_func) > + > + except AttributeError: > + try: > + # Test if obj is a callable object. > + return _function_contents(obj.__call__.im_func) > + > + except AttributeError: > + try: > + # Test if obj is a code object. > + return _code_contents(obj) > + > + except AttributeError: > + # Test if obj is a function object. > + return _function_contents(obj) > + > + > +def _object_contents(obj): > + """Return the signature contents of any Python object. > + > + We have to handle the case where object contains a code object > + since it can be pickled directly. > + """ > + try: > + # Test if obj is a method. > + return _function_contents(obj.im_func) > + > + except AttributeError: > + try: > + # Test if obj is a callable object. > + return _function_contents(obj.__call__.im_func) > + > + except AttributeError: > + try: > + # Test if obj is a code object. > + return _code_contents(obj) > + > + except AttributeError: > + try: > + # Test if obj is a function object. > + return _function_contents(obj) > + > + except AttributeError: > + # Should be a pickable Python object. > + try: > + return pickle.dumps(obj) > + except (pickle.PicklingError, TypeError): > + # This is weird, but it seems that nested classes > + # are unpickable. The Python docs say it should > + # always be a PicklingError, but some Python > + # versions seem to return TypeError. Just do > + # the best we can. > + return str(obj) > + > + > +def _code_contents(code): > + """Return the signature contents of a code object. > + > + By providing direct access to the code object of the > + function, Python makes this extremely easy. Hooray! > + > + Unfortunately, older versions of Python include line > + number indications in the compiled byte code. Boo! > + So we remove the line number byte codes to prevent > + recompilations from moving a Python function. > + """ > + > + contents = [] > + > + # The code contents depends on the number of local variables > + # but not their actual names. > + contents.append("%s,%s" % (code.co_argcount, len(code.co_varnames))) > + try: > + contents.append(",%s,%s" % (len(code.co_cellvars), > len(code.co_freevars))) > + except AttributeError: > + # Older versions of Python do not support closures. > + contents.append(",0,0") > + > + # The code contents depends on any constants accessed by the > + # function. Note that we have to call _object_contents on each > + # constants because the code object of nested functions can > + # show-up among the constants. > + # > + # Note that we also always ignore the first entry of co_consts > + # which contains the function doc string. We assume that the > + # function does not access its doc string. > + contents.append(',(' + > ','.join(map(_object_contents,code.co_consts[1:])) + ')') > + > + # The code contents depends on the variable names used to > + # accessed global variable, as changing the variable name changes > + # the variable actually accessed and therefore changes the > + # function result. > + contents.append(',(' + ','.join(map(_object_contents,code.co_names)) + > ')') > + > + > + # The code contents depends on its actual code!!! > + contents.append(',(' + str(remove_set_lineno_codes(code.co_code)) + ')') > + > + return ''.join(contents) > + > + > +def _function_contents(func): > + """Return the signature contents of a function.""" > + > + contents = [_code_contents(func.func_code)] > + > + # The function contents depends on the value of defaults arguments > + if func.func_defaults: > + contents.append(',(' + > ','.join(map(_object_contents,func.func_defaults)) + ')') > + else: > + contents.append(',()') > + > + # The function contents depends on the closure captured cell values. > + try: > > @@ Diff output truncated at 10240 characters. @@ > _______________________________________________ > Bf-blender-cvs mailing list > [email protected] > http://lists.blender.org/mailman/listinfo/bf-blender-cvs _______________________________________________ Bf-committers mailing list [email protected] http://lists.blender.org/mailman/listinfo/bf-committers
