[zinc] Record the canonical path that was fingerprinted, rather than the input path
Review Request #3692 - Created April 14, 2016 and submitted
|gmalmquist, nhoward_tw, patricklaw|
Record the canonical path that was fingerprinted, rather than the input path.
It is expected for inputs to change in the presence of the stable symlink: we feed zinc
.pants.d/compile/zinc/$taskversion/$targetid/current/*as the classes/analysis paths, and so during multiple incremental compiles the canonical path of the analysis will change.
zinc creates a FileFPrint for the analysis inputs, and uses it as a cache key. Before this change it was recording the symlink path for the file, rather than the canonical location. This was incorrect, because the analysis would not be reloaded if the symlink had changed. Luckily, this was detected by validation in
AnalysisMap.get, and we observed exceptions like:java.io.IOException: Analysis at (6480500942a8e2f9a0e76e0612e750f2: $BUILD_SANDBOX/.pants.d/compile/zinc/252d64521cf9/util.util-core.src.main.scala.scala/current/util.util-core.src.main.scala.scala.analysis) has changed since startup!
Because the cache key contained the stable name, when we failed to hit for the cache key, we finally detected that it had changed (much earlier).
This was integration tested internally at Twitter, and passes our full sandbox suite.
Status: Closed (submitted)
Merged as 61c01d4a76039cc9b88ff9cbe684e1989f79acf5