holmgr / cargo-sweep

A cargo subcommand for cleaning up unused build files generated by Cargo
MIT License
694 stars 31 forks source link

After cargo sweep, I can't build anymore #8

Closed Boscop closed 5 years ago

Boscop commented 5 years ago

I ran cargo sweep -t 5 to clean up my target folder but now the build fails with:

 = note: LINK : fatal error LNK1201: error writing to program database 'D:\projects\myproject\target\debug\deps\myproject-fc1c31bb36e24a5b.pdb'; check for insufficient disk space, invalid path, or insufficient privilege

I'm on Windows 8.1 btw.

The pdb file exists and is 87 MB large, the other files with that hash in the name are 218 files named myproject-fc1c31bb36e24a5b.<some-hash>.rcgu.o and 1 file named myproject-fc1c31bb36e24a5b.d.

I have 165 GB free space on that disk and it worked before I did cargo sweep.

How can I get it to build again without having to rebuild everything (which would take ages)?

Boscop commented 5 years ago

Ah nvm, when I tried to delete the file, it said the file is open in procexp64.exe (Process Explorer), apparently because I opened myproject.exe's properties in it when it was running. After closing Process Explorer, I could build again.