diff --git a/src/python/pants/backend/jvm/tasks/jvm_compile/execution_graph.py b/src/python/pants/backend/jvm/tasks/jvm_compile/execution_graph.py index 8767b4b9a4db..c5fa64a023bf 100644 --- a/src/python/pants/backend/jvm/tasks/jvm_compile/execution_graph.py +++ b/src/python/pants/backend/jvm/tasks/jvm_compile/execution_graph.py @@ -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() diff --git a/src/python/pants/backend/jvm/tasks/jvm_compile/jvm_compile.py b/src/python/pants/backend/jvm/tasks/jvm_compile/jvm_compile.py index 72c8f101995a..65af54affef4 100644 --- a/src/python/pants/backend/jvm/tasks/jvm_compile/jvm_compile.py +++ b/src/python/pants/backend/jvm/tasks/jvm_compile/jvm_compile.py @@ -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(). @@ -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.