Skip to content

Small cleanups to the incr comp session code#159000

Open
bjorn3 wants to merge 2 commits into
rust-lang:mainfrom
bjorn3:simplify_incr_comp_session
Open

Small cleanups to the incr comp session code#159000
bjorn3 wants to merge 2 commits into
rust-lang:mainfrom
bjorn3:simplify_incr_comp_session

Conversation

@bjorn3

@bjorn3 bjorn3 commented Jul 9, 2026

Copy link
Copy Markdown
Member

Found while working on rust-lang/compiler-team#908. I'm working on some more significant changes, but will leave those to a followup PR.

bjorn3 added 2 commits July 8, 2026 19:45
Previously we would still try to rename the incr comp session dir after
deleting it.
In both cases the incr comp session dir should no longer be accessed.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 9, 2026
@rustbot

rustbot commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

r? @mejrs

rustbot has assigned @mejrs.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 75 candidates
  • Random selection from 18 candidates

sess.finalize_incr_comp_session();
let _ = garbage_collect_session_directories(sess, &incr_comp_session_dir);
return;
}

@bjorn3 bjorn3 Jul 9, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively it may be possible to remove this entire branch. It looks like there is an abort_if_errors() before finalize_session_directory() in rustc_interface with no errors emitted in between. Previously this code path was broken already.

View changes since the review

// This unlocks the directory
sess.finalize_incr_comp_session();

let _ = garbage_collect_session_directories(sess, &new_path);

@bjorn3 bjorn3 Jul 9, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will now GC the incr comp session dir if the rename failed.

View changes since the review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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