Fix remake rule-induced test failures with HP-UX make.

2011-01-15 Thread Ralf Wildenhues
Quoting parts of:
http://autobuild.josefsson.org/automake/log-201101150749395803000.txt

| FAIL: colon6.test (exit: 1)
| ===
| 
| 
/tmp/am/build-hppa2.0w-hp-hpux11.23/tests:/tmp/local/hppa2.0w-hp-hpux11.23/bin:/tmp/bin:/opt/aCC/bin:/opt/ansic/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/bin/X11:/usr/ccs/bin:/usr/contrib/bin/X11:/usr/vue/bin:/opt/imake/bin
| + set -e
| + pwd
| /tmp/am/build-hppa2.0w-hp-hpux11.23/tests/colon6.dir
| + cat
| + 1 configure.in 0
| AC_INIT([colon6], [1.0])
| AM_INIT_AUTOMAKE
| # With this, version.good should depend from version.gin, while
| # Makefile should not depend from either of them.
| AC_CONFIG_FILES([demo/Makefile demo/version.good:demo/version.gin])
| AC_OUTPUT
| + mkdir demo
| + :
| + 1 demo/version.gin
| + :
| + 1 demo/Makefile.am
| + aclocal-1.11a -Werror
| + automake-1.11a --foreign -Werror -Wall
| + /bin/grep -E Makefile:.*(demo|version) demo/Makefile.in
| + grep version\.good:.*version\.gin demo/Makefile.in
| version.good: $(top_builddir)/config.status $(srcdir)/version.gin
| + autoconf
| + :
| + srcdir=..
| + mkdir build
| + cd build
| + ../configure
| checking for a BSD-compatible install... ../install-sh -c
| checking whether build environment is sane... yes
| checking for a thread-safe mkdir -p... ../install-sh -c -d
| checking for gawk... no
| checking for mawk... no
| checking for nawk... no
| checking for awk... awk
| checking whether make sets $(MAKE)... yes
| checking that generated files are newer than configure... done
| configure: creating ./config.status
| config.status: creating demo/Makefile
| config.status: creating demo/version.good
| + test -f demo/version.good
| + test ! -s demo/version.good
| + cd demo
| + sleep 2
| + echo Rebuilt (srcdir=..)
| + 1 ../../demo/version.gin
| + make version.good
| No suffix list.
| cd ..  /bin/sh ./config.status demo/version.good
| config.status: creating demo/version.good
| + /bin/grep -F Rebuilt (srcdir=..) version.good
| Rebuilt (srcdir=..)
| + rm -f version.good
| + make Makefile
| No suffix list.
| Make: Don't know how to make am--refresh.  Stop.
| *** Error exit code 1
| 
| Stop.
| + exit_status=1
| + set +e
| + cd /tmp/am/build-hppa2.0w-hp-hpux11.23/tests
| + test 0 != 0
| + echo colon6: exit 1
| colon6: exit 1
| + exit 1

[...]

| 
/tmp/am/build-hppa2.0w-hp-hpux11.23/tests:/tmp/local/hppa2.0w-hp-hpux11.23/bin:/tmp/bin:/opt/aCC/bin:/opt/ansic/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/bin/X11:/usr/ccs/bin:/usr/contrib/bin/X11:/usr/vue/bin:/opt/imake/bin
| + set -e
| + pwd
| /tmp/am/build-hppa2.0w-hp-hpux11.23/tests/remake1a.dir
| + fingerprint==/FiNgErPrInT/=
| + cat
| + 1 configure.in 0
| AC_INIT([remake1a], [1.0])
| AM_INIT_AUTOMAKE
| AC_CONFIG_FILES([sub/Makefile])
| AC_OUTPUT
| + mkdir sub
| + :
| + 1 sub/Makefile.am
| + aclocal-1.11a -Werror
| + autoconf
| + automake-1.11a --foreign -Werror -Wall
| + ./configure
| checking for a BSD-compatible install... ./install-sh -c
| checking whether build environment is sane... yes
| checking for a thread-safe mkdir -p... ./install-sh -c -d
| checking for gawk... no
| checking for mawk... no
| checking for nawk... no
| checking for awk... awk
| checking whether make sets $(MAKE)... yes
| checking that generated files are newer than configure... done
| configure: creating ./config.status
| config.status: creating sub/Makefile
| + sleep 2
| + echo # =/FiNgErPrInT/=
| + 1 sub/Makefile.am
| + cd sub
| + make Makefile
| No suffix list.
|  cd ..  /bin/sh 
/tmp/am/build-hppa2.0w-hp-hpux11.23/tests/remake1a.dir/missing --run 
automake-1.11a --foreign sub/Makefile
| Make: Don't know how to make am--refresh.  Stop.
| *** Error exit code 1


