Support for optional product requirements.

Review Request #4071 — Created July 12, 2016 and submitted

kwlzn, mateor, stuhood, zundel
That is, you can now request products for the purpose of scheduling
in the round manager, but it won't be an error if nothing produces them.

This is then used in, to request source products ('java',
'python', etc.) This provides an alternative solution to the problem
of failing on missing products when no codegen produces those source
products.  The previous solution (cb78b0ef7bc) was to have source roots
implicitly provide those products.  However this caused performance
issues because we have to scan the filesystem for source roots. This
solution does not have that problem.

CI passes:

I verified that this fixes the CI performance issues introduced by cb78b0ef7bc.

  2. Could mention here maybe.

  3. src/python/pants/engine/ (Diff revision 1)

    Ah naming.

    require_data and optional_data have a nice symmetry, but require and optional_product aren't obviously related. I can't think of anything better, but in case you can.

    1. I started out with "require" vs. "require_optional", which is just confusing... I couldn't really think of anything shy of renaming "require" to "require_product", which is too big a change...

Review request changed

Status: Closed (submitted)

Change Summary:


  1. Thanks Stu. Submitted as dbc708f164ecc2d9c614f2386a28f0f445b202b6, to get rid of the CI perf issues ASAP. If other reviews have comments to address, I'll do those in another change.

  1. Sorry I am late on the review. I love this feature though!