Skip to content

Failed to garbage collect finalized incremental compilation session directory #79532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Fancyflame opened this issue Nov 29, 2020 · 9 comments
Labels
A-incr-comp Area: Incremental compilation T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Fancyflame
Copy link

Fancyflame commented Nov 29, 2020

Whenever and whatever I compile the warning is printed.
This is the output:
IMG_20201129_164846
I have tried deleting the target directory but it didn't work. Besides, I posted this problem to Rust Forum but until now no one could help. Although it seems not harmful, but it indeed exists, how can I resolve this?

@jyn514 jyn514 added the A-incr-comp Area: Incremental compilation label Nov 29, 2020
@reza-ghazi
Copy link

Same issue in Windows 10 pro.

Rust version: 1.56.1

warning: Failed to garbage collect finalized incremental compilation session directory `\\?\G:\my_works\my_applications\rust\hello_world\target\debug\
incremental\hello_world-1euetnunot3zj\s-g429f96qad-723v80-3fauq1c36gmxs`: Access is denied. (os error 5)

@Fancyflame
Copy link
Author

@reza-ghazi I think it should not the same. My error is No such file or directory while yours is Access is denied.
Also try to remove target to see whether could help.

@51901c10
Copy link

Can confirm that removing the target directory solves the issue Failed to garbage collect finalized incremental compilation session directory ... Access is denied. (os error 5)

@reza-ghazi
Copy link

@Gunt-r
As @Fancyflame mentioned, it was not the same issue, but the problem was the accessing file in another directory except the user profile in Windows. I copied my project to a folder in my user profile, and it works well. I didn't delete any folder, and now after I copied the whole project to the desired folder in my user profile, it's compiling well without warning.

In Linux, because everybody works on their /home directory, these types of Errors and warnings usually do not rise, but there is a different story in `Windows'. I need to work on both platforms, and this kind of issue bothers me.

It seems the Rust installation should consider if a user wants to work in a different directory. The compiler does not have access to the other drives or folders. Of course, as far as I understood.

Anyhow, is there any way to work with other directories in other drives, specifically in Windows? I couldn't find the answer yet.

Thanks,

@Fancyflame
Copy link
Author

Fancyflame commented Nov 17, 2021

@reza-ghazi Hmm, I don't think the problem you mentioned was purely a permission or dirver access problem, you know, everything Rust compiler compiled will be put into the target directory, including things about incremental compilation. So, if you could compile successfully without errors (not warnings) generated, it should not that problem. Rather, it may be a file system problem (Something like file lock).

But sorry I don't know how to resolve your problem because I haven't ever encountered the errors you mentioned. Rust worked perfectly well in my two win10 computers.

I did an experiment, I created a binary project in D driver, while the entire Rust was installed in C driver, then compile that project. It worked well without any errors or warnings were printed. Is your project written in pure Rust, or it contains C or other language?

Where I encountered the error which made me opene this issue is my Android device with a tiny Ubuntu installed in Termux. (It seemed not a environment that normal person would use) 😂

@Soskretkov
Copy link

The problem may be caused by trying to synchronize folders in the cloud.

@Fancyflame
Copy link
Author

@Soskretkov At least I think it's not for me. It doesn't make a sense for the system trying to backup regular files in a regular application automatically in Android.

@CosmicSpaceGoose
Copy link

Hi,
I'm hitting the same warning on Windows7 + MinGW. It had appeared after I moved $CARGO_HOME and $RUSTUP_HOME to custom location. WA with deleting target folder helps until project is rebuilted again.
Toolchain rustc 1.64.0-nightly (06754d885 2022-07-08)

@crusader-mike
Copy link

crusader-mike commented Jul 29, 2022

I get a lot of these (but only during incremental compilation) on Win7:

warning: Failed to garbage collect finalized incremental compilation session directory `\\?\D:\Work\<skip>\target\debug\incre
mental\<skip>-h0ku3qc8pde\s-gc3wk9dfjy-13pdd9o-11auxo9w4xmty`: The directory is not empty. (os error 145)
$ cargo --version
cargo 1.64.0-nightly (8827baaa7 2022-07-14)

Edit: I found the root cause. See #99934

@Noratrieb Noratrieb added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 5, 2023
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 T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

8 participants