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

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

kwlzn
pants
3540
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

ST
  1. 
      
  2. I think this is worth doing... could you add a deprecation warning over there for bundles with no parameters at all? I'd actually prefer that to adding this check at all...

  3. 
      
PE
  1. Ship It!
  2. 
      
KW
KW
Review request changed

Status: Closed (submitted)

Change Summary:

thanks Stu & Peiyu! submitted @ cb1c39fe5836dc65db6b9bef14dc205ad18909d2

ST
  1. 
      
  2. 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.

  3. 
      
Loading...