Support uninstalling a task from a phase.

Review Request #879 - Created Aug. 13, 2014 and submitted

Information
Benjy Weinberger
pants
Reviewers
pants-reviews
patricklaw
Support uninstalling a task from a phase.

  
Patrick Lawson
Benjy Weinberger
Review request changed

Status: Closed (submitted)

Change Summary:

Shipped in d3cf0d3ba6dfec4dc30197b4220efe8404b6e26e.
Stu Hood
Can you give an example of how to use this?

# previously we were using:
> phase('test').remove('specs')
# but the obvious replacement fails:
> Phase.by_name('test').uninstall_task('specs')
# with:
> Exception message: Cannot uninstall unknown task: scala_specs
  1. Just looking at the code, it's really difficult to see how this could possibly happen.  The name in the exception is exactly the name passed to `uninstall_task`.  Can you double check your code or provide more context?
  2. Er, yea. I mixed different attempted fixes and error messages. The actual failure for that change was:
    
    # previously we were using:
    > phase('test').remove('specs')
    # but the obvious replacement fails:
    > Phase.by_name('test').uninstall_task('specs')
    # with:
    > Exception message: Cannot uninstall unknown task: specs
  3. Is this in your own fork of pants, or from within your plugin?  Seems like it could be an ordering issue.
    
    If it's within your plugin and not an order issue, you can drop a trace (`import pdb; pdb.set_trace()`) and poke around with the global state in Phase to try to get a feel for what's going on.
  4. It turns out this failure was due to bootstrap BUILD files now being loaded before registration. But we were easily able to move the removal into our registration instead. Thanks!
Loading...