Skip to main content

Patch for "make clean" failure on Cygwin: "cannot duplicate fd 31 to fd 0"

No replies
wmunsil
Offline
Joined: 2009-07-05
Points: 0

I've read sources on the web that say things like "Use a CYGWIN shell when you start the /usr/bin/make of CYGWIN", or else the above message might result. I do that, and I've still seen the message. I've tracked it down to a "recursive" invocation of $(MAKE) that seems to be unnecessary, because it has already been done. Removing that invocation seems to fix this issue; it is as if under Cygwin $(MAKE) can only "recurse" so far.

This patch to rules.mk (rev 18407) in [phoneme] / components / cdc / trunk / build / share implements this suggestion. I'd like to know if anyone sees any problems with it.

It introduces a parameter CVM_TOOLS_BUILT so that the caller can tell the callee that a call with CVM_TOOLS_BUILD=true has already been made.

I don't think the formatting of the patch will survive posting, but you should be able to get the gist of it.

--- unpatched/rules.mk 2009-08-20 10:12:11.625000000 -0600
+++ patched.2/rules.mk 2009-08-20 11:02:56.296875000 -0600
@@ -1014,8 +1014,10 @@
#####################################

# Rerun make so tool makefiles (jcov, hprof, and jdwp) are included
+ifneq ($(CVM_TOOLS_BUILT), true)
clean::
$(MAKE) CVM_TOOLS_BUILD=true tool-clean
+endif

ifeq ($(CVM_REBUILD), true)
clean::
@@ -1039,7 +1041,7 @@
rm -rf $(CVM_RESOURCES_DIR)
else
clean::
- $(MAKE) CVM_REBUILD=true clean
+ $(MAKE) CVM_REBUILD=true CVM_TOOLS_BUILT=true clean
endif

#####################################