Make `JvmAppAdaptor` compatible with bare `bundle()` form.

Review Request #3965 - Created June 2, 2016 and submitted

Information
Kris Wilson
pants
3540
Reviewers
pants-reviews
jsirois, peiyu, stuhood

Given a BUILD file like:

jvm_app(
  name='bundle',
  basename='xyz',
  binary='x/y/z:bin',
  bundles=[
    bundle()
  ]
)

running ./pants --enable-v2-engine list <target> currently throws an AttributeError: JvmAppAdaptor(address=x/y:bundle) does not have attribute 'field_adaptors'. this was an in-property exception (itself causing an AttributeError for failed resolution of the property) which actually turned out to be a second AttributeError for an invalid access of an undefined bundle.fileset attribute.

this review adds handling of this case with logging - as well as blanket exception logging for the field_adaptors properties to help reveal otherwise hidden exceptions in the future.

reproduced locally in our monorepo against one of ~250 targets of this form. verified the exception logging prior to the change and the warning logging after the change.

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

Stu Hood
Peiyu Wang
Kris Wilson
Review request changed

Status: Closed (submitted)

Change Summary:

thanks Stu & Peiyu! submitted @ cb1c39fe5836dc65db6b9bef14dc205ad18909d2

Stu Hood

   
src/python/pants/engine/legacy/structs.py (Diff revision 2)
 
 
 
 
 
 
 

Hm. I'm surprised that we're not actually calling Bundle.__call__ at some point during the hydration... I think that that is a bug.

Loading...