Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[zinc] Record the canonical path that was fingerprinted, rather than …
…the input path 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). Testing Done: This was integration tested internally at Twitter, and passes our full sandbox suite. https://travis-ci.org/pantsbuild/pants/builds/123158795 Bugs closed: 3193 Reviewed at https://rbcommons.com/s/twitter/r/3692/
- Loading branch information