Mercurial > hg > graal-compiler
diff mxtool/mx.py @ 18641:e22a21b27036
Merge.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sun, 07 Dec 2014 20:43:33 +0100 |
parents | dcf5cd3c6da9 |
children | beb33138029c |
line wrap: on
line diff
--- a/mxtool/mx.py Fri Dec 05 11:09:57 2014 +0100 +++ b/mxtool/mx.py Sun Dec 07 20:43:33 2014 +0100 @@ -109,7 +109,7 @@ try: excl = [dependency(d) for d in self.excludedDependencies] except SystemExit as e: - abort('invalid excluded dependency for {} distribution: {}'.format(self.name, e)) + abort('invalid excluded dependency for {0} distribution: {1}'.format(self.name, e)) return deps + [d for d in sorted_deps(self.deps, includeLibs=includeLibs) if d not in excl] def __str__(self): @@ -698,14 +698,14 @@ abspath = _make_absolute(path, self.suite.dir) if not optional and not exists(abspath): if not len(urls): - abort('Non-optional library {} must either exist at {} or specify one or more URLs from which it can be retrieved'.format(name, abspath)) + abort('Non-optional library {0} must either exist at {1} or specify one or more URLs from which it can be retrieved'.format(name, abspath)) def _checkSha1PropertyCondition(propName, cond, inputPath): if not cond: absInputPath = _make_absolute(inputPath, self.suite.dir) if exists(absInputPath): - abort('Missing "{}" property for library {}. Add the following line to projects file:\nlibrary@{}@{}={}'.format(propName, name, name, propName, sha1OfFile(absInputPath))) - abort('Missing "{}" property for library {}'.format(propName, name)) + abort('Missing "{0}" property for library {1}. Add the following line to projects file:\nlibrary@{2}@{3}={4}'.format(propName, name, name, propName, sha1OfFile(absInputPath))) + abort('Missing "{0}" property for library {1}'.format(propName, name)) _checkSha1PropertyCondition('sha1', sha1, path) _checkSha1PropertyCondition('sourceSha1', not sourcePath or sourceSha1, sourcePath) @@ -880,7 +880,7 @@ if not existing: suite[s] = additional else: - conflicting = additional.keys() & existing.keys() + conflicting = frozenset(additional.keys()) & frozenset(existing.keys()) if conflicting: abort(modulePath + ' redefines: ' + ', '.join(conflicting)) existing.update(additional) @@ -1181,12 +1181,12 @@ finally: d.optional = True if not path: - logv('[omitting optional library {} as {} does not exist]'.format(d, d.path)) + logv('[omitting optional library {0} as {1} does not exist]'.format(d, d.path)) del _libs[d.name] self.libs.remove(d) elif d.isProject(): if java(d.javaCompliance) is None: - logv('[omitting project {} as Java compliance {} cannot be satisfied by configured JDKs]'.format(d, d.javaCompliance)) + logv('[omitting project {0} as Java compliance {1} cannot be satisfied by configured JDKs]'.format(d, d.javaCompliance)) del _projects[d.name] self.projects.remove(d) else: @@ -1195,19 +1195,19 @@ if jreLib: if not jreLib.is_present_in_jdk(java(d.javaCompliance)): if jreLib.optional: - logv('[omitting project {} as dependency {} is missing]'.format(d, name)) + logv('[omitting project {0} as dependency {1} is missing]'.format(d, name)) del _projects[d.name] self.projects.remove(d) else: - abort('JRE library {} required by {} not found'.format(jreLib, d)) + abort('JRE library {0} required by {1} not found'.format(jreLib, d)) elif not dependency(name, fatalIfMissing=False): - logv('[omitting project {} as dependency {} is missing]'.format(d, name)) + logv('[omitting project {0} as dependency {1} is missing]'.format(d, name)) del _projects[d.name] self.projects.remove(d) for dist in _dists.itervalues(): for name in list(dist.deps): if not dependency(name, fatalIfMissing=False): - logv('[omitting {} from distribution {}]'.format(name, dist)) + logv('[omitting {0} from distribution {1}]'.format(name, dist)) dist.deps.remove(name) if hasattr(self, 'mx_post_parse_cmd_line'): @@ -1673,6 +1673,9 @@ opts = self.parse_args() + global _opts + _opts = opts + # Give the timeout options a default value to avoid the need for hasattr() tests opts.__dict__.setdefault('timeout', 0) opts.__dict__.setdefault('ptimeout', 0) @@ -2209,7 +2212,7 @@ the object's value is printed and the exit status is one. """ - if _opts.killwithsigquit: + if _opts and _opts.killwithsigquit: _send_sigquit() def is_alive(p): @@ -2227,7 +2230,7 @@ _kill_process_group(p.pid, signal.SIGKILL) except BaseException as e: if is_alive(p): - log('error while killing subprocess {} "{}": {}'.format(p.pid, ' '.join(args), e)) + log('error while killing subprocess {0} "{1}": {2}'.format(p.pid, ' '.join(args), e)) if _opts and _opts.verbose: import traceback @@ -2304,7 +2307,7 @@ return self.proj.name def logCompilation(self, compiler): - log('Compiling Java sources for {} with {}... [{}]'.format(self.proj.name, compiler, self.reason)) + log('Compiling Java sources for {0} with {1}... [{2}]'.format(self.proj.name, compiler, self.reason)) def execute(self): argfileName = join(self.proj.dir, 'javafilelist.txt') @@ -2688,8 +2691,8 @@ failed += joinTasks(active) if len(failed): for t in failed: - log('Compiling {} failed'.format(t.proj.name)) - abort('{} Java compilation tasks failed'.format(len(failed))) + log('Compiling {0} failed'.format(t.proj.name)) + abort('{0} Java compilation tasks failed'.format(len(failed))) if args.java: for dist in sorted_dists(): @@ -3039,7 +3042,7 @@ candidates.difference_update(c.all_deps([], False, False)) candidates = [d.name for d in candidates] - abort('{} does not use any packages defined in these projects: {}\nComputed project dependencies: {}'.format( + abort('{0} does not use any packages defined in these projects: {1}\nComputed project dependencies: {2}'.format( p, ', '.join(ignoredDeps), ','.join(candidates))) excess = frozenset(p.deps) - set(p.canonical_deps()) @@ -3166,7 +3169,7 @@ if name == 'file': source[0] = attrs['name'] elif name == 'error': - errors.append('{}:{}: {}'.format(source[0], attrs['line'], attrs['message'])) + errors.append('{0}:{1}: {2}'.format(source[0], attrs['line'], attrs['message'])) xp = xml.parsers.expat.ParserCreate() xp.StartElementHandler = start_element @@ -4782,9 +4785,9 @@ if not 'version' in subprocess.check_output(['dot', '-V'], stderr=subprocess.STDOUT): dotErr = 'dot -V does not print a string containing "version"' except subprocess.CalledProcessError as e: - dotErr = 'error calling "dot -V": {}'.format(e) + dotErr = 'error calling "dot -V": {0}'.format(e) except OSError as e: - dotErr = 'error calling "dot -V": {}'.format(e) + dotErr = 'error calling "dot -V": {0}'.format(e) if dotErr != None: abort('cannot generate dependency graph: ' + dotErr) @@ -4824,7 +4827,7 @@ # Create HTML that embeds the svg file in an <object> frame with open(html, 'w') as fp: - print >> fp, '<html><body><object data="{}.svg" type="image/svg+xml"></object></body></html>'.format(args.dot_output_base) + print >> fp, '<html><body><object data="{0}.svg" type="image/svg+xml"></object></body></html>'.format(args.dot_output_base) if exists(args.base): shutil.rmtree(args.base) @@ -5177,9 +5180,9 @@ abort('no primary suite found') opts, commandAndArgs = _argParser._parse_cmd_line() - - global _opts, _java_homes - _opts = opts + assert _opts == opts + + global _java_homes defaultJdk = JavaConfig(opts.java_home, opts.java_dbg_port) _java_homes = [defaultJdk] if opts.extra_java_homes: