Skip to content

Avoid modifying incr-compilation directory unless compilation completes normally #34957

Closed
@nikomatsakis

Description

@nikomatsakis

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-incr-compArea: Incremental compilationC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions