Skip to content

Build a new incr comp session dir from scratch every time#159287

Draft
bjorn3 wants to merge 2 commits into
rust-lang:mainfrom
bjorn3:incr_comp_session_from_scratch
Draft

Build a new incr comp session dir from scratch every time#159287
bjorn3 wants to merge 2 commits into
rust-lang:mainfrom
bjorn3:incr_comp_session_from_scratch

Conversation

@bjorn3

@bjorn3 bjorn3 commented Jul 14, 2026

Copy link
Copy Markdown
Member

Rather than copying the old incr comp dir and then modifying it. This saves a copy/hardlink for files that are modified. And it removes the need for accurate work product tracking to avoid accumulating cruft, which is non-trivial. We don't accurately track the pre-LTO bitcode files for ThinLTO for example.

Based on #159225
Part of rust-lang/compiler-team#908

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 14, 2026
@rust-log-analyzer

This comment has been minimized.

@bjorn3 bjorn3 added the A-incr-comp Area: Incremental compilation label Jul 14, 2026
@rust-bors

This comment has been minimized.

@bjorn3
bjorn3 force-pushed the incr_comp_session_from_scratch branch 2 times, most recently from bf1a4e3 to 50ba28a Compare July 21, 2026 09:35
@rust-log-analyzer

This comment has been minimized.

@bjorn3
bjorn3 force-pushed the incr_comp_session_from_scratch branch from 50ba28a to 68660f2 Compare July 21, 2026 14:00
@rust-log-analyzer

This comment has been minimized.

@bjorn3
bjorn3 force-pushed the incr_comp_session_from_scratch branch from 68660f2 to 1f2a9e3 Compare July 21, 2026 14:43
@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

bjorn3 added 2 commits July 23, 2026 12:14
This will allow introducing a separate incr comp session dir for the
post LTO artifacts in the future. In addition it statically encodes the
lifetime of the incr comp session rather than requiring an enum behind a
mutex stored in the Session.
Rather than copying the old incr comp dir and then modifying it. This
saves a copy/hardlink for files that are modified. And it removes the
need for accurate work product tracking to avoid accumulating cruft,
which is non-trivial. We don't accurately track the pre-LTO bitcode
files for ThinLTO for example.

FIXME cleanup
@bjorn3
bjorn3 force-pushed the incr_comp_session_from_scratch branch from 1f2a9e3 to e1094a1 Compare July 23, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-incr-comp Area: Incremental compilation A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants