Re: yaccvpath.test

2001-03-02 Thread Pavel Roskin

Hello, Alexandre!

>  Pavel> It's not Perl. It's a timestamp quantization.
>
> Oops, I should have read this mail before posting my own patch...

I'm applying my patch with few other changes. It appears that we have more
than one problem - one of them is that the old file is distributed and
another one it that "make distcheck" detects the problem quite late - when
it runs "make distclean".

I understand that your test case was to demonstrate the first problem. But
then "make distcheck" is irrelevant - the problem can be detected already
after "make distdir" - we don't even need gzip for that!

If you want to add a test for "make distcheck" you are welcome to.
However, please comment your test next time, otherwise it takes too much
time to understand what you meant to test if something goes wrong.

And also please make some "unit testing" of your tests. For example,
YACC=bison had no chances to work even when configuring in the source
tree, since bison outputs files with different names.

Regards,
Pavel Roskin


--- ChangeLog
+++ ChangeLog
@@ -1,3 +1,12 @@
+2001-02-27  Pavel Roskin  <[EMAIL PROTECTED]>
+
+   * tests/yaccvpath.test: Add a delay to make parse.c really out
+   of date. Detect the problem earlier, after `make distdir'. Drop
+   dependency on flex. Always use the `-y' flag for bison. Comment
+   changes.
+
+   * tests/Makefile.am: Add yaccvpath.test to XFAIL_TESTS.
+
 2001-03-02  Jens Krüger <[EMAIL PROTECTED]>

* depend2.am (?!GENERIC??LIBTOOL?%LTOBJ%): Add `%' to fix typo.
--- tests/Makefile.am
+++ tests/Makefile.am
@@ -2,7 +2,7 @@

 AUTOMAKE_OPTIONS = gnits

-XFAIL_TESTS =
+XFAIL_TESTS = yaccvpath.test
 TESTS =\
 acinclude.test \
 aclocal.test \
--- tests/yaccvpath.test
+++ tests/yaccvpath.test
@@ -1,12 +1,19 @@
 #! /bin/sh

-# This attempts to `make distcheck' from a separate directory
-# (i.e. builddir!=srcdir).  Before doing `make distcheck' a parser
-# definition is updated in the srcdir in order to check whether the
-# archived perser is up-to-date or not.
+# This test checks that dependent files are updated before including
+# in the distribution. `parse.c' depends on `parce.y'. The later is
+# updated so that `parse.c' should be rebuild. Then we are running
+# `make' and `make distdir' and check whether the version of `parse.c'
+# to be distributed is up to date.

 . $srcdir/defs || exit 1

+# Fail gracefully if no autoconf.
+$needs_autoconf
+# Likewise for some other tools.
+(gcc -v) > /dev/null 2>&1 || exit 77
+(bison -V) > /dev/null 2>&1 || exit 77
+
 cat > configure.in << 'END'
 AC_INIT
 AC_CONFIG_AUX_DIR([.])
@@ -19,10 +26,11 @@
 END

 cat > Makefile.am << 'END'
-bin_PROGRAMS= foo
-foo_SOURCES= parse.y foo.c
+bin_PROGRAMS = foo
+foo_SOURCES = parse.y foo.c
 END

