[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Automake 1.4l released

From: Charles Wilson
Subject: Re: Automake 1.4l released
Date: Sun, 12 Aug 2001 17:26:25 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2) Gecko/20010713

Charles Wilson wrote:

I've released automake 1.4l:

This version fixes the known bugs in 1.4j.
This is the second release candidate for 1.5.
Hopefully we'll be releasing 1.5 very soon.

1.4l on cygwin-1.3.2:

only fails lex3, pr9, and pr87 (same as other versions; e.g. no new regressions). However, they all seem to be caused by errors of this type:

cp: preserving times for `....': Permission denied.

I don't think you can "preserve times" under cygwin (because the underlying windows filesystem won't let you "lie" about the time.)

Actually, a little more testing shows that the problem is merely that cygwin treats files with perms "-r--r--r--" more 'respectfully'. It seems that the errors happen during the 'make dist' part of the test (specifically, the distdir: rule).

First, I present empirical results, then some file system background, and then a specific recommendation.


for lex3.test:
while the test was running, I manually cd'ed to testSubDir/am_lex_bug-0.1.1, and did a 'chmod -R +w *'.

--> The test then PASSED.

For pr9.test, I did the same to testSubDir/pr9-0 and the test PASSED
For pr87.test, I did it to testSubDir/build/test_am-1.0 and the test PASSED.

Strangely, in the Makefiles generated during these tests, on many occassions write permission is explicitly removed for all users. I believe that should be changed from 'chmod -R a-w' to 'chmod -R go-w'. More info below.


On linux, the following works with no errors:
$ touch foo
$ ls -l foo
-rw-r--r-- 1 cwilson cwilson 0 Aug 12 15:44 foo
$ chmod a-w foo
$ ls -l foo
-r--r--r--    1 cwilson  cwilson         0 Aug 12 15:44 foo

Now, I shouldn't be able to modify the file. Wait one minute, and then:

$ touch foo
$ ls -l foo

-r--r--r-- 1 cwilson cwilson 0 Aug 12 15:45 foo

Notice that the file access time changed. This is works on linux (perhaps because the file metadata is treated as a property of the directory, not the file itself?) However, on cygwin, the preceeding experiment fails:

$ touch foo
-rw-rw-r-- 1 cwilson cwilson 0 Aug 12 15:49 foo
$ chmod a-w foo
-r--r--r-- 1 cwilson cwilson 0 Aug 12 15:49 foo
$ touch foo
touch: creating `foo': Permission denied


Now, in the Makefile(.in) generated in this test, I see:

distdir: $(DISTFILES)
        -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
        mkdir $(distdir)
        (lots of stuff, but significantly:)
        cp -pR $$d/$$file $(distdir)
        cp -p $$d/$$file $(distdir)/$$file

However, remember that the files/directories in $$d/$$file have previously been subjected to a 'chmod -R a-w' (as part of the distcheck:) so their permissions are -r--r--r--. The 'cp -p' command performs the copy in a two step process: first, the file is copied, permissions and all. So, we have a new copy of the file which is ALSO -r--r--r--, but with the wrong timestamp. Then, cp tries to preserve the time (e.g. CHANGE the timestamp of the new copy so that it matches the old original). This is allowed on linux, but NOT on windows/NTFS/cygwin, when perms = -r--r--r--.

That's why I think that ALL of the 'chmod -R a-w' commands that are generated by automake in the's should be changed to 'chmod -R go-w' instead. As it happens, this only occurs in lib/am/ (see attached patch). With this patch, automake-1.4l now passes lex3, pr9, and pr87. Actually, automake-1.4l+this_patch passes ALL tests on cygwin.

Is there any ramification that I am not aware of that makes my suggested change inadvisable?

Index: lib/am/
RCS file: /cvs/automake/automake/lib/am/,v
retrieving revision 1.20
diff -u -r1.20
---  2001/07/14 20:12:52     1.20
+++  2001/08/12 20:21:20
@@ -245,11 +245,11 @@
 ## Make the new source tree read-only.  Distributions ought to work in
 ## this case.  However, make the top-level directory writable so we
 ## can make our new subdirs.
-       chmod -R a-w $(distdir); chmod a+w $(distdir)
+       chmod -R go-w $(distdir); chmod a+w $(distdir)
        mkdir $(distdir)/=build
        mkdir $(distdir)/=inst
 ## Undo the write access.
-       chmod a-w $(distdir)
+       chmod go-w $(distdir)
        dc_install_base=`CDPATH=: && cd $(distdir)/=inst && pwd` \
 ?DISTCHECK-HOOK?         && $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \
          && cd $(distdir)/=build \

reply via email to

[Prev in Thread] Current Thread [Next in Thread]