I'm not quite sure why HP-UX make seems to trigger rebuild rules for
prerequisites that have the exact time stamps as targets (in this case,
config.status and subdir Makefile, but I also tried with a reduced
makefile), but it is not Posix conforming.  Working around it properly
would probably require sleeping inside config.status (an obvious no-go),
and in practice it should not do more harm than updating some rules more
than necessary.

How about the patch below to not let this cause spurious testsuite
failures?  If you prefer, I can split the typo fixes in a separate
patch.

Thanks,
Ralf

Fix remake rule-induced test failures with HP-UX make.

* tests/colon6.test: Update timestamp of subdir Makefile, to
ensure we do not spuriously invoke the nonexistent toplevel
am--refresh rule.  Fix comment typos.
* tests/remake1a.test: Require GNU make.

diff --git a/tests/colon6.test b/tests/colon6.test
index bf5cf2d..984f13e 100755
--- a/tests/colon6.test
+++ b/tests/colon6.test
@@ -22,8 +22,8 @@
 cat  configure.in END
 AC_INIT([$me], [1.0])
 AM_INIT_AUTOMAKE
-# With this, version.good should depend from version.gin, while
-# Makefile should not depend from either of them.
+# With this, version.good should depend on version.gin, while
+# Makefile should not depend on either of them.
 AC_CONFIG_FILES

Re: Fix remake rule-induced test failures with HP-UX make.

