Skip to content

Replace hard linked metadata.rmeta with a copy when finalizing the incremental compilation session dir fails - #162366

Open
TheHighestBit wants to merge 1 commit into
rust-lang:mainfrom
TheHighestBit:copy-on-finalize-error
Open

Replace hard linked metadata.rmeta with a copy when finalizing the incremental compilation session dir fails#162366
TheHighestBit wants to merge 1 commit into
rust-lang:mainfrom
TheHighestBit:copy-on-finalize-error

Conversation

@TheHighestBit

@TheHighestBit TheHighestBit commented Sep 6, 2026

Copy link
Copy Markdown

Fixes #151181.

Since 1.90.0, on ReFS (Windows Dev Drive) volumes finalizing the incremental compilation session directory would fail with Access is denied. (os error 5). The issue was caused by #114669, which meant that metadata.rmeta inside the session dir was a hard link to a file that was potentially being used by several other processes and ReFS seemingly refuses to rename such directories. As a fallback, we try to replace the hard linked metadata file with a copy instead, so that the rename can succeed.

I don't think adding a test for this is possible due to the lack of a ReFS runner but I added a unit test for the replace_hard_link_with_copy helper.

r? @bjorn3

@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 Sep 6, 2026
@rustbot

rustbot commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project has assigned @bjorn3 (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks.

Please see the contribution instructions and our LLM policy for more information.

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.

Regression: "error finalizing incremental compilation session directory. Access is denied. (os error 5)" when building on Windows

3 participants