Skip to content

Commit

Permalink
fixed auto-unstripping
Browse files Browse the repository at this point in the history
  • Loading branch information
dougxc committed Sep 20, 2019
1 parent af287df commit d378659
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions compiler/mx.compiler/mx_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -833,8 +833,8 @@ def __enter__(self):
candidate = e + '.map'
if exists(candidate):
if self.mapFiles is None:
self.mapFiles = set()
self.mapFiles.add(candidate)
self.mapFiles = []
self.mapFiles.append(candidate)
self.capture = mx.OutputCapture()
self.out = mx.TeeOutputCapture(self.capture)
self.err = self.out
Expand All @@ -849,7 +849,7 @@ def __exit__(self, exc_type, exc_value, traceback):
inputFile.write(data)
inputFile.flush()
retraceOut = mx.OutputCapture()
unstrip_args = [m for m in self.mapFiles] + [inputFile.name]
unstrip_args = [m for m in set(self.mapFiles)] + [inputFile.name]
mx.unstrip(unstrip_args, out=retraceOut)
if data != retraceOut.data:
mx.log('>>>> BEGIN UNSTRIPPED OUTPUT')
Expand All @@ -872,7 +872,8 @@ def run_java(args, nonZeroIsFatal=True, out=None, err=None, cwd=None, timeout=No
args = ['@' + add_exports] + args
_check_bootstrap_config(args)
cmd = get_vm_prefix() + [graaljdk.java] + ['-server'] + args
with StdoutUnstripping(args, out, err) as u:
map_file = join(graaljdk.home, 'proguard.map')
with StdoutUnstripping(args, out, err, mapFiles=[map_file]) as u:
return mx.run(cmd, nonZeroIsFatal=nonZeroIsFatal, out=u.out, err=u.err, cwd=cwd, env=env)

_JVMCI_JDK_TAG = 'jvmci'
Expand Down Expand Up @@ -1058,7 +1059,7 @@ def makegraaljdk_cli(args):
if args.license:
shutil.copy(args.license, join(dst_jdk_dir, 'LICENSE'))
if args.bootstrap:
map_file = dst_jdk_dir + '.map'
map_file = join(dst_jdk_dir, 'proguard.map')
with StdoutUnstripping(args=[], out=None, err=None, mapFiles=[map_file]) as u:
select_graal = [] if jdk_enables_jvmci_by_default(dst_jdk) else ['-XX:+UnlockExperimentalVMOptions', '-XX:+UseJVMCICompiler']
mx.run([dst_jdk.java] + select_graal + ['-XX:+BootstrapJVMCI', '-version'], out=u.out, err=u.err)
Expand Down Expand Up @@ -1231,7 +1232,7 @@ def _copy_file(src, dst):

unstrip_map = mx.make_unstrip_map(_graal_config().dists)
if unstrip_map:
with open(tmp_dst_jdk_dir + '.map', 'w') as fp:
with open(join(tmp_dst_jdk_dir, 'proguard.map'), 'w') as fp:
fp.write(unstrip_map)

except:
Expand Down
2 changes: 1 addition & 1 deletion compiler/mx.compiler/suite.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
suite = {
"mxversion" : "5.234.0",
"mxversion" : "5.236.0",
"name" : "compiler",
"sourceinprojectwhitelist" : [],

Expand Down

0 comments on commit d378659

Please sign in to comment.