GNU bug report logs - #10470
MSYS: race in directory access?

Previous Next

Package: automake;

Reported by: Peter Rosin <peda <at> lysator.liu.se>

Date: Mon, 9 Jan 2012 23:09:01 UTC

Severity: minor

Tags: patch

Done: Stefano Lattarini <stefano.lattarini <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Peter Rosin <peda <at> lysator.liu.se>
To: 10470 <at> debbugs.gnu.org
Subject: bug#10470: MSYS: race in directory access?
Date: Tue, 10 Jan 2012 00:15:55 +0100
Peter Rosin skrev 2012-01-10 00:07:
> Hi!
> 
> distcheck-configure-flags-am.test fails on MSYS.  I think the cause is
> that some process lingers with CWD in the _build directory which some
> other process tries to remove.  On MSYS, it's not possible to remove a
> directory that is "in use" like that.
> 
> Ugly patch coming up shortly.

As promised.

Cheers,
Peter


From 8ba67ab9885c8987d7a09ad650bcda69675b8285 Mon Sep 17 00:00:00 2001
From: Peter Rosin <peda <at> lysator.liu.se>
Date: Tue, 10 Jan 2012 00:14:08 +0100
Subject: [PATCH] dist: try to avoid race on MSYS when removing the distdir

Fixes automake bug#10470.

lib/am/distdir.am (am__remove_distdir): Add a short sleep to make old
processes release the directory before an attempt to remove it is made.
On MSYS, it is not possible to remove a directory that is "in use".
---
 lib/am/distdir.am |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index d8c1a89..e56d33b 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -22,10 +22,13 @@ if %?TOPDIR_P%
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
 
+## On MSYS (1.0.17) it is not possible to remove a directory that is
+## in use, hence the sleep call, which gives processes time to exit
+## and "release" the directory before it is removed.
 am__remove_distdir = \
   { test ! -d "$(distdir)" \
     || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
-         && rm -fr "$(distdir)"; }; }
+         && sleep 1 && rm -fr "$(distdir)"; }; }
 am__post_remove_distdir = $(am__remove_distdir)
 endif %?TOPDIR_P%
 
-- 
1.7.5.1






This bug report was last modified 13 years and 135 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.