2011-01-15 Thread Stefano Lattarini
On Saturday 15 January 2011, Ralf Wildenhues wrote:
 Quoting parts of:
 http://autobuild.josefsson.org/automake/log-201101150749395803000.txt
 
 | FAIL: colon6.test (exit: 1)
 | ===
 | 
 | 
 /tmp/am/build-hppa2.0w-hp-hpux11.23/tests:/tmp/local/hppa2.0w-hp-hpux11.23/bin:/tmp/bin:/opt/aCC/bin:/opt/ansic/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/bin/X11:/usr/ccs/bin:/usr/contrib/bin/X11:/usr/vue/bin:/opt/imake/bin
 | + set -e
 | + pwd
 | /tmp/am/build-hppa2.0w-hp-hpux11.23/tests/colon6.dir
 | + cat
 | + 1 configure.in 0
 | AC_INIT([colon6], [1.0])
 | AM_INIT_AUTOMAKE
 | # With this, version.good should depend from version.gin, while
 | # Makefile should not depend from either of them.
 | AC_CONFIG_FILES([demo/Makefile demo/version.good:demo/version.gin])
 | AC_OUTPUT
 | + mkdir demo
 | + :
 | + 1 demo/version.gin
 | + :
 | + 1 demo/Makefile.am
 | + aclocal-1.11a -Werror
 | + automake-1.11a --foreign -Werror -Wall
 | + /bin/grep -E Makefile:.*(demo|version) demo/Makefile.in
 | + grep version\.good:.*version\.gin demo/Makefile.in
 | version.good: $(top_builddir)/config.status $(srcdir)/version.gin
 | + autoconf
 | + :
 | + srcdir=..
 | + mkdir build
 | + cd build
 | + ../configure
 | checking for a BSD-compatible install... ../install-sh -c
 | checking whether build environment is sane... yes
 | checking for a thread-safe mkdir -p... ../install-sh -c -d
 | checking for gawk... no
 | checking for mawk... no
 | checking for nawk... no
 | checking for awk... awk
 | checking whether make sets $(MAKE)... yes
 | checking that generated files are newer than configure... done
 | configure: creating ./config.status
 | config.status: creating demo/Makefile
 | config.status: creating demo/version.good
 | + test -f demo/version.good
 | + test ! -s demo/version.good
 | + cd demo
 | + sleep 2
 | + echo Rebuilt (srcdir=..)
 | + 1 ../../demo/version.gin
 | + make version.good
 | No suffix list.
 | cd ..  /bin/sh ./config.status demo/version.good
 | config.status: creating demo/version.good
 | + /bin/grep -F Rebuilt (srcdir=..) version.good
 | Rebuilt (srcdir=..)
 | + rm -f version.good
 | + make Makefile
 | No suffix list.
 | Make: Don't know how to make am--refresh.  Stop.
 | *** Error exit code 1
 | 
 | Stop.
 | + exit_status=1
 | + set +e
 | + cd /tmp/am/build-hppa2.0w-hp-hpux11.23/tests
 | + test 0 != 0
 | + echo colon6: exit 1
 | colon6: exit 1
 | + exit 1
 
 [...]
 
 | 
 /tmp/am/build-hppa2.0w-hp-hpux11.23/tests:/tmp/local/hppa2.0w-hp-hpux11.23/bin:/tmp/bin:/opt/aCC/bin:/opt/ansic/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/bin/X11:/usr/ccs/bin:/usr/contrib/bin/X11:/usr/vue/bin:/opt/imake/bin
 | + set -e
 | + pwd
 | /tmp/am/build-hppa2.0w-hp-hpux11.23/tests/remake1a.dir
 | + fingerprint==/FiNgErPrInT/=
 | + cat
 | + 1 configure.in 0
 | AC_INIT([remake1a], [1.0])
 | AM_INIT_AUTOMAKE
 | AC_CONFIG_FILES([sub/Makefile])
 | AC_OUTPUT
 | + mkdir sub
 | + :
 | + 1 sub/Makefile.am
 | + aclocal-1.11a -Werror
 | + autoconf
 | + automake-1.11a --foreign -Werror -Wall
 | + ./configure
 | checking for a BSD-compatible install... ./install-sh -c
 | checking whether build environment is sane... yes
 | checking for a thread-safe mkdir -p... ./install-sh -c -d
 | checking for gawk... no
 | checking for mawk... no
 | checking for nawk... no
 | checking for awk... awk
 | checking whether make sets $(MAKE)... yes
 | checking that generated files are newer than configure... done
 | configure: creating ./config.status
 | config.status: creating sub/Makefile
 | + sleep 2
 | + echo # =/FiNgErPrInT/=
 | + 1 sub/Makefile.am
 | + cd sub
 | + make Makefile
 | No suffix list.
 |  cd ..  /bin/sh 
 /tmp/am/build-hppa2.0w-hp-hpux11.23/tests/remake1a.dir/missing --run 
 automake-1.11a --foreign sub/Makefile
 | Make: Don't know how to make am--refresh.  Stop.
 | *** Error exit code 1
 
 
 I'm not quite sure why HP-UX make seems to trigger rebuild rules for
 prerequisites that have the exact time stamps as targets (in this case,
 config.status and subdir Makefile, but I also tried with a reduced
 makefile), but it is not Posix conforming.  Working around it properly
 would probably require sleeping inside config.status (an obvious no-go),
 and in practice it should not do more harm than updating some rules more
 than necessary.
 
 How about the patch below to not let this cause spurious testsuite
 failures?

Seems (almost) good.  Just a couple of minor nits below ...

