Closed
Description
When building the compiler on Windows with incremental turned on I often get the following warning:
warning: Error finalizing incremental compilation session directory `\\?\C:\Users\ryanl\Code\rust\build\x86_64-pc-windows-msvc\stage0-rustc\x86_64-pc-windows-msvc\release\incremental\rustc_incremental-3eitboxu59x4j\s-g08srunmh1-1cw7crv-working`: Access is denied. (os error 5)
Compilation continues after this and leads to a successful build.
A similar issue has been reported before (#48700), but that is a panic during compilation of a normal crate.
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
ChrisDenton commentedon Jul 7, 2021
Seems to be an
fs::rename
operation failing? The likely cause would be a file handle that is still open.Spidy104 commentedon Sep 7, 2021
when will this bug be removed, and will this bug, cause major problems, for creating various stuff, cuz I am new to rust, and I continuously get this error message!
strottos commentedon Sep 12, 2021
I get this error a lot having just moved to a Windows PC. Whilst everything clearly compiles and runs fine it's very frustrating and can cause real problems. For example, I ran
cargo test
under the latest tokio and tests fail as such:Elsewhere I've seen it reported as a VS Code or WSL problem and seen fixes like this proposed: #62031 (comment)
However I'm working entirely without VS Code or WSL and just running
cargo build
or whatever through Powershell in Windows Terminal.ZimCodes commentedon Sep 26, 2021
I have also received this warning as well. The solution for me was to run
cargo clean
and then runcargo check
(as I wanted to check for more warnings/errors). From here everything was all green.joelswenddal commentedon Dec 1, 2021
This resolved it for me as well, moving to wsl 1 on Windows PC. Thanks!
michaelwoerister commentedon Mar 16, 2022
I'll try to take a look at this.
incr. comp.: Let compiler retry finalizing session directory a few ti…
Auto merge of rust-lang#95304 - michaelwoerister:retry-finalize-sessi…
michaelwoerister commentedon Feb 2, 2023
I haven't seen any reports about this after #95304 was merged. Closing.
Rollup merge of rust-lang#107595 - michaelwoerister:retry_proc_macro_…
Moth-Tolias commentedon Jul 15, 2023
just encountered this on windows 8. the clean/check thing seems to have worked though.
KOEGlike commentedon Jan 25, 2025
just got this on win11 with vscode
brogdonm commentedon Apr 24, 2025
I recently enabled log paths (using
gpedit.msc
to enableComputer --> Administrative Templates --> System --> Filesystem --> "Enable Win32 Long Paths"
) in Windows 11 and started getting this error afterwards.I can typically do a
cargo clean
andcargo build
and it will be fine for a little while and then it starts again.