[engine] refine exception output

Review Request #3992 - Created June 10, 2016 and submitted

Information
Yi Cheng
pants
3535, 3584
Reviewers
pants-reviews
kwlzn, nhoward_tw, peiyu, stuhood
  1. Output exception details on leaf trace nodes as opposed to lots of repetitions as linked in the bug.
  2. newline Throw for clarity.

https://travis-ci.org/pantsbuild/pants/builds/138217773

[tw-mbp-yic pants (3535_b)]$ ./pants --enable-v2-engine dependees examples/tests/::
Exception caught: (<class 'pants.build_graph.address_lookup_error.AddressLookupError'>)
File "/Users/yic/workspace/pants/src/python/pants/bin/pants_exe.py", line 50, in <module>
main()
File "/Users/yic/workspace/pants/src/python/pants/bin/pants_exe.py", line 44, in main
PantsRunner(exiter).run()
File "/Users/yic/workspace/pants/src/python/pants/bin/pants_runner.py", line 57, in run
options_bootstrapper=options_bootstrapper)
File "/Users/yic/workspace/pants/src/python/pants/bin/pants_runner.py", line 46, in _run
return LocalPantsRunner(exiter, args, env, options_bootstrapper=options_bootstrapper).run()
File "/Users/yic/workspace/pants/src/python/pants/bin/local_pants_runner.py", line 53, in run
self._maybe_profiled(self._run)
File "/Users/yic/workspace/pants/src/python/pants/bin/local_pants_runner.py", line 50, in _maybe_profiled
runner()
File "/Users/yic/workspace/pants/src/python/pants/bin/local_pants_runner.py", line 93, in _run
self._exiter).setup()
File "/Users/yic/workspace/pants/src/python/pants/bin/goal_runner.py", line 84, in init
build_graph)
File "/Users/yic/workspace/pants/src/python/pants/bin/goal_runner.py", line 99, in _select_buildgraph
return graph_helper.create_graph(root_specs)
File "/Users/yic/workspace/pants/src/python/pants/bin/engine_initializer.py", line 70, in create_graph
for _ in graph.inject_specs_closure(spec_roots): # Ensure the entire generator is unrolled.
File "/Users/yic/workspace/pants/src/python/pants/engine/legacy/graph.py", line 171, in inject_specs_closure
for address in self._inject(specs):
File "/Users/yic/workspace/pants/src/python/pants/engine/legacy/graph.py", line 183, in _inject
self._index(request.roots)
File "/Users/yic/workspace/pants/src/python/pants/engine/legacy/graph.py", line 68, in _index
'Build graph construction failed for {}:\n{}'.format(node.subject, trace))

Exception message: Build graph construction failed for DescendantAddresses(directory='examples/tests'):
Computing LegacyTarget for DescendantAddresses(directory='examples/tests')
Computing LegacyTarget for examples/tests/scala/org/pantsbuild/example/hello/welcome:welcome
Computing LegacyTarget for examples/src/scala/org/pantsbuild/example/hello/welcome:welcome
Computing LegacyTarget for examples/src/java/org/pantsbuild/example/hello/greet:greet
Computing TargetAdaptor for examples/src/java/org/pantsbuild/example/hello/greet:greet
Computing Struct for examples/src/java/org/pantsbuild/example/hello/greet:greet
Computing UnhydratedStruct for examples/src/java/org/pantsbuild/example/hello/greet:greet
Computing AddressFamily for Dir(path=u'examples/src/java/org/pantsbuild/example/hello/greet')
Throw(exc=MappingError(u"Failed to parse examples/src/java/org/pantsbuild/example/hello/greet/BUILD:\nname 'abc' is not defined",))
Computing LegacyTarget for examples/tests/java/org/pantsbuild/example/hello/greet:greet
Throw(exc=MappingError(u"Failed to parse examples/src/java/org/pantsbuild/example/hello/greet/BUILD:\nname 'abc' is not defined",))

Issues

  • 0
  • 2
  • 0
  • 2
Description From Last Updated
Yi Cheng
Kris Wilson
Yi Cheng
Nick Howard (Twitter)
Yi Cheng
Yi Cheng
Stu Hood
Yi Cheng
Kris Wilson
Nick Howard (Twitter)
Yi Cheng
Yi Cheng
Review request changed

Status: Closed (submitted)

Change Summary:

cdb72c853b0d301dd95c43e2def10cb2da95feeb thanks gents!

Loading...