+# Original parser, with `foobar'
 cat > parse.y << 'END'
 %{
 int yylex () {return 0;}
@@ -36,16 +44,8 @@
 int main () { return 0; }
 END

-# Fail gracefully if no autoconf.
-$needs_autoconf
-# Likewise for some other tools.
-(gcc -v) > /dev/null 2>&1 || exit 77
-(flex -V) > /dev/null 2>&1 || exit 77
-(bison -V) > /dev/null 2>&1 || exit 77
-
-LEX=flex
-export LEX
-YACC=bison
+# We are not checking Autoconf, so we pick $YACC for it.
+YACC="bison -y"
 export YACC

 # Remove some files installed by defs.
@@ -58,15 +58,27 @@
 $AUTOCONF
 $AUTOMAKE -a

-bison -y parse.y
+$YACC parse.y
 mv y.tab.c parse.c

-cat >> parse.y << 'END'
-fubar : 'f' foobar {};
-END
-
 mkdir sub
 cd sub
 ../configure
+
+# A delay is needed to make sure that the new parse.y is indeed newer
+# than parse.c, i.e. the they don't have the same timestamp.
+sleep 2
+
+# New parser, with `fubar'
+cat > parse.y << 'END'
+%{
+int yylex () {return 0;}
+void yyerror (char *s) {}
+%}
+%%
+fubar : 'f' 'o' 'o' 'b' 'a' 'r' {};
+END
+
 $MAKE
-$MAKE distcheck
+$MAKE distdir
+grep fubar foo-0.1/parse.c






Re: [patch 1/1 v2] support AC_SUBST'able automake rules

2001-03-02 Thread Lars J. Aas

Closing in on the one-month anniversary for this one...

  Lars J

On Sun, Feb 11, 2001 at 04:25:06PM +0100, Lars J. Aas wrote:
: On Sat, Feb 10, 2001 at 12:12:40PM -0700, Tom Tromey wrote:
: : > "Lars" == Lars J Aas <[EMAIL PROTECTED]> writes:
: : Lars> 2001-02-09  Lars J. Aas  <[EMAIL PROTECTED]>
: : Lars>   * automake.in ($MACRO_PATTERN): Include '@' in name regex.
: : Lars>   (&canonicalize): New. Includes '@' in canonical range.
: : Lars>   (&check_canonical_spelling, &handle_programs, &handle_libraries,
: : Lars>   &handle_ltlibraries, &handle_techinfo): Use &canonicalize.
: : 
: : Thanks, I checked this in.
: : 
: : Could you write a documentation patch describing this change?
: 
: How's this?
: 
: 2001-02-11  Lars J. Aas  <[EMAIL PROTECTED]>
: 
:   * ChangeLog: Email address header formatting fixes.
:   * NEWS: Document not canonicalizing strudels (@) anymore.
:   * automake.texi (Canonicalizing Automake macros): Same.
: 
: Index: ChangeLog
: ===
: RCS file: /cvs/automake/automake/ChangeLog,v
: retrieving revision 1.1017
: diff -u -r1.1017 ChangeLog
: --- ChangeLog 2001/02/10 19:50:18 1.1017
: +++ ChangeLog 2001/02/11 15:19:11
: @@ -66,7 +66,7 @@
:   * tests/pr87.test: Added check for blank line after `.c.o' rule.
:   Report from Lars J. Aas.
:  
: -2001-02-07  Lars J. Aas <[EMAIL PROTECTED]>
: +2001-02-07  Lars J. Aas  <[EMAIL PROTECTED]>
:  
:   * lisp.am (install-@DIR@LISP): Removed extra space.
:   * header.am (install-@DIR@HEADERS): Removed extra space.
: @@ -204,7 +204,7 @@
:   * automake.in (handle_dist_worker): Remove a line that is now
:   in distdir.am.
:  
: -2001-02-04  Kevin Ryde <[EMAIL PROTECTED]>
: +2001-02-04  Kevin Ryde  <[EMAIL PROTECTED]>
:  
:   * automake.in (handle_configure): Call config.status with empty
:   CONFIG_LINKS and CONFIG_COMMANDS when regenerating a file.
: @@ -251,7 +251,7 @@
:   * automake.in (handle_dependencies): Switched the DEP_FILES
:   definition to be conditional on @AMDEP@.
:  
: -2001-02-03  Ville Laurikari <[EMAIL PROTECTED]>
: +2001-02-03  Ville Laurikari  <[EMAIL PROTECTED]>
:  
:   * depcomp (aix): New side-effect dependency tracking mode, for
:   the C for AIX compiler.
: @@ -278,7 +278,7 @@
:   (handle_dist_worker): Use global dist_dirs.
:   (handle_configure): Set dist_dirs entries at toplevel.
:  
: -2001-02-02  Gordon Sadler <[EMAIL PROTECTED]>
: +2001-02-02  Gordon Sadler  <[EMAIL PROTECTED]>
:  
:   * automake.texi (Java Support): Added index, @section.
:  
: @@ -517,7 +517,7 @@
:   or AC_SUBSTs.
:   (add_file): Likewise.
:  
: -2001-01-13  Kevin Ryde <[EMAIL PROTECTED]>
: +2001-01-13  Kevin Ryde  <[EMAIL PROTECTED]>
:  
:   * automake.in (handle_ltlibraries): Omit -rpath from
:   check_LTLIBRARIES, as per noinst_LTLIBRARIES.
: @@ -569,12 +569,12 @@
:   * automake.in (libtoolize_files): Removed ltconfig.
:   (initialize_global_constants): Added ltconfig to common_files.
:  
: -2000-12-21  Kevin Ryde <[EMAIL PROTECTED]>
: +2000-12-21  Kevin Ryde  <[EMAIL PROTECTED]>
:  
:   * automake.in (handle_footer): Generate .SUFFIXES target when user
:   defines suffixes but automake does not.
:  
: -2000-12-20  Marc Espie <[EMAIL PROTECTED]>
: +2000-12-20  Marc Espie  <[EMAIL PROTECTED]>
:  
:   * automake.in (handle_texinfo): Make path of $vtexi explicit in
:   dependency.
: @@ -668,7 +668,7 @@
:   * aclocal.in (write_aclocal): Set up aclocal.m4 header with
:   normal comments (#) instead of m4 dnl-type comments.
:  
: -2000-10-17  Alex Hornby <[EMAIL PROTECTED]>
: +2000-10-17  Alex Hornby  <[EMAIL PROTECTED]>
:  
:   * depcomp: Altered sed clause to strip of inclusion depth
:   numbers generated by cpp. Also output in gcc style.
: @@ -768,7 +768,7 @@
:   configure variables that don't satisfy the other constraints.
:   Fixes PR automake/68.
:  
: -2000-04-14  Victor V. Vengerov <[EMAIL PROTECTED]>
: +2000-04-14  Victor V. Vengerov  <[EMAIL PROTECTED]>
:  
:   Fix for PR automake/67.
:   * automake.in (handle_multilib): remove .am suffix in fragment
: @@ -835,7 +835,7 @@
:   * lisp.am (uninstall-@DIR@LISP): Prefix file with $(DESTDIR).
:   From Bruno Haible.
:  
: -2000-07-13  Kevin Ryde <[EMAIL PROTECTED]>
: +2000-07-13  Kevin Ryde  <[EMAIL PROTECTED]>
:  
:   * automake.in (am_install_var): Apply the $(EXEEXT) hack to
:   EXTRA_PROGRAMS as well as other _PROGRAMS.
: Index: NEWS
: ===
: RCS file: /cvs/automake/automake/NEWS,v
: retrieving revision 1.139
: diff -u -r1.139 NEWS
: --- NEWS  2001/01/16 11:15:20 1.139
: +++ NEWS  2001/02/11 15:19:11
: @@ -1,6 +1,7 @@
:  New in 1.4c:
:  * Support for `configure.ac'.
: -
: +* Allows '@' AC_SUBSTs in macro names.
: +
:  New in 1.4b:
:  * Faster AM_INIT_AUTOMAKE (requires update of `missin

Re: yaccvpath.test

2001-03-02 Thread Derek R. Price

Alexandre Oliva wrote:

> On Feb 28, 2001, "Derek R. Price" <[EMAIL PROTECTED]> wrote:
>
> > CVS uses a single second sleep to guarentee timestamps change cross-platform
>
> IIRC, FAT filesystems can only store even second numbers.  So, in
> order to be 100% safe, you'd need to sleep for 2 seconds, but a
> 1-second sleep should be ok on at least 50% of the cases.

I don't think so.  The CVS code does the following, regardless of the platform:

while (last_register_time && time ((time_t *) NULL) == last_register_time)
{
* sleep 20ms *
}

Where last_register_time is the last time a file was written (recorded just after
writing).

In other words, this code simply waits until the next second.  I don't usually
work on the Windows specific code myself, but everything here except the sleep
function is common code, and unless the clock and not just the file system has a
2 second granularity, then a race condition would have been created.  I haven't
seen the bug reports and I know for a fact that the Windows sleep function was
just recently rewritten to allow millisecond granularity, so the rest is
doubtful.

Derek

--
Derek Price  CVS Solutions Architect ( http://CVSHome.org )
mailto:[EMAIL PROTECTED] OpenAvenue ( http://OpenAvenue.com )
--
I will not celebrate meaningless milestones.
I will not celebrate meaningless milestones.
I will not celebrate meaningless milestones...

  - Bart Simpson on chalkboard, _The Simpsons_