Cygwin compiler generates 'unknown error' which is really


#1

Hi all, newbie here.

I have encountered this problem a few times, and my solutions are of the nuclear type.

I am running the rust compiler (i.e., cargo build/run) for a simple main.rs, and after a few iterations, the compiler fails:
e3 [0:505]> cargo build
Compiling e3 v0.1.0 (file:///C:/cygwin64/home/rz/rust/projects/e3)
An unknown error occurred

To learn more, run the command again with --verbose.
e3 [0:506]> cargo build --verbose
Compiling e3 v0.1.0 (file:///C:/cygwin64/home/rz/rust/projects/e3)
Access is denied. (os error 5)
e3 [0:507]>

so it seems that someone has not let go of the file. I cannot clear this without rebooting (closing the terminal/editor does not work).

Thoughts?


#2

You can use a program such as Process Explorer to search for that file to see which process has an open handle to it, and then close the handle or kill the process. Very likely it is rustc or the linker which is frozen. The cause of this freezing can either be due to an anti virus or an overly intrusive environment such as cygwin. Does this issue occur if you use Rust from a normal cmd.exe command line?


#3

Thank you!
I did use PE which showed that the executable was still in use (how, I have no idea – zombie?). Anyway that explains why creating a new source file had no effect. I had also tried to build/run in cmd.exe and it behaved the same.
I appreciate the help (can this be marked as solved/up voted/something ala stackoverflow?)