[engine] Fix bundle rel_path handling in engine
Review Request #4150 — Created Aug. 11, 2016 and submitted
|benjyw, kwlzn, stuhood|
When a bundle has a rel_path kwarg, the paths in the fileset kwarg are re-rooted to the rel_path. The engine didn't account for this, so the resulting bundles were missing files because they did not exist under the spec_path of the declaring BUILD file.
This patch fixes the issue.
- It introduces another condition to the validation in bundle creation so that the specially constructed globs from the engine pass validation.
- It checks the bundle declaration for a rel_path kwarg and uses that when constructing globs to evaluate in the engine.
Additionally, I added a better
__repr__ to the EagerFilesetWithSpec class so error messages contain better information.
Wrote a failing integration test, then followed the thread with unit tests. I ran all of the engine tests locally and CI is away on the PR: https://github.com/pantsbuild/pants/pull/3777
Update for Kris's comment.