Clean up analysis.tmp usage between pants and zinc wrapper (Part 2)
Review Request #4246 - Created Sept. 19, 2016 and submitted
|benjyw, jsirois, molsen, nhoward_tw, stuhood, zundel|
This review and rb/4245 eliminates
.analysis.tmp's usage in pants, hides its creation and renaming with a
SafeFileBasedStore, so between pants and zinc the analysis file is always
valid, we wouldn't end up with pants passing to zinc inconsistent
.analysisfiles, which contributes to https://github.com/pantsbuild/pants/issues/3667
See rb/4245 for more details.
(zinc tool version is bump to 0.0.4 to include https://rbcommons.com/s/twitter/r/4245/)
AFAICT, this bit of logic to delete the existing analysis remains important. If for some reason we've decided not to compile incrementally (because it is disabled, for example), then we should ensure that zinc does not receive valid analysis for the classes.
But also, see https://github.com/pantsbuild/pants/issues/3670 : more than just deleting the existing analysis, if we've decided not to compile incrementally, we should likely purge the classfiles as well (to fix that issue).
Have tested, the following works in non-incremental mode,
if not should_compile_incrementally(vts, ctx): # Purge existing analysis file in non-incremental mode. safe_delete(ctx.analysis_file) # Work around https://github.com/pantsbuild/pants/issues/3670 safe_rmtree(ctx.classes_dir)
Have to include
safe_rmtree(ctx.classes_dir)I believe is due to https://github.com/sbt/zinc/issues/144
Upgrade zinc_2.10 to 0.0.4 to include https://rbcommons.com/s/twitter/r/4245
Revision 3 (+9 -16)