Add java_thrift_library fingerprint strategy

Review Request #2265 — Created May 24, 2015 and submitted — Latest diff uploaded

chrischen
pants
5ec1b23...
pants-reviews
areitz, benjyw, fkorotkov, ity, jinfeng, jsirois, patricklaw, stuhood, tejal, zundel

This rb adds fingerprint strategy for java_thrift Library. It fixes the pants cache bug - java thrift library does not include language, compiler and rpc style in its hash key generation. As a result, if any of those values changes, pants will throw an error due to cache.

For example, if a java_thrift_library target was compiled, but then changed its rpc style from sync to fingle, and compile again. Since hash didn't change, pants doesn't invalidate the target. Pants would eventually return an error because it couldn't find the file at the cached location.
To provide a more specific error, it would try to find a file like
.pants.d/gen/scrooge/java-finagle/gen-file-map-by-target/src.thrift.com.twitter.bouncer.bounce-action-thrift-java
but the actual file is .pants.d/gen/scrooge/java-sync/gen-file-map-by-target/src.thrift.com.twitter.bouncer.bounce-action-thrift-java

See the relevent discussion here https://groups.google.com/forum/#!topic/pants-devel/9I2oiTNmOhg

Please discard RB #2258.

https://github.com/pantsbuild/pants/pull/1590
./pants test contrib/scrooge/tests/python/pants_test/contrib/scrooge/tasks
and manually verified invalidation by changing rpc_style and verified pants cache worked correctly when pants target didn't change.

Loading...