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

List in new engine with no args breaks #3798

Closed
baroquebobcat opened this issue Aug 18, 2016 · 11 comments
Closed

List in new engine with no args breaks #3798

baroquebobcat opened this issue Aug 18, 2016 · 11 comments
Assignees
Labels

Comments

@baroquebobcat
Copy link
Contributor

Exception caught: (<type 'exceptions.AttributeError'>)
  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 53, in run
    self._maybe_profiled(self._run)
  File "/.../pants/src/python/pants/bin/local_pants_runner.py", line 50, in _maybe_profiled
    runner()
  File "/.../pants/src/python/pants/bin/local_pants_runner.py", line 95, in _run
    result = goal_runner.run()
  File "/.../pants/src/python/pants/bin/goal_runner.py", line 243, in run
    result = self._execute_engine()
  File "/.../pants/src/python/pants/bin/goal_runner.py", line 232, in _execute_engine
    result = engine.execute(self._context, self._goals)
  File "/.../pants/src/python/pants/engine/legacy_engine.py", line 26, in execute
    self.attempt(context, goals)
  File "/.../pants/src/python/pants/engine/round_engine.py", line 224, in attempt
    goal_executor.attempt(explain)
  File "/.../pants/src/python/pants/engine/round_engine.py", line 47, in attempt
    task.execute()
  File "/.../pants/src/python/pants/task/console_task.py", line 57, in execute
    for value in self.console_output(targets):
  File "/.../pants/src/python/pants/backend/graph_info/tasks/listtargets.py", line 72, in console_output
    for target in self._targets():
  File "/.../pants/src/python/pants/backend/graph_info/tasks/listtargets.py", line 82, in _targets
    return self.context.scan().targets(predicate=lambda target: not target.is_synthetic)
  File "/.../pants/src/python/pants/goal/context.py", line 355, in scan
    build_graph.inject_address_closure(address)
  File "/.../pants/src/python/pants/build_graph/mutable_build_graph.py", line 60, in inject_address_closure
    dep_addresses = list(mapper.specs_to_addresses(target_addressable.dependency_specs,

Exception message: 'LegacyAddressMapper' object has no attribute 'specs_to_addresses'


@kwlzn kwlzn added this to the v2 engine/daemon adoption milestone Aug 18, 2016
@kwlzn
Copy link
Member

kwlzn commented Aug 23, 2016

missing attributes on LegacyAddressMapper also seems to be breaking ./pants dependees - wonder if @JieGhost saw any of this breakage in his v2 expansion testing? if not, we might simply be lacking coverage for these cases.

@kwlzn
Copy link
Member

kwlzn commented Aug 23, 2016

ftr:

$ ./pants dependees $REDACTED_TARGET

FAILURE
Exception caught: (<type 'exceptions.AttributeError'>)
  File "/Users/kwilson/dev/pants/src/python/pants/bin/pants_exe.py", line 50, in <module>
    main()
  File "/Users/kwilson/dev/pants/src/python/pants/bin/pants_exe.py", line 44, in main
    PantsRunner(exiter).run()
  File "/Users/kwilson/dev/pants/src/python/pants/bin/pants_runner.py", line 57, in run
    options_bootstrapper=options_bootstrapper)
  File "/Users/kwilson/dev/pants/src/python/pants/bin/pants_runner.py", line 46, in _run
    return LocalPantsRunner(exiter, args, env, options_bootstrapper=options_bootstrapper).run()
  File "/Users/kwilson/dev/pants/src/python/pants/bin/local_pants_runner.py", line 53, in run
    self._maybe_profiled(self._run)
  File "/Users/kwilson/dev/pants/src/python/pants/bin/local_pants_runner.py", line 50, in _maybe_profiled
    runner()
  File "/Users/kwilson/dev/pants/src/python/pants/bin/local_pants_runner.py", line 95, in _run
    result = goal_runner.run()
  File "/Users/kwilson/dev/pants/src/python/pants/bin/goal_runner.py", line 240, in run
    result = self._execute_engine()
  File "/Users/kwilson/dev/pants/src/python/pants/bin/goal_runner.py", line 229, in _execute_engine
    result = engine.execute(self._context, self._goals)
  File "/Users/kwilson/dev/pants/src/python/pants/engine/legacy_engine.py", line 26, in execute
    self.attempt(context, goals)
  File "/Users/kwilson/dev/pants/src/python/pants/engine/round_engine.py", line 224, in attempt
    goal_executor.attempt(explain)
  File "/Users/kwilson/dev/pants/src/python/pants/engine/round_engine.py", line 47, in attempt
    task.execute()
  File "/Users/kwilson/dev/pants/src/python/pants/task/console_task.py", line 57, in execute
    for value in self.console_output(targets):
  File "/Users/kwilson/dev/pants/src/python/pants/backend/graph_info/tasks/dependees.py", line 37, in console_output
    buildfiles = address_mapper.scan_build_files(base_path=None)

Exception message: 'LegacyAddressMapper' object has no attribute 'scan_build_files'

@JieGhost
Copy link
Contributor

I didn't see it in initial PR. Probably is a lack of coverage. But are we supposed to call those goals without any args?

@kwlzn
Copy link
Member

kwlzn commented Aug 23, 2016

the convention is that anytime you call pants with no target, :: is used as the default target. e.g. ./pants list implies ./pants list ::.

for dependees, I am actually passing a target tho.

@kwlzn
Copy link
Member

kwlzn commented Aug 23, 2016

it could also be the case that the cause of these issues landed after your test PR - it might be a good idea to backmerge and re-run.

@JieGhost
Copy link
Contributor

So I started a new PR with all the changes I have, and it hasn't finished yet, but I already see a failure about "Exception message: 'LegacyAddressMapper' object has no attribute 'specs_to_addresses'"

@JieGhost
Copy link
Contributor

JieGhost commented Aug 25, 2016

  1. I think v2 engine currently does not support "dependees".
  2. For list, it only happens when no args.

https://github.com/pantsbuild/pants/blob/master/src/python/pants/backend/graph_info/tasks/listtargets.py#L78

if no args given, v2 engine does noop on generating build_graph, and self.context.target_roots is empty. engine will call self.context.scan() which will create a MutableBuildGraph, with the addressmapper for v2 engine.

if args are given (even "::"), v2 engine can generate build_graph, and self.context.target_roots is not empty.

For fixing "list", i think we can just simply check options.target_specs in EngineInitializer.parse_commandline_to_spec_roots, if it is empty, we make it "::".
plus, we can remove backend/graph_info/tasks/listtargets.py: _targets()

@JieGhost
Copy link
Contributor

this blocks #3740

@kwlzn
Copy link
Member

kwlzn commented Sep 22, 2016

@JieGhost did you happen to start on this one? I think I'm in a good position to repair this as part of the second bit of the changed work - maybe I could steal this back from you?

@JieGhost
Copy link
Contributor

Oops, Sorry Kris. I didn't see your message earlier.

@JieGhost
Copy link
Contributor

JieGhost commented Oct 5, 2016

I think this one is merged.

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

No branches or pull requests

3 participants