Ensure stale classes are removed during isolated compile by cleaning classes directory prior to handling invalid targets

Review Request #2805 - Created Sept. 12, 2015 and submitted

Information
Nick Howard (Twitter)
pants
2173, 2176
b3af80b...
Reviewers
pants-reviews
jsirois, stuhood

Injects a callback into artifact cache inbetween resolving a cached artifact and loading it into the work directory. Jvm isolated compile then provides one that cleans the classes directory on a cache hit.

When the current fingerprint of a compile target doesn't match the one on disk which is managed by the BuildInvalidator, it either will be loaded from cache, or rebuild via the compile tasks. In the case that we would load from cache, we want to ensure that the previous contents of the directory are removed.

Additionally
changed the name of the zinc java compile integration test since it didn't match the file name.
added a few tests for ../cache/artifact.py

Wrote failing integration test, and made it pass.

CI passing at https://travis-ci.org/pantsbuild/pants/builds/80722631

Issues

  • 0
  • 0
  • 1
  • 1
Description From Last Updated
John Sirois
Eric Ayers
Stu Hood
Nick Howard (Twitter)
Nick Howard (Twitter)
Nick Howard (Twitter)
Nick Howard (Twitter)
Stu Hood
Nick Howard (Twitter)
Nick Howard (Twitter)
Review request changed

Status: Closed (submitted)

Change Summary:

https://github.com/pantsbuild/pants/commit/92657c7247b5897061c02002cfbc613885880035

Eric Ayers

   

It think this is a bug. Should be:

class_dir = self._key_to_target.get(cache_key)
  1. Yep. Thanks for finding it.

Loading...