-
-
Notifications
You must be signed in to change notification settings - Fork 637
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use task fingerprint for build invalidation to avoid
results_dir
cl…
…ashes (#5170) ### Problem In #4966, it was mentioned how tasks in different option scopes can end up with the same `results_dir`, which results in an error if tasks with different scopes but the same `stable_name` both try to use the cache in the same pants run (e.g. `lint.scalastyle` and `compile.scalastyle`). ### Solution - Use `Task#fingerprint` to compute the build invalidation key (in `TaskBase#_build_invalidator()`) and to generate the name of the cache subdirectory where results from the task run are stored (in `CacheFactory.make_task_cache_dirname( )` - Incorporate the `stable_name()` and `implementation_version()` into the computation of the task fingerprint. - Incorporate the `options_scope` of the `Task` subclass and the scopes of its `subsystem_dependencies` into the computation of the task fingerprint. Traverse all registered option scopes and incorporate the values of relevant options with `OptionsFingerprinter.combined_options_fingerprint_for_scope()`. ### Result - The task fingerprint is now rigorously described and tested. - The task fingerprint is now used for the invalidation key and for the name of the results directory. A corollary of this is that e.g. `lint.scalastyle` and `compile.scalastyle` no longer use the same `results_dir`, which resolves the issue described in #4966. - The directory path containing the task results after execution can no longer be guessed without instantiating the task, because the task fingerprint requires fingerprinting the option values relevant to the task. In `test_cache_cleanup_integration.py`, we run the pants subprocess twice in a few tests to get around this.
- Loading branch information
1 parent
f5345bf
commit 0bbe913
Showing
24 changed files
with
755 additions
and
284 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.