Oh, and please remember ot apply the patch to the maint-based
temporary branch 'tests-colon-extend'.  FYI, last commit there
should be `a46eda3752054eccd208f630611fefe0308eafc1'.

 If you prefer, I can split the typo fixes in a separate patch.

Well, I usually prefer having cosmetic/typofixing changes separated
from bugfixes -- but not to the point of requiring you to rewrite
this patch ;-)

So, do whatever you deem more appropriate.

 Thanks,
 Ralf
 
 Fix remake rule-induced test failures with HP-UX make.
 
 * tests/colon6.test: Update timestamp

Re: Fix remake rule-induced test failures with HP-UX make.

2011-01-15 Thread Ralf Wildenhues
[ adding autoconf-patches ]

* Ralf Wildenhues wrote on Sat, Jan 15, 2011 at 11:31:55AM CET:
 Quoting parts of:
 http://autobuild.josefsson.org/automake/log-201101150749395803000.txt

 I'm not quite sure why HP-UX make seems to trigger rebuild rules for
 prerequisites that have the exact time stamps as targets (in this case,
 config.status and subdir Makefile, but I also tried with a reduced
 makefile), but it is not Posix conforming.  Working around it properly
 would probably require sleeping inside config.status (an obvious no-go),
 and in practice it should not do more harm than updating some rules more
 than necessary.

Found it documented in HP-UX/IA 11.31 make(1):

  If no target names are specified on the command line, make updates the
  first target in the (first) makefile that is not an inference rule.  A
  target is updated in two cases: firstly, if it depends on files that
  are newer than the target; secondly, if it depends on files that have
  same modification time as that of the target.  Missing files are
  deemed to be out-of-date.  [...]

Anybody have a support contract to report this Posix violation upstream?

OK to commit?

Thanks,
Ralf

docs: HP-UX make remakes targets with same time stamps as prereqs

* doc/autoconf.texi (Timestamps and Make): Document HP-UX 11.31
make issue with targets having the same time stamps as their
prerequisites.

Signed-off-by: Ralf Wildenhues ralf.wildenh...@gmx.de

diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 9f5494e..81664e4 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -20183,7 +20183,9 @@ Timestamps and Make
 date dest-stamp
 @end example
 
-
+Apart from timestamp resolution, there are also differences in handling
+equal timestamps.  HP-UX @command{make} updates targets if it has the
+same time stamp as one of its prerequisites, in violation of Posix rules.
 
 
 @c  Portable C and C++ Programming



Re: Fix remake rule-induced test failures with HP-UX make.

2011-01-15 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sat, Jan 15, 2011 at 01:51:54PM CET:
 On Saturday 15 January 2011, Ralf Wildenhues wrote:
  Quoting parts of:
  http://autobuild.josefsson.org/automake/log-201101150749395803000.txt
[...]
  How about the patch below to not let this cause spurious testsuite
  failures?
 
 Seems (almost) good.  Just a couple of minor nits below ...
 
 Oh, and please remember ot apply the patch to the maint-based
 temporary branch 'tests-colon-extend'.  FYI, last commit there
 should be `a46eda3752054eccd208f630611fefe0308eafc1'.

I amended tests-{colon,remake}-extend with the respective fixes, ...

  If you prefer, I can split the typo fixes in a separate patch.
 
 Well, I usually prefer having cosmetic/typofixing changes separated
 from bugfixes -- but not to the point of requiring you to rewrite
 this patch ;-)
 
 So, do whatever you deem more appropriate.

... and split out the typo patch.

  @@ -60,27 +60,31 @@ for vpath in : false; do
   
 cd demo
   
  -  # version.good should depend from version.gin
 $sleep
  +  # Avoid relying on non-existent toplevel am--refresh rule,
  +  # presumably due to spurious timestamp issues.
  +  touch Makefile
 
 The comment seems too terse to me; what about this (stolen from your
 explanation above)?
 
  # Some make implementations (e.g., HP-UX make) seems to trigger rebuild
  # rules for prerequisites that have the exact time stamps as targets (in
  # this case, config.status and subdir Makefile).
  # Since our setup here lacks a top-level Makefile, and thus the toplevel
  # am--refresh rule, the rebuild rules are doomed to fail.
  # We thus touch the Makefile to avoid triggering them.

Thanks.  While again I prefer documenting such issues in autoconf.texi,
some more verbosity might be prudent here; I went with this:

+  # HP-UX make considers targets with exact time stamps as one of their
+  # prerequisites out of date.  Ensure Makefile is newer than config.status to
+  # avoid triggering the am--refresh rule in the (here-nonexistent) toplevel
+  # Makefile.
+  touch Makefile

  --- a/tests/remake1a.test
  +++ b/tests/remake1a.test
  @@ -17,6 +17,7 @@
   # Make sure remaking rules in subdir are correctly generated.
   # See also sister grepping test `remake.test'.
   
  +required=GNUmake
   . ./defs || Exit 1
   
   fingerprint='=/FiNgErPrInT/='
 
 [ OK, I'm going to be really nitpicking here ... ]
 If you require GNU make in this test, IMHO you can as well change
 the line:
 
   $MAKE Makefile
 
 below with simply:
 
   $MAKE
 
 On the other hand, the test is perfectly correct also as it stands,
 so you decide if the suggested change is worth the additional noise.

I prefer the longer line, as it is clearer what the desired action is,
and also it wouldn't remake unneeded other stuff 'all' might depend on.

Thanks for the quick review, pushed to master,
Ralf