Avoid modifying incr-compilation directory unless compilation completes normally #34957
Labels
A-incr-comp
Area: Incremental compilation
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
In #34956, we modify the incremental compilation directory a bit wantonly. For example, when first starting up, we will delete work products if it looks likes things have changed -- and we serialize the dep-graph and only later serialize the work-products file.
It seems to me it would be better if we avoided making changes until the end of compilation. In some cases, we might be able to avoid making changes altogether. For example, we could keep
.o
files -- even if they are dirty -- if errors are resulting, which would mean that if the changes are rolled back, compilation succeeds instantaneously.Similarly, we might serialize the dep-graph to a temp file and then serialize the work-products also to a temp file, and finally rename both files to their actual names once both are done.
The text was updated successfully, but these errors were encountered: