forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add native support for incremental caching, and use it in jvm_compile
This moves `jvm_compile` to the `cache_target_dirs` setting in order to help kill the manual caching API before the engine refactor. In order to do that, it was necessary to add native support for incremental compilation to `cache_manager.py` and `task.py`. Optional incremental builds are implemented by copying from the previous `results_dir` for a VersionedTarget to the current one. This has the advantage that `results_dir`s are immutable (concurrent `./pants run.jvm` invocations should now be safe, regardless of changing ivy resolves). - Implement optional incrementalism for tasks, with copy-on-write `results_dir`s - Switch jvm_compile to cache_target_dirs, and drop all usage of `self.workdir` - Replace the cache_hit_callback with a rmtree of a targets' `results_dir` before extracting a cache hit - Privatize-stale and delete-unused methods for `task.py` - Move the `no_cache` tag from jvm_target to target in order to implement it in `task.py` - Add `vt.id` to the path for `vt.results_dir`, which fixed an issue where two targets with identical fingerprints would share a `results_dir` (even thought that will "usually" work, it's confusing) - Add `mark_dirty` methods to Payload and PayloadField, for testing purposes. Testing Done: https://travis-ci.org/pantsbuild/pants/builds/86336104 Bugs closed: 2394 Reviewed at https://rbcommons.com/s/twitter/r/2991/
- Loading branch information
Showing
26 changed files
with
468 additions
and
434 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# A config to globally enable caching for the purposes of manual testing. | ||
|
||
[DEFAULT] | ||
local_artifact_cache = %(buildroot)s/.buildcache | ||
|
||
|
||
[cache] | ||
read_from = ["%(local_artifact_cache)s"] | ||
write_to = ["%(local_artifact_cache)s"] |
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.