Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore trace #4007

Closed
stuhood opened this issue Oct 31, 2016 · 3 comments
Closed

Restore trace #4007

stuhood opened this issue Oct 31, 2016 · 3 comments
Assignees

Comments

@stuhood
Copy link
Member

stuhood commented Oct 31, 2016

Trace is not currently implemented for the native engine, and some tests relying on matching strings in the output are thus failing.

@stuhood
Copy link
Member Author

stuhood commented Oct 31, 2016

Relates to #3695

@JieGhost
Copy link
Contributor

blocks #3740

stuhood pushed a commit that referenced this issue Nov 19, 2016
Problem
----------
Re-implementing trace was deferred during the initial work on the Rust scheduler. See #4007.

Solution
----------
 This patch partially reintroduces it. The rust implementation will now produce traces that include the subjects and some of the information about failures. Some types of failures will not have good messages yet. This is because we haven't landed a patch to fix #4025. Also, the trace function will produce traces for each of the roots.

Result
-------

Example output:

    $ echo "WUT" >> BUILD.tools 
    $ ./pants --enable-v2-engine list //:
    Exception caught: (<class 'pants.build_graph.address_lookup_error.AddressLookupError'>)
      File "/.../pants/src/python/pants/bin/pants_exe.py", line 50, in <module>
        main()
      File "/.../pants/src/python/pants/bin/pants_exe.py", line 44, in main
        PantsRunner(exiter).run()
      File "/.../pants/src/python/pants/bin/pants_runner.py", line 57, in run
        options_bootstrapper=options_bootstrapper)
      File "/.../pants/src/python/pants/bin/pants_runner.py", line 46, in _run
        return LocalPantsRunner(exiter, args, env, options_bootstrapper=options_bootstrapper).run()
      File "/.../pants/src/python/pants/bin/local_pants_runner.py", line 37, in run
        self._run()
      File "/.../pants/src/python/pants/bin/local_pants_runner.py", line 77, in _run
        self._exiter).setup()
      File "/.../pants/src/python/pants/bin/goal_runner.py", line 184, in setup
        goals, context = self._setup_context()
      File "/.../pants/src/python/pants/bin/goal_runner.py", line 157, in _setup_context
        self._daemon_graph_helper
      File "/.../pants/src/python/pants/bin/goal_runner.py", line 101, in _init_graph
        graph, address_mapper = graph_helper.create_build_graph(target_roots, self._root_dir)
      File "/.../pants/src/python/pants/bin/engine_initializer.py", line 88, in create_build_graph
        for _ in graph.inject_specs_closure(target_roots.as_specs()):
      File "/.../pants/src/python/pants/engine/legacy/graph.py", line 205, in inject_specs_closure
        for address in self._inject(specs):
      File "/.../pants/src/python/pants/engine/legacy/graph.py", line 225, in _inject
        self._index(target_entries)
      File "/.../pants/src/python/pants/engine/legacy/graph.py", line 83, in _index
        'Build graph construction failed for {}:\n{}'.format(node, trace))

    Exception message: Build graph construction failed for (SiblingAddresses(directory=u''), Select(Collection.of(HydratedTarget))):
    Computing =Collection.of(HydratedTarget) for SiblingAddresses(directory=u'')
      Computing =Collection.of(HydratedTarget) for SiblingAddresses(directory=u'')
        Computing =HydratedTarget for SiblingAddresses(directory=u'')
          Computing =Collection.of(Address) for SiblingAddresses(directory=u'')
            Computing =Collection.of(Address) for SiblingAddresses(directory=u'')
              Computing =AddressFamily for SiblingAddresses(directory=u'')
                Computing =AddressFamily for Dir(path=u'')
                  Computing =AddressFamily for Dir(path=u'')
                    Throw("EntryId(17) failed!")

    Computing =Collection.of(Address) for SiblingAddresses(directory=u'')
      Computing =Collection.of(Address) for SiblingAddresses(directory=u'')
        Computing =AddressFamily for SiblingAddresses(directory=u'')
          Computing =AddressFamily for Dir(path=u'')
            Computing =AddressFamily for Dir(path=u'')
              Throw("EntryId(17) failed!")


Testing
--------

Local manual testing with ./pants list and a corrupted BUILD file. Running tests that had been skipped due to this feature being missing. CI away on #4076
@stuhood
Copy link
Member Author

stuhood commented Nov 19, 2016

Fixed in 37122df

@stuhood stuhood closed this as completed Nov 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants