Mercurial > hg > truffle
comparison mx/mx_graal.py @ 21166:f383ff4c9af8
mx: fix JDK selection when running outside a tty, capture STRICT_COMPLIANCE from the env file, make sure raw_input promt goes to stdout
author | Gilles Duboscq <gilles.m.duboscq@oracle.com> |
---|---|
date | Thu, 30 Apr 2015 20:29:27 +0200 |
parents | bdeaa5a7b83c |
children | 41ec6d89cb84 |
comparison
equal
deleted
inserted
replaced
21165:bdeaa5a7b83c | 21166:f383ff4c9af8 |
---|---|
116 global _vm | 116 global _vm |
117 if _vm: | 117 if _vm: |
118 return _vm | 118 return _vm |
119 vm = mx.get_env('DEFAULT_VM') | 119 vm = mx.get_env('DEFAULT_VM') |
120 if vm is None: | 120 if vm is None: |
121 if not sys.stdout.isatty(): | 121 if not mx.is_interactive()(): |
122 mx.abort('Need to specify VM with --vm option or DEFAULT_VM environment variable') | 122 mx.abort('Need to specify VM with --vm option or DEFAULT_VM environment variable') |
123 envPath = join(_graal_home, 'mx', 'env') | 123 envPath = join(_graal_home, 'mx', 'env') |
124 mx.log('Please select the VM to be executed from the following: ') | 124 mx.log('Please select the VM to be executed from the following: ') |
125 items = [k for k in _vmChoices.keys() if _vmChoices[k] is not None] | 125 items = [k for k in _vmChoices.keys() if _vmChoices[k] is not None] |
126 descriptions = [_vmChoices[k] for k in _vmChoices.keys() if _vmChoices[k] is not None] | 126 descriptions = [_vmChoices[k] for k in _vmChoices.keys() if _vmChoices[k] is not None] |
390 | 390 |
391 def _handle_missing_VM(bld, vm=None): | 391 def _handle_missing_VM(bld, vm=None): |
392 if not vm: | 392 if not vm: |
393 vm = _get_vm() | 393 vm = _get_vm() |
394 mx.log('The ' + bld + ' ' + vm + ' VM has not been created') | 394 mx.log('The ' + bld + ' ' + vm + ' VM has not been created') |
395 if sys.stdout.isatty(): | 395 if mx.is_interactive()(): |
396 if mx.ask_yes_no('Build it now', 'y'): | 396 if mx.ask_yes_no('Build it now', 'y'): |
397 with VM(vm, bld): | 397 with VM(vm, bld): |
398 build([]) | 398 build([]) |
399 return | 399 return |
400 mx.abort('You need to run "mx --vm ' + vm + ' --vmbuild ' + bld + ' build" to build the selected VM') | 400 mx.abort('You need to run "mx --vm ' + vm + ' --vmbuild ' + bld + ' build" to build the selected VM') |
2571 outputDirs = map(mx._cygpathU2W, [p.output_dir() for p in nonTestProjects]) | 2571 outputDirs = map(mx._cygpathU2W, [p.output_dir() for p in nonTestProjects]) |
2572 javaCompliance = max([p.javaCompliance for p in nonTestProjects]) | 2572 javaCompliance = max([p.javaCompliance for p in nonTestProjects]) |
2573 findbugsResults = join(_graal_home, 'findbugs.results') | 2573 findbugsResults = join(_graal_home, 'findbugs.results') |
2574 | 2574 |
2575 cmd = ['-jar', mx._cygpathU2W(findbugsJar), '-textui', '-low', '-maxRank', '15'] | 2575 cmd = ['-jar', mx._cygpathU2W(findbugsJar), '-textui', '-low', '-maxRank', '15'] |
2576 if sys.stdout.isatty(): | 2576 if mx.is_interactive(): |
2577 cmd.append('-progress') | 2577 cmd.append('-progress') |
2578 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 | 2578 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 |
2579 exitcode = mx.run_java(cmd, nonZeroIsFatal=False, javaConfig=mx.java(javaCompliance)) | 2579 exitcode = mx.run_java(cmd, nonZeroIsFatal=False, javaConfig=mx.java(javaCompliance)) |
2580 if exitcode != 0: | 2580 if exitcode != 0: |
2581 with open(findbugsResults) as fp: | 2581 with open(findbugsResults) as fp: |