Mercurial > hg > truffle
comparison mx/mx_graal.py @ 18641:e22a21b27036
Merge.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sun, 07 Dec 2014 20:43:33 +0100 |
parents | d5d1fbe270e9 |
children | ae5033a78f1d |
comparison
equal
deleted
inserted
replaced
18640:02b5114b74c1 | 18641:e22a21b27036 |
---|---|
753 | 753 |
754 if opts2.export_dir is not None: | 754 if opts2.export_dir is not None: |
755 if not exists(opts2.export_dir): | 755 if not exists(opts2.export_dir): |
756 os.makedirs(opts2.export_dir) | 756 os.makedirs(opts2.export_dir) |
757 else: | 757 else: |
758 assert os.path.isdir(opts2.export_dir), '{} is not a directory'.format(opts2.export_dir) | 758 assert os.path.isdir(opts2.export_dir), '{0} is not a directory'.format(opts2.export_dir) |
759 | 759 |
760 defsPath = join(_graal_home, 'make', 'defs.make') | 760 defsPath = join(_graal_home, 'make', 'defs.make') |
761 with open(defsPath) as fp: | 761 with open(defsPath) as fp: |
762 defs = fp.read() | 762 defs = fp.read() |
763 for jdkDist in _jdkDeployedDists: | 763 for jdkDist in _jdkDeployedDists: |
1436 with Task('BootstrapWithImmutableCode:product', tasks): | 1436 with Task('BootstrapWithImmutableCode:product', tasks): |
1437 vm(['-XX:-TieredCompilation', '-G:+ImmutableCode', '-G:+VerifyPhases', '-esa', '-version']) | 1437 vm(['-XX:-TieredCompilation', '-G:+ImmutableCode', '-G:+VerifyPhases', '-esa', '-version']) |
1438 | 1438 |
1439 with VM('server', 'product'): # hosted mode | 1439 with VM('server', 'product'): # hosted mode |
1440 with Task('UnitTests:hosted-product', tasks): | 1440 with Task('UnitTests:hosted-product', tasks): |
1441 unittest(['--enable-timing', '--verbose']) | 1441 unittest(['--enable-timing', '--verbose', '--fail-fast']) |
1442 | 1442 |
1443 with VM('server', 'product'): # hosted mode | 1443 with VM('server', 'product'): # hosted mode |
1444 with Task('UnitTests-BaselineCompiler:hosted-product', tasks): | 1444 with Task('UnitTests-BaselineCompiler:hosted-product', tasks): |
1445 unittest(['--enable-timing', '--verbose', '--whitelist', 'test/whitelist_baseline.txt', '-G:+UseBaselineCompiler']) | 1445 unittest(['--enable-timing', '--verbose', '--whitelist', 'test/whitelist_baseline.txt', '-G:+UseBaselineCompiler']) |
1446 | 1446 |
1833 artifactId = d['artifactId'] | 1833 artifactId = d['artifactId'] |
1834 groupId = d['groupId'] | 1834 groupId = d['groupId'] |
1835 deps = d['deps'] | 1835 deps = d['deps'] |
1836 makejmhdep(artifactId, groupId, deps) | 1836 makejmhdep(artifactId, groupId, deps) |
1837 except ValueError as e: | 1837 except ValueError as e: |
1838 mx.abort('Error parsing {}:\n{}'.format(f, e)) | 1838 mx.abort('Error parsing {0}:\n{1}'.format(f, e)) |
1839 | 1839 |
1840 def buildjmh(args): | 1840 def buildjmh(args): |
1841 """build the JMH benchmarks""" | 1841 """build the JMH benchmarks""" |
1842 | 1842 |
1843 parser = ArgumentParser(prog='mx buildjmh') | 1843 parser = ArgumentParser(prog='mx buildjmh') |
1914 if v is None: | 1914 if v is None: |
1915 del jmhArgs[n] | 1915 del jmhArgs[n] |
1916 else: | 1916 else: |
1917 jmhArgs[n] = v | 1917 jmhArgs[n] = v |
1918 except ValueError as e: | 1918 except ValueError as e: |
1919 mx.abort('error parsing JSON input: {}\n{}'.format(j, e)) | 1919 mx.abort('error parsing JSON input: {0}\n{1}'.format(j, e)) |
1920 | 1920 |
1921 jmhPath = _get_jmh_path() | 1921 jmhPath = _get_jmh_path() |
1922 mx.log('Using benchmarks in ' + jmhPath) | 1922 mx.log('Using benchmarks in ' + jmhPath) |
1923 | 1923 |
1924 matchedSuites = set() | 1924 matchedSuites = set() |
2269 shutil.rmtree(tmp) | 2269 shutil.rmtree(tmp) |
2270 findbugsJar = join(findbugsLib, 'findbugs.jar') | 2270 findbugsJar = join(findbugsLib, 'findbugs.jar') |
2271 assert exists(findbugsJar) | 2271 assert exists(findbugsJar) |
2272 nonTestProjects = [p for p in mx.projects() if not p.name.endswith('.test') and not p.name.endswith('.jtt')] | 2272 nonTestProjects = [p for p in mx.projects() if not p.name.endswith('.test') and not p.name.endswith('.jtt')] |
2273 outputDirs = map(mx._cygpathU2W, [p.output_dir() for p in nonTestProjects]) | 2273 outputDirs = map(mx._cygpathU2W, [p.output_dir() for p in nonTestProjects]) |
2274 javaCompliance = max([p.javaCompliance for p in nonTestProjects]) | |
2274 findbugsResults = join(_graal_home, 'findbugs.results') | 2275 findbugsResults = join(_graal_home, 'findbugs.results') |
2275 | 2276 |
2276 cmd = ['-jar', mx._cygpathU2W(findbugsJar), '-textui', '-low', '-maxRank', '15'] | 2277 cmd = ['-jar', mx._cygpathU2W(findbugsJar), '-textui', '-low', '-maxRank', '15'] |
2277 if sys.stdout.isatty(): | 2278 if sys.stdout.isatty(): |
2278 cmd.append('-progress') | 2279 cmd.append('-progress') |
2279 cmd = cmd + ['-auxclasspath', mx._separatedCygpathU2W(mx.classpath([d.name for d in _jdkDeployedDists] + [p.name for p in nonTestProjects])), '-output', mx._cygpathU2W(findbugsResults), '-exitcode'] + args + outputDirs | 2280 cmd = cmd + ['-auxclasspath', mx._separatedCygpathU2W(mx.classpath([d.name for d in _jdkDeployedDists] + [p.name for p in nonTestProjects])), '-output', mx._cygpathU2W(findbugsResults), '-exitcode'] + args + outputDirs |
2280 exitcode = mx.run_java(cmd, nonZeroIsFatal=False) | 2281 exitcode = mx.run_java(cmd, nonZeroIsFatal=False, javaConfig=mx.java(javaCompliance)) |
2281 if exitcode != 0: | 2282 if exitcode != 0: |
2282 with open(findbugsResults) as fp: | 2283 with open(findbugsResults) as fp: |
2283 mx.log(fp.read()) | 2284 mx.log(fp.read()) |
2284 os.unlink(findbugsResults) | 2285 os.unlink(findbugsResults) |
2285 return exitcode | 2286 return exitcode |
2307 with open(f) as fp: | 2308 with open(f) as fp: |
2308 content = fp.read() | 2309 content = fp.read() |
2309 if not matcher.match(content): | 2310 if not matcher.match(content): |
2310 failures[f] = csConfig | 2311 failures[f] = csConfig |
2311 for n, v in failures.iteritems(): | 2312 for n, v in failures.iteritems(): |
2312 mx.log('{}: header does not match RegexpHeader defined in {}'.format(n, v)) | 2313 mx.log('{0}: header does not match RegexpHeader defined in {1}'.format(n, v)) |
2313 return len(failures) | 2314 return len(failures) |
2314 | 2315 |
2315 def mx_init(suite): | 2316 def mx_init(suite): |
2316 commands = { | 2317 commands = { |
2317 'build': [build, ''], | 2318 'build': [build, ''], |