Fix ApacheThriftGen chroot normalization scope.

Review Request #2568 - Created Aug. 4, 2015 and submitted

Information
John Sirois
pants
jsirois/issues/1918
1918, 1919
2569
d661ddc...
Reviewers
pants-reviews
benjyw, gmalmquist, mateor, stuhood, zundel

Previously, ApacheThriftGen attempted to normalize the gen chroot once
per file. In a multi-file target with nested namespaces, this could
lead to move errors when a previous file generated shared namespace
directories.

A test_nested_namespaces test is added that fails without the fix and
passes with the fix.

src/python/pants/backend/codegen/tasks/BUILD | 11 ----
src/python/pants/backend/codegen/tasks/apache_thrift_gen.py | 14 ++---
src/python/pants/backend/codegen/tasks/code_gen.py | 163 --------------------------------------------------
tests/python/pants_test/backend/codegen/tasks/BUILD | 11 ++++
tests/python/pants_test/backend/codegen/tasks/test_apache_thrift_gen.py | 70 ++++++++++++++++++++++
tests/python/pants_test/base_test.py | 6 +-
6 files changed, 91 insertions(+), 184 deletions(-)

Paul provided an example repo here:
  https://github.com/pgroudas/issues-1918
The README describes steps that fail and reproduce the bug using pants
0.0.40, but with this fix, pants works against that sample repo.

CI went green here:
  https://travis-ci.org/pantsbuild/pants/builds/74287990
John Sirois
John Sirois
John Sirois
John Sirois
John Sirois
Andy Reitz
John Sirois
John Sirois
Review request changed

Status: Closed (submitted)

Loading...