forked from pantsbuild/pants
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure that invalid vts have results_dir cleaned before passing to ta… (
pantsbuild#4139) Tasks that sometimes fail due to outside factors (download failures, resolve issues, etc) often would call safe_mkdir(vt.results_dir, clean=True) in order to wipe possibly truncated or crufty state. But since vt.results_dir is a symlink, that replaced it with a real dir. That ended up breaking caching, since: * Product pipeline was consuming from the vt.results_dir * But the artifacts in the cache were created using vt.current_results_dir, which no longer got the output. If a target is invalid, the cache_manager will now wipe the results_dir prior to passing to the task, removing the need for tasks to clean it themself. It also now checks to make sure that the results_dir is legal before marking a VT valid and passing to the artifact_cache. Also: * Raise an Exception if relative_symlink tries to unlink a concrete file * Copy over previous results *only* after checking for cache hits * Before this change every file in compile.zinc results_dir was copied twice per cache hit, and then thrown away. Now it only copies after a cache miss. The majority of the change is added test coverage to cover the original and added behavior.
- Loading branch information
Showing
12 changed files
with
375 additions
and
114 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
Oops, something went wrong.