Skip to main content

"make clean" fails (Cygwin / MSYS)

5 replies [Last post]
greg80303
Offline
Joined: 2008-07-03

This seems like just about the simplest step in the build, but I'm seeing a strange problem :)

----------------
[exec] rm -rf ../../build/mpe-x86-cygmingw/./obj ../../build/mpe-x86-cygmingw/./bin ../../build/mpe-x86-cygmingw/./generated/javavm/runtime ../../build/mpe-x86-cygmingw/./generated/javavm/runtime/opcodeconsts ../../build/mpe-x86-cygmingw/./generated/javavm/include ../../build/mpe-x86-cygmingw/./generated/classes ../../build/mpe-x86-cygmingw/./generated/classes/sun/misc ../../build/mpe-x86-cygmingw/./generated/jni ../../build/mpe-x86-cygmingw/./generated/cni ../../build/mpe-x86-cygmingw/./generated/offsets ../../build/mpe-x86-cygmingw/./generated/flags ../../build/mpe-x86-cygmingw/./btclasses ../../build/mpe-x86-cygmingw/./testclasses ../../build/mpe-x86-cygmingw/./democlasses ../../build/mpe-x86-cygmingw/./lib ../../build/mpe-x86-cygmingw/./lib/security ../../build/mpe-x86-cygmingw/./classes.tools ../../build/mpe-x86-cygmingw/./basis_classes ../../build/mpe-x86-cygmingw/./generated/classes/java/util ../../build/mpe-x86-cygmingw/./classes.jcc ../../build/mpe-x86-cygmingw/./bin/libcvm_g.dll
[exec] rm: cannot remove `../../build/mpe-x86-cygmingw/./generated/classes/sun/misc': Permission denied
[exec] rm: cannot remove `../../build/mpe-x86-cygmingw/./generated/classes/java/util': Permission denied
[exec] make[1]: *** [clean] Error 1
-----------------

The output you see is from an ant-based build, but running "make clean" by itself in a shell produces the same result. However, if I cut-paste the rm -rf command shown above directly into my shell and execute it, it works without failure.

I am developing under Cygwin right now. I am using an updated version of make that fixes a problem with dependency generation (http://www.cmake.org/files/cygwin/make.exe). I have also tried a 3.80 version of make (http://cygwin.paracoda.com/release/make/make-3.80-1.tar.bz2).

I have seen this error when building from both MSYS and Cygwin on WindowsXP. Anyone out there use either of these as a host platform and have any info for me?

Greg

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
wmunsil
Offline
Joined: 2009-07-05

Please see http://forums.java.net/jive/thread.jspa?threadID=65879 for what seems to be a solution to this issue.

cjplummer
Offline
Joined: 2006-10-16

We had a very long internal email thread on this problem earlier this year (maybe longer). We had thought it was a cygwin bug, but since you see it on MSYS, possibly it is an XP filesytem bug. Traces of file system calls were done, and it was determined that one or more of the subdirs in the generated directory that were created during the build were still open when the rm was finally executed. I actually have a fix somewhere that reworked how the clean rule is handled so all the subdirs are deleted before we attempt to delete the generated directory. This seemed to fix the problem. I just never got around to testing it enough to get it reviewed and committed.

Chris

greg80303
Offline
Joined: 2008-07-03

OK. Thank you all for your responses.

Several months ago, I also looked into re-working the Makefiles to ensure that the top-level "classes" directory was removed last, but I was a little intimidated by the large set of makefiles. I will be working with phoneME system much more in the future, so there is a chance I will look into the solution once again.

Greg

billp
Offline
Joined: 2006-09-19

I attempted to debug this problem last year and what I remember was that the 'make' command was holding some handles to some of the directories being deleted by 'rm'. This caused 'rm' to fail the deletion. Never really had time to get to the bottom of it.

bill

Hinkmond Wong

phonemeadvanced@mobileandembedded.org wrote:
> I attempted to debug this problem last year and what I remember was that the 'make' command was holding some handles to some of the directories being deleted by 'rm'. This caused 'rm' to fail the deletion. Never really had time to get to the bottom of it.
>
> bill
>

Bill is right. Unfortunately that's a little current "feature" of our
Cygwin Windows-based builds. For now, please just manually use "rm -f"
to clean up after your "make clean" by removing anything that's left
over that are not the GNUmakefile or *.mk files.

Hinkmond

---------------------------------------------------------------------
To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: advanced-help@phoneme.dev.java.net