[engine] Fix bundle rel_path handling in engine

Review Request #4150 - Created Aug. 11, 2016 and submitted

Information
Nick Howard (Twitter)
pants
3775, 3777
Reviewers
pants-reviews
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

Kris Wilson
Nick Howard (Twitter)
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted as https://github.com/pantsbuild/pants/commit/38ea0a847047a26b0252f41963e30d8d6a428dc1
Stu Hood
Ship It!
Loading...