Skip to content

Commit

Permalink
Recreate the logs directory on each capture.
Browse files Browse the repository at this point in the history
  • Loading branch information
stuhood committed May 11, 2018
1 parent 877184e commit e54b76b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ def worker(worker_key, work):
work()
result = (worker_key, SUCCESSFUL, None)
except Exception as e:
log.warn(traceback.format_exc())
result = (worker_key, FAILED, e)
finished_queue.put(result)
jobs_in_flight.decrement()
Expand Down
6 changes: 2 additions & 4 deletions src/python/pants/backend/jvm/tasks/jvm_compile/jvm_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,6 @@ def do_compile(self, invalidation_check, compile_contexts):
for target in invalid_targets:
cc = compile_contexts[target]
safe_mkdir(cc.classes_dir)
safe_mkdir(cc.log_dir)

# Now create compile jobs for each invalid target one by one, using the classpath
# generated by upstream JVM tasks and our own prepare_compile().
Expand Down Expand Up @@ -520,10 +519,9 @@ def _compile_vts(self, vts, target, sources, analysis_file, upstream_analysis, c
raise

def _capture_logs(self, workunit, destination):
safe_mkdir(destination, clean=True)
for idx, name, output_name, path in self._find_logs(workunit):
dest_path = os.path.join(destination, '{}-{}-{}.log'.format(name, idx, output_name))
safe_delete(dest_path)
os.link(path, dest_path)
os.link(path, os.path.join(destination, '{}-{}-{}.log'.format(name, idx, output_name)))

def _get_plugin_map(self, compiler, options_src, target):
"""Returns a map of plugin to args, for the given compiler.
Expand Down

0 comments on commit e54b76b

Please sign in to comment.