This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Upgrade to WAF 1.5.15

  • Loading branch information...
1 parent ec0266a commit 01f7d4484e5aa079155c0affc35210eee6959f99 @ry ry committed Apr 5, 2010
View
@@ -12,6 +12,6 @@ t = join(w, 'Tools')
sys.path = [w, t] + sys.path
import Scripting
-VERSION="1.5.14"
+VERSION="1.5.15"
Scripting.prepare(t, os.getcwd(), VERSION, wafdir)
sys.exit(0)
View
@@ -37,7 +37,7 @@ if 'PSYCOWAF' in os.environ:
try:import psyco;psyco.full()
except:pass
-VERSION="1.5.14"
+VERSION="1.5.15"
REVISION="x"
INSTALL="x"
C1='x'
View
@@ -681,8 +681,13 @@ def flush(self, all=1):
for i in xrange(len(self.task_manager.groups)):
g = self.task_manager.groups[i]
self.task_manager.current_group = i
+ if Logs.verbose:
+ Logs.debug('group: group %s' % ([x for x in self.task_manager.groups_names if id(self.task_manager.groups_names[x]) == id(g)][0]))
+
for tg in g.tasks_gen:
if id(tg) in to_compile:
+ if Logs.verbose:
+ Logs.debug('group: %s' % tg)
tg.post()
else:
@@ -702,9 +707,13 @@ def flush(self, all=1):
for i in xrange(len(self.task_manager.groups)):
g = self.task_manager.groups[i]
self.task_manager.current_group = i
+ if Logs.verbose:
+ Logs.debug('group: group %s' % ([x for x in self.task_manager.groups_names if id(self.task_manager.groups_names[x]) == id(g)][0]))
for tg in g.tasks_gen:
if not tg.path.is_child_of(ln):
continue
+ if Logs.verbose:
+ Logs.debug('group: %s' % tg)
tg.post()
def env_of_name(self, name):
@@ -125,7 +125,7 @@ def post_init(self):
except (OSError, IOError):
self.fatal('could not open %r for writing' % path)
- app = getattr(Utils.g_module, 'APPNAME', '')
+ app = Utils.g_module.APPNAME
if app:
ver = getattr(Utils.g_module, 'VERSION', '')
if ver:
@@ -9,9 +9,9 @@
"""
# do not touch these three lines, they are updated automatically
-HEXVERSION = 0x105014
-WAFVERSION="1.5.14"
-WAFREVISION = "7363M"
+HEXVERSION = 0x105015
+WAFVERSION="1.5.15"
+WAFREVISION = "7505M"
ABI = 7
# permissions
View
@@ -204,7 +204,7 @@ def find_or_declare(self, lst):
if node:
tp = node.id & 3
if tp != BUILD:
- raise Utils.WafError("find_or_declare returns a build node, not a source nor a directory %r" % lst)
+ raise Utils.WafError('find_or_declare cannot return a build node (build files in the source directory %r?)' % lst)
return node
node = self.__class__(name, parent, BUILD)
return node
@@ -461,8 +461,9 @@ def bldpath(self, env=None):
"path seen from the build dir default/src/foo.cpp"
if self.id & 3 == FILE:
return self.relpath_gen(self.__class__.bld.bldnode)
- if self.path_to_parent(self.__class__.bld.srcnode) is not '':
- return os.path.join(env.variant(), self.path_to_parent(self.__class__.bld.srcnode))
+ p = self.path_to_parent(self.__class__.bld.srcnode)
+ if p is not '':
+ return env.variant() + os.sep + p
return env.variant()
def srcpath(self, env=None):
View
@@ -190,11 +190,15 @@ def start(self):
try:
st = tsk.runnable_status()
except Exception, e:
- tsk.err_msg = Utils.ex_stack()
- tsk.hasrun = EXCEPTION
self.processed += 1
+ if self.stop and not Options.options.keep:
+ tsk.hasrun = SKIPPED
+ self.manager.add_finished(tsk)
+ continue
self.error_handler(tsk)
self.manager.add_finished(tsk)
+ tsk.hasrun = EXCEPTION
+ tsk.err_msg = Utils.ex_stack()
continue
if st == ASK_LATER:
@@ -412,7 +412,7 @@ def build_impl(bld):
bld.install()
-excludes = '.bzr .bzrignore .git .gitignore .svn CVS .cvsignore .arch-ids {arch} SCCS BitKeeper .hg _MTN _darcs Makefile Makefile.in config.log'.split()
+excludes = '.bzr .bzrignore .git .gitignore .svn CVS .cvsignore .arch-ids {arch} SCCS BitKeeper .hg _MTN _darcs Makefile Makefile.in config.log .gitattributes .hgignore .hgtags'.split()
dist_exts = '~ .rej .orig .pyc .pyo .bak .tar.bz2 tar.gz .zip .swp'.split()
def dont_dist(name, src, build_dir):
global excludes, dist_exts
@@ -486,8 +486,8 @@ def dist(appname='', version=''):
# return return (distdirname, tarballname)
import tarfile
- if not appname: appname = getattr(Utils.g_module, APPNAME, 'noname')
- if not version: version = getattr(Utils.g_module, VERSION, '1.0')
+ if not appname: appname = Utils.g_module.APPNAME
+ if not version: version = Utils.g_module.VERSION
tmp_folder = appname + '-' + version
if g_gz in ['gz', 'bz2']:
@@ -545,8 +545,8 @@ def distcheck(appname='', version=''):
'''checks if the sources compile (tarball from 'dist')'''
import tempfile, tarfile
- if not appname: appname = getattr(Utils.g_module, APPNAME, 'noname')
- if not version: version = getattr(Utils.g_module, VERSION, '1.0')
+ if not appname: appname = Utils.g_module.APPNAME
+ if not version: version = Utils.g_module.VERSION
waf = os.path.abspath(sys.argv[0])
tarball = dist(appname, version)
View
@@ -578,22 +578,25 @@ def signature(self):
try: return self.cache_sig[0]
except AttributeError: pass
- m = md5()
+ self.m = md5()
# explicit deps
exp_sig = self.sig_explicit_deps()
- m.update(exp_sig)
-
- # implicit deps
- imp_sig = self.scan and self.sig_implicit_deps() or SIG_NIL
- m.update(imp_sig)
# env vars
var_sig = self.sig_vars()
- m.update(var_sig)
+
+ # implicit deps
+
+ imp_sig = SIG_NIL
+ if self.scan:
+ try:
+ imp_sig = self.sig_implicit_deps()
+ except ValueError:
+ return self.signature()
# we now have the signature (first element) and the details (for debugging)
- ret = m.digest()
+ ret = self.m.digest()
self.cache_sig = (ret, exp_sig, imp_sig, var_sig)
return ret
@@ -771,7 +774,7 @@ def v(x):
def sig_explicit_deps(self):
bld = self.generator.bld
- m = md5()
+ up = self.m.update
# the inputs
for x in self.inputs + getattr(self, 'dep_nodes', []):
@@ -780,7 +783,7 @@ def sig_explicit_deps(self):
variant = x.variant(self.env)
try:
- m.update(bld.node_sigs[variant][x.id])
+ up(bld.node_sigs[variant][x.id])
except KeyError:
raise Utils.WafError('Missing node signature for %r (required by %r)' % (x, self))
@@ -803,29 +806,28 @@ def sig_explicit_deps(self):
raise Utils.WafError('Missing node signature for %r (required by %r)' % (v, self))
elif hasattr(v, '__call__'):
v = v() # dependency is a function, call it
- m.update(v)
+ up(v)
for x in self.deps_nodes:
v = bld.node_sigs[x.variant(self.env)][x.id]
- m.update(v)
+ up(v)
- return m.digest()
+ return self.m.digest()
def sig_vars(self):
- m = md5()
bld = self.generator.bld
env = self.env
# dependencies on the environment vars
act_sig = bld.hash_env_vars(env, self.__class__.vars)
- m.update(act_sig)
+ self.m.update(act_sig)
# additional variable dependencies, if provided
dep_vars = getattr(self, 'dep_vars', None)
if dep_vars:
- m.update(bld.hash_env_vars(env, dep_vars))
+ self.m.update(bld.hash_env_vars(env, dep_vars))
- return m.digest()
+ return self.m.digest()
#def scan(self, node):
# """this method returns a tuple containing:
@@ -852,6 +854,8 @@ def sig_implicit_deps(self):
return prev_sigs[2]
except (KeyError, OSError):
pass
+ del bld.task_sigs[key]
+ raise ValueError('rescan')
# no previous run or the signature of the dependencies has changed, rescan the dependencies
(nodes, names) = self.scan()
@@ -878,8 +882,7 @@ def compute_sig_implicit_deps(self):
"""it is intended for .cpp and inferred .h files
there is a single list (no tree traversal)
this is the hot spot so ... do not touch"""
- m = md5()
- upd = m.update
+ upd = self.m.update
bld = self.generator.bld
tstamp = bld.node_sigs
@@ -897,7 +900,7 @@ def compute_sig_implicit_deps(self):
else:
upd(tstamp[env.variant()][k.id])
- return m.digest()
+ return self.m.digest()
def funex(c):
dc = {}
@@ -1132,7 +1135,7 @@ def extract_deps(tasks):
except: # this is on purpose
pass
- variant = x.env.variant()
+ v = x.env.variant()
key = x.unique_id()
for k in x.generator.bld.node_deps.get(x.unique_id(), []):
try: dep_to_task[(v, k.id)].append(x)
@@ -527,6 +527,9 @@ def exec_rule(self):
raise Utils.WafError('input file %r could not be found (%r)' % (x, self.path.abspath()))
tsk.inputs.append(y)
+ if self.allnodes:
+ tsk.inputs.extend(self.allnodes)
+
if getattr(self, 'scan', None):
cls.scan = self.scan
@@ -186,7 +186,8 @@ def exec_cfg(self, kw):
vars = Utils.to_list(kw['variables'])
for v in vars:
val = self.cmd_and_log('%s --variable=%s %s' % (kw['path'], v, kw['package']), kw).strip()
- env.append_unique('%s_%s' % (uselib, v), val)
+ var = '%s_%s' % (uselib, v)
+ env[var] = val
if not 'okmsg' in kw:
kw['okmsg'] = 'ok'
return
@@ -541,10 +542,8 @@ def run_c_code(self, *k, **kw):
# if we need to run the program, try to get its result
if kw['execute']:
- ak = {} # syntax for python < 2.5, don't touch
- ak['stdout'] = ak['stderr'] = Utils.pproc.PIPE
args = Utils.to_list(kw.get('exec_args', []))
- proc = Utils.pproc.Popen([lastprog], *args, **ak)
+ proc = Utils.pproc.Popen([lastprog] + args, stdout=Utils.pproc.PIPE, stderr=Utils.pproc.PIPE)
(out, err) = proc.communicate()
w = self.log.write
w(str(out))
View
@@ -289,8 +289,8 @@ def apply_d_libs(self):
# object has ancestors to process (shared libraries): add them to the end of the list
if getattr(y, 'uselib_local', None):
lst = y.to_list(y.uselib_local)
- if 'dshlib' in y.features or 'cprogram' in y.features:
- lst = [x for x in lst if not 'cstaticlib' in self.name_to_obj(x).features]
+ if 'dshlib' in y.features or 'dprogram' in y.features:
+ lst = [x for x in lst if not 'dstaticlib' in self.name_to_obj(x).features]
tmp.extend(lst)
# link task and flags
@@ -386,6 +386,12 @@ def apply_d_vars(self):
# now process the library paths
# apply same path manipulation as used with import paths
for path in libpaths:
+ if not os.path.isabs(path):
+ node = self.path.find_resource(path)
+ if not node:
+ raise Utils.WafError('could not find libpath %r from %r' % (path, self))
+ path = node.abspath(self.env)
+
env.append_unique('DLINKFLAGS', libpath_st % path)
# add libraries
@@ -34,4 +34,5 @@ def asm_incflags(self):
def detect(conf):
conf.find_program(['gas', 'as'], var='AS')
if not conf.env.AS: conf.env.AS = conf.env.CC
+ #conf.env.ASFLAGS = ['-c'] <- may be necesary for .S files
@@ -65,7 +65,7 @@ def get_param(varname, default):
env = conf.env
env['EXEC_PREFIX'] = get_param('EXEC_PREFIX', env['PREFIX'])
- env['PACKAGE'] = getattr(Utils.g_module, 'APPNAME', None) or env['PACKAGE']
+ env['PACKAGE'] = Utils.g_module.APPNAME
complete = False
iter = 0
@@ -724,7 +724,17 @@ def exec_mf(self):
self.do_manifest = False
outfile = self.outputs[0].bldpath(env)
- manifest = self.outputs[-1].bldpath(env)
+
+ manifest = None
+ for out_node in self.outputs:
+ if out_node.name.endswith('.manifest'):
+ manifest = out_node.bldpath(env)
+ break
+ if manifest is None:
+ # Should never get here. If we do, it means the manifest file was
+ # never added to the outputs list, thus we don't have a manifest file
+ # to embed, so we just return.
+ return 0
# embedding mode. Different for EXE's and DLL's.
# see: http://msdn2.microsoft.com/en-us/library/ms235591(VS.80).aspx
@@ -738,7 +748,7 @@ def exec_mf(self):
#flags = ' '.join(env['MTFLAGS'] or [])
lst = []
- lst.extend(Utils.to_list(env['MT']))
+ lst.extend([env['MT']])
lst.extend(Utils.to_list(env['MTFLAGS']))
lst.extend(Utils.to_list("-manifest"))
lst.extend(Utils.to_list(manifest))
@@ -35,6 +35,10 @@ class PreprocError(Utils.WafError):
POPFILE = '-'
+
+recursion_limit = 100
+"do not loop too much on header inclusion"
+
go_absolute = 0
"set to 1 to track headers on files in /usr/include - else absolute paths are ignored"
@@ -636,7 +640,7 @@ def addlines(self, node):
filepath = node.abspath(self.env)
self.count_files += 1
- if self.count_files > 30000: raise PreprocError("recursion limit exceeded")
+ if self.count_files > recursion_limit: raise PreprocError("recursion limit exceeded")
pc = self.parse_cache
debug('preproc: reading file %r', filepath)
try:
@@ -55,7 +55,7 @@ def init_pyembed(self):
@extension(EXT_PY)
def process_py(self, node):
- if not (self.bld.is_install or self.install_path):
+ if not (self.bld.is_install and self.install_path):
return
def inst_py(ctx):
install_pyfile(self, node)
@@ -122,7 +122,7 @@ def _get_python_variables(python_exe, variables, imports=['import sys']):
except KeyError:
pass
proc = Utils.pproc.Popen([python_exe, "-c", '\n'.join(program)], stdout=Utils.pproc.PIPE, env=os_env)
- output = proc.communicate()[0].split("\n")
+ output = proc.communicate()[0].split("\n") # do not touch, python3
if proc.returncode:
if Options.options.verbose:
warn("Python program to extract python configuration variables failed:\n%s"
Oops, something went wrong.

0 comments on commit 01f7d44

Please sign in to comment.