Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Persist output for incremental targets
Summary: [Doc](https://docs.google.com/document/d/1-zhGPkmt3I2os-kcIaFk9SvT6odt2AJWswSY-J_6AWs/edit?usp=sharing) ### Context We are exploring the integration of the Kotlin Incremental Compiler into Buck for the incremental compilation of Kotlin source files. The goal is to improve build speed by only recompiling modified source files within a target, rather than rebuilding the entire target as is currently done. ### This stack Integration of the Kotlin Incremental Compiler using [Build Tools Api](https://github.com/JetBrains/kotlin/blob/master/compiler/build-tools/kotlin-build-tools-api/README.md). ### This diff The Kotlin incremental compiler only recompiles files that have been modified, so it is necessary to have the output from the previous run available for any source files that have not changed. On the Buck side, there is a `no_outputs_cleanup` (see [doc](https://buck2.build/docs/rule_authors/incremental_actions/?fbclid=IwZXh0bgNhZW0CMTEAAR1QpI3cFfO1VAW6ZfNgTmEsnNv3Fyz_2avbYVi53B8a3DD7-vM85pknSRg_aem_tm96x-AUtgMU1AaGZEh-Cg)) flag that can be used to prevent Buck2 from deleting old outputs for an action. This can be useful in situations where it is important to preserve the output directories. When using Buck to delete output directories, it may be possible to achieve the same result by using `MkdirIsolatedStep` (which creates a directory if it does not already exist) instead of `MakeCleanDirectoryIsolatedStep`, as long as it is not expected that a folder will need to be recreated within the process. Thus I replaced `MakeCleanDirectoryIsolatedStep` by `MkdirIsolatedStep` for non KSP and KAPT directories. KSP and KAPT need extra investigation. Differential Revision: D61284158 fbshipit-source-id: eaae8dd3e9210cd84d5f2c34c5d9b644a3edaa4e
- Loading branch information