From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 16 14:28:39 2011 Received: (at submit) by debbugs.gnu.org; 16 Oct 2011 18:28:39 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RFVRv-000336-0o for submit@debbugs.gnu.org; Sun, 16 Oct 2011 14:28:39 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RFVRs-00032s-2D for submit@debbugs.gnu.org; Sun, 16 Oct 2011 14:28:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RFVQz-0004P3-Bu for submit@debbugs.gnu.org; Sun, 16 Oct 2011 14:27:43 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,T_DKIM_INVALID,T_TO_NO_BRKTS_FREEMAIL,URIBL_BLACK autolearn=no version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:54814) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFVQz-0004Ou-A8 for submit@debbugs.gnu.org; Sun, 16 Oct 2011 14:27:41 -0400 Received: from eggs.gnu.org ([140.186.70.92]:60826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFVQx-00013T-0T for bug-automake@gnu.org; Sun, 16 Oct 2011 14:27:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RFVQu-0004OZ-G1 for bug-automake@gnu.org; Sun, 16 Oct 2011 14:27:38 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:41606) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFVQu-0004OV-2O; Sun, 16 Oct 2011 14:27:36 -0400 Received: by wyg34 with SMTP id 34so1465851wyg.0 for ; Sun, 16 Oct 2011 11:27:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:message-id; bh=HWgxxwAxg5eQfTqclHeGTxffYEZeyPJwPbROD9dSx9A=; b=dfDXwUQuVLhvKeYwODRpClg0IbvB8m3mmp7BWhaUWqIwoJr/7jVhSud+UxvS3itjLB FyeYpS81ip0+u2K7lh+k7zU4D/pyONtRSwNiWzNEXT382pPC7o6UUfdXP2VJx7+5ptMR rvc7nNHVJrDz6ioMIN/iqwg5cTIRSosj/6O/k= Received: by 10.227.27.225 with SMTP id j33mr3076986wbc.89.1318789654859; Sun, 16 Oct 2011 11:27:34 -0700 (PDT) Received: from bigio.localnet (host224-95-dynamic.244-95-r.retail.telecomitalia.it. [95.244.95.224]) by mx.google.com with ESMTPS id es5sm26656144wbb.11.2011.10.16.11.27.31 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 16 Oct 2011 11:27:32 -0700 (PDT) From: Stefano Lattarini To: bug-automake@gnu.org Subject: Re: Makefile broken after removing included *.am file Date: Sun, 16 Oct 2011 20:27:12 +0200 User-Agent: KMail/1.13.7 (Linux/2.6.30-2-686; KDE/4.6.5; i686; ; ) References: <4AFF7774.20200@gmail.com> In-Reply-To: <4AFF7774.20200@gmail.com> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_BIymOiA4xC6D8Nx" Message-Id: <201110162027.13630.stefano.lattarini@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit Cc: automake-patches@gnu.org, Peter Johansson X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.1 (----) --Boundary-00=_BIymOiA4xC6D8Nx Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit [me going through veeery old backlogs...] References: On Sunday 15 November 2009, Peter Johansson wrote: > Hello, > Hi Peter and automakers, and sorry for the ludicrous delay of this reply. > I included a file in my Makefile.am, but then I decided it was not > useful anymore so I removed the include statement and deleted the file. > That resulted in a broken Makefile, and running `make all' resulted in: > > make: *** No rule to make target `aminclude.am', needed by > `Makefile.in'. Stop. > > This is very similar to the "deleted header file problem" for *.m4 files > that was fixed in version 1.11 by adding a stub rule. I suppose this > problem could be solved in the same fashion. > Thanks for the report and the suggestion; I've been bitten few times by this bug myself, so I agree it's time to fix it. See the attached minimalistic patch, which I'll push to maint in a few days (as usual, reviews welcome). There is also a follow-up patch (attached as well) that ensures the stub rules do not end up covering real errors. With these two patches applied, the testsuite continues to pass both in maint and master. BTW, I see that the patches proposed by Ralf in the original threads (and linked above) have never been applied; anybody (ping ping Ralf ;-) knows why? Regards, Stefano --Boundary-00=_BIymOiA4xC6D8Nx Content-Type: text/x-patch; charset="utf-8"; name="0001-include-avoid-deleted-.am-file-problem.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="0001-include-avoid-deleted-.am-file-problem.patch" =46rom 0e8fe53d0ef3dac4901cecf5d576badb2cd6919b Mon Sep 17 00:00:00 2001 Message-Id: <0e8fe53d0ef3dac4901cecf5d576badb2cd6919b.1318789325.git.stefan= o.lattarini@gmail.com> =46rom: Stefano Lattarini Date: Sun, 16 Oct 2011 14:57:37 +0200 Subject: [PATCH 1/2] include: avoid "deleted .am file" problem * lib/am/configure.am (%MAKEFILE-IN-DEPS%): New target without dependencies, to avoid the "deleted .am file" problem. * tests/remake-deleted-am.test: New test. * tests/remake-deleted-am-2.test: New test. * tests/remake-deleted-am-subdir.test: Likewise. * tests/remake-renamed-am.test: Likewise. * tests/Makefile.am (TESTS): Add them. * NEWS: Update. Report by Peter Johansson. See also commit `Release-1-10-40-gd0ebf71', which fixed a similar problem for .m4 files included by configure.ac. =2D-- ChangeLog | 15 +++++++ NEWS | 4 ++ lib/am/configure.am | 3 + tests/Makefile.am | 4 ++ tests/Makefile.in | 4 ++ tests/remake-deleted-am-2.test | 77 +++++++++++++++++++++++++++++++= +++ tests/remake-deleted-am-subdir.test | 79 +++++++++++++++++++++++++++++++= ++++ tests/remake-deleted-am.test | 69 ++++++++++++++++++++++++++++++ tests/remake-renamed-am.test | 60 ++++++++++++++++++++++++++ 9 files changed, 315 insertions(+), 0 deletions(-) create mode 100755 tests/remake-deleted-am-2.test create mode 100755 tests/remake-deleted-am-subdir.test create mode 100755 tests/remake-deleted-am.test create mode 100755 tests/remake-renamed-am.test diff --git a/ChangeLog b/ChangeLog index 171139c..65784a4 100644 =2D-- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2011-10-16 Stefano Lattarini + + include: avoid "deleted .am file" problem + * lib/am/configure.am (%MAKEFILE-IN-DEPS%): New target without + dependencies, to avoid the "deleted .am file" problem. + * tests/remake-deleted-am.test: New test. + * tests/remake-deleted-am-2.test: New test. + * tests/remake-deleted-am-subdir.test: Likewise. + * tests/remake-renamed-am.test: Likewise. + * tests/Makefile.am (TESTS): Add them. + * NEWS: Update. + Report by Peter Johansson. + See also commit `Release-1-10-40-gd0ebf71', which fixed a similar + problem for .m4 files included by configure.ac. + 2011-10-07 Stefano Lattarini =20 parallel-tests: warn on conditional TEST_EXTENSIONS definition diff --git a/NEWS b/NEWS index 7e30ed0..7246754 100644 =2D-- a/NEWS +++ b/NEWS @@ -68,6 +68,10 @@ Bugs fixed in 1.11.0a: =20 * Long standing bugs: =20 + - The "deleted header file problem" for *.am files is avoided by stub + rules. This allows `make' to trigger a rerun of `automake' also if + some previously needed `.am' file has been removed. + - "make distcheck" now correctly complains also when "make uninstall" leaves one and only one file installed in $(prefix). =20 diff --git a/lib/am/configure.am b/lib/am/configure.am index 594ec67..753e09b 100644 =2D-- a/lib/am/configure.am +++ b/lib/am/configure.am @@ -83,6 +83,9 @@ endif %?TOPDIR_P% cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE% $(am= __depfiles_maybe);; \ esac; =20 +## Avoid the "deleted header file" problem for the dependencies. +%MAKEFILE-IN-DEPS%: + DIST_COMMON +=3D %MAKEFILE-AM% =20 =20 diff --git a/tests/Makefile.am b/tests/Makefile.am index 884ea65..af13b70 100644 =2D-- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -716,6 +716,10 @@ remake-subdir-gnu.test \ remake-subdir.test \ remake-subdir2.test \ remake-subdir-long-time.test \ +remake-deleted-am.test \ +remake-deleted-am-2.test \ +remake-deleted-am-subdir.test \ +remake-renamed-am.test \ pr8365-remake-timing.test \ regex.test \ req.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index f1bfcdd..e085762 100644 =2D-- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -1000,6 +1000,10 @@ remake-subdir-gnu.test \ remake-subdir.test \ remake-subdir2.test \ remake-subdir-long-time.test \ +remake-deleted-am.test \ +remake-deleted-am-2.test \ +remake-deleted-am-subdir.test \ +remake-renamed-am.test \ pr8365-remake-timing.test \ regex.test \ req.test \ diff --git a/tests/remake-deleted-am-2.test b/tests/remake-deleted-am-2.test new file mode 100755 index 0000000..654f390 =2D-- /dev/null +++ b/tests/remake-deleted-am-2.test @@ -0,0 +1,77 @@ +#! /bin/sh +# Copyright (C) 2011 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Check that inclusion of `.am' fragments by automake does not suffer +# of the "deleted header problem". This test checks deeper inclusion +# stacks, and use VPATH builds. + +. ./defs || Exit 1 + +set -e + +echo AC_OUTPUT >> configure.in + +$ACLOCAL +$AUTOCONF + +cat > Makefile.am <<'END' +include $(srcdir)/foo.am +END + +cat > foo.am <<'END' +# this is foo +include sub/bar.am +include baz.am +END + +mkdir sub +echo 'include $(top_srcdir)/sub/zardoz.am' > sub/bar.am +echo '# this is zardoz' > sub/zardoz.am + +echo 'include fnord.am' > baz.am +echo '# you are not seeing this' > fnord.am + +$AUTOMAKE +# Sanity checks. +$FGREP 'this is zardoz' Makefile.in +$FGREP 'you are not seeing this' Makefile.in + +mkdir build +cd build + +srcdir=3D.. + +$srcdir/configure +$MAKE + +$sleep +echo '# this is baz' > $srcdir/baz.am +rm -f $srcdir/fnord.am +$MAKE +# Sanity checks. +$FGREP 'you are not seeing this' $srcdir/Makefile.in Makefile && Exit 1 +$FGREP 'this is baz' $srcdir/Makefile.in +$FGREP 'this is baz' Makefile + +$sleep +rm -rf $srcdir/sub $srcdir/foo.am $srcdir/baz.am=20 +echo '# no more inclusions' > $srcdir/Makefile.am +$MAKE +# Sanity checks. +$EGREP 'this is (foo|bar|baz)' Makefile $srcdir/Makefile.in && Exit 1 +$FGREP 'no more inclusions' Makefile + +: diff --git a/tests/remake-deleted-am-subdir.test b/tests/remake-deleted-am-= subdir.test new file mode 100755 index 0000000..9ed1078 =2D-- /dev/null +++ b/tests/remake-deleted-am-subdir.test @@ -0,0 +1,79 @@ +#! /bin/sh +# Copyright (C) 2011 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Check that inclusion of `.am' fragments by automake does not suffer +# of the "deleted header problem". This test does the check when the +# SUBDIRS variable is involved. + +. ./defs || Exit 1 + +set -e + +cat >> configure.in <<'END' +AC_CONFIG_FILES([sub1/Makefile sub2/Makefile]) +AC_OUTPUT +END + +$ACLOCAL +$AUTOCONF + +cat > Makefile.am <<'END' +include foo.am +SUBDIRS =3D sub1 sub2 +END + +echo '# this is foo.am' > foo.am + +mkdir sub1 sub2 + +echo 'include $(srcdir)/bar.am' > sub1/Makefile.am +echo '# this is bar.am' > sub1/bar.am + +echo 'include $(top_srcdir)/foo.am' > sub2/Makefile.am + +$AUTOMAKE +# Sanity checks. +$FGREP 'this is foo.am' Makefile.in +$FGREP 'this is bar.am' sub1/Makefile.in +$FGREP 'this is foo.am' sub2/Makefile.in + +./configure +$MAKE # Should be no-op. + +$sleep +echo '# this is sub1/Makefile.am' > sub1/Makefile.am +rm -f sub1/bar.am +$MAKE all +# Sanity checks. +$FGREP 'this is bar' sub1/Makefile.in sub1/Makefile && Exit 1 +$FGREP 'this is sub1/Makefile.am' sub1/Makefile.in +$FGREP 'this is sub1/Makefile.am' sub1/Makefile + +$sleep +for d in . sub2; do + sed "s|.*include.*foo\.am.*|# this is $d/Makefile.am|" $d/Makefile.am > t + mv -f t $d/Makefile.am +done +rm -f foo.am +$MAKE all +# Sanity checks. +$FGREP 'this is foo' sub*/Makefile* Makefile* && Exit 1 +for d in . sub1 sub2; do + $FGREP "this is $d/Makefile.am" $d/Makefile.in + $FGREP "this is $d/Makefile.am" $d/Makefile +done + +: diff --git a/tests/remake-deleted-am.test b/tests/remake-deleted-am.test new file mode 100755 index 0000000..fa5a672 =2D-- /dev/null +++ b/tests/remake-deleted-am.test @@ -0,0 +1,69 @@ +#! /bin/sh +# Copyright (C) 2011 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Check that inclusion of `.am' fragments by automake does not suffer +# of the "deleted header problem". Basic checks are done here. + +. ./defs || Exit 1 + +set -e + +echo AC_OUTPUT >> configure.in + +$ACLOCAL +$AUTOCONF + +cat > Makefile.am <<'END' +include foo.am +include $(srcdir)/bar.am +include $(top_srcdir)/baz.am +END + +echo '# this is foo' > foo.am +echo '# this is bar' > bar.am +echo '# this is baz' > baz.am + +$AUTOMAKE +# Sanity checks. +$FGREP 'this is foo' Makefile.in +$FGREP 'this is bar' Makefile.in +$FGREP 'this is baz' Makefile.in + +./configure +$MAKE # Should be no-op. + +$sleep +sed '/^include foo\.am$/d' Makefile.am > t +mv -f t Makefile.am +rm -f foo.am +$MAKE Makefile +# Sanity checks. +$FGREP 'this is foo' Makefile.in Makefile && Exit 1 +$FGREP 'this is bar' Makefile.in +$FGREP 'this is bar' Makefile +$FGREP 'this is baz' Makefile.in +$FGREP 'this is baz' Makefile + +$sleep +echo '# empty empty' > Makefile.am +rm -f bar.am baz.am +$MAKE Makefile +# Sanity checks. +$FGREP 'empty empty' Makefile.in +$FGREP 'empty empty' Makefile +grep 'this is ba[rz]' Makefile Makefile.in && Exit 1 + +: diff --git a/tests/remake-renamed-am.test b/tests/remake-renamed-am.test new file mode 100755 index 0000000..b3a7a41 =2D-- /dev/null +++ b/tests/remake-renamed-am.test @@ -0,0 +1,60 @@ +#! /bin/sh +# Copyright (C) 2011 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Check that inclusion of `.am' fragments by automake does not suffer +# of the "deleted header problem". This test checks that we can rename +# an included .am file without confusing the remake rules. + +. ./defs || Exit 1 + +set -e + +echo AC_OUTPUT >> configure.in + +cat > Makefile.am <<'END' +include foo.am +END + +cat > foo.am <<'END' +all-local: + echo ok > has-run-1 +END + +$ACLOCAL +$AUTOMAKE +$AUTOCONF + +./configure +$MAKE +test -f has-run-1 + +$sleep +rm -f has-run-1 +mv -f foo.am bar.am +echo include bar.am > Makefile.am +$MAKE Makefile +$FGREP 'foo.am' Makefile Makefile.in && Exit 1 + +$sleep +rm -f has-run-1 bar.am +echo 'all-local:; echo ok > has-run-2' > zardoz.am +echo 'include $(srcdir)/zardoz.am' > Makefile.am +using_gmake || $MAKE Makefile +$MAKE +test ! -f has-run-1 +test -f has-run-2 + +: =2D-=20 1.7.2.3 --Boundary-00=_BIymOiA4xC6D8Nx Content-Type: text/x-patch; charset="utf-8"; name="0002-coverage-required-but-missing-.am-and-.m4-files-are-.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="0002-coverage-required-but-missing-.am-and-.m4-files-are-.patch" =46rom 120eab98add774cef856c211b436dcb3719a791e Mon Sep 17 00:00:00 2001 Message-Id: <120eab98add774cef856c211b436dcb3719a791e.1318789325.git.stefan= o.lattarini@gmail.com> In-Reply-To: <0e8fe53d0ef3dac4901cecf5d576badb2cd6919b.1318789325.git.stefa= no.lattarini@gmail.com> References: <0e8fe53d0ef3dac4901cecf5d576badb2cd6919b.1318789325.git.stefan= o.lattarini@gmail.com> =46rom: Stefano Lattarini Date: Sun, 16 Oct 2011 17:07:19 +0200 Subject: [PATCH 2/2] coverage: required but missing '.am' and '.m4' files a= re diagnosed The stub rules emitted to work around the "deleted header problem" for `.m4' files (included by autoconf in e.g., configure.ac) and for `.am' files (included by automake in e.g., Makefile.am) should not prevent the remake rules from correctly erroring out when a still-required file is missing. * tests/deleted-am.test: New test. * tests/deleted-m4.test: Likewise. * tests/Makefile.am (TESTS): Add them. =2D-- ChangeLog | 12 +++++++++ tests/Makefile.am | 2 + tests/deleted-am.test | 58 +++++++++++++++++++++++++++++++++++++++++++ tests/deleted-m4.test | 66 +++++++++++++++++++++++++++++++++++++++++++++= ++++ 4 files changed, 138 insertions(+), 0 deletions(-) create mode 100755 tests/deleted-am.test create mode 100755 tests/deleted-m4.test diff --git a/ChangeLog b/ChangeLog index 65784a4..e5cf3cd 100644 =2D-- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 2011-10-16 Stefano Lattarini =20 + coverage: required but missing '.am' and '.m4' files are diagnosed + The stub rules emitted to work around the "deleted header problem" + for `.m4' files (included by autoconf in e.g., configure.ac) and + for `.am' files (included by automake in e.g., Makefile.am) should + not prevent the remake rules from correctly erroring out when a + still-required file is missing. + * tests/deleted-am.test: New test. + * tests/deleted-m4.test: Likewise. + * tests/Makefile.am (TESTS): Add them. + +2011-10-16 Stefano Lattarini + include: avoid "deleted .am file" problem * lib/am/configure.am (%MAKEFILE-IN-DEPS%): New target without dependencies, to avoid the "deleted .am file" problem. diff --git a/tests/Makefile.am b/tests/Makefile.am index af13b70..3487d95 100644 =2D-- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -295,6 +295,8 @@ dejagnu4.test \ dejagnu5.test \ dejagnu6.test \ dejagnu7.test \ +deleted-am.test \ +deleted-m4.test \ depacl2.test \ depcomp.test \ depcomp2.test \ diff --git a/tests/deleted-am.test b/tests/deleted-am.test new file mode 100755 index 0000000..29d104c =2D-- /dev/null +++ b/tests/deleted-am.test @@ -0,0 +1,58 @@ +#! /bin/sh +# Copyright (C) 2011 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# The stub rules emitted to work around the "deleted header problem" +# for `.am' files shouldn't prevent the remake rules from correctly +# erroring out when a still-required file is missing. + +. ./defs || Exit 1 + +set -e + +echo AC_OUTPUT >> configure.in + +echo 'include $(top_srcdir)/foobar.am' > Makefile.am +echo 'include zardoz.am' > foobar.am +: > zardoz.am + +$ACLOCAL +$AUTOCONF +$AUTOMAKE + +./configure +$MAKE + +rm -f zardoz.am +$MAKE >output 2>&1 && { cat output; Exit 1; } +cat output +# This error will come from automake, not make, so we can be stricter +# in our grepping of it. +grep 'cannot open.*zardoz\.am' output +grep 'foobar\.am' output && Exit 1 # No spurious error, please. + +# Try with one less indirection. +: > foobar.am +$AUTOMAKE Makefile +./config.status Makefile +$MAKE # Sanity check. +rm -f foobar.am +$MAKE >output 2>&1 && { cat output; Exit 1; } +cat output +# This error will come from automake, not make, so we can be stricter +# in our grepping of it. +grep 'cannot open.*foobar\.am' output + +: diff --git a/tests/deleted-m4.test b/tests/deleted-m4.test new file mode 100755 index 0000000..3114bcd =2D-- /dev/null +++ b/tests/deleted-m4.test @@ -0,0 +1,66 @@ +#! /bin/sh +# Copyright (C) 2011 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# The stub rules emitted to work around the "deleted header problem" +# for `.m4' files shouldn't prevent the remake rules from correctly +# erroring out when a still-required file is missing. + +. ./defs || Exit 1 + +set -e + +cat >> configure.in <<'END' +m4_include([foobar.m4]) +AC_OUTPUT +END + +: > Makefile.am + +echo 'm4_include([zardoz.m4])' > foobar.m4 +: > zardoz.m4 + +$ACLOCAL +$AUTOCONF +$AUTOMAKE + +./configure +$MAKE + +rm -f zardoz.m4 +$MAKE >output 2>&1 && { cat output; Exit 1; } +cat output +# This error will come from aclocal, not make, so we can be stricter +# in our grepping of it. +grep ' foobar\.m4:1:.*zardoz\.m4.*does not exist' output +# No spurious errors, please. +$FGREP -v ' foobar.m4:1:' output | $FGREP 'foobar.m4' && Exit 1 + +# Try with one less indirection. +: > foobar.m4 +$ACLOCAL --force +$AUTOCONF +./configure +$MAKE # Sanity check. +rm -f foobar.m4 +$MAKE >output 2>&1 && { cat output; Exit 1; } +cat output +# This error will come from aclocal, not make, so we can be stricter +# in our grepping of it. +grep 'foobar\.m4.*does not exist' output +# No spurious errors, please (ok, this is really paranoid). +$FGREP 'zardoz.m4' output && Exit 1 + +: =2D-=20 1.7.2.3 --Boundary-00=_BIymOiA4xC6D8Nx-- From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 16 14:32:54 2011 Received: (at 9768) by debbugs.gnu.org; 16 Oct 2011 18:32:54 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RFVW1-00039j-2d for submit@debbugs.gnu.org; Sun, 16 Oct 2011 14:32:54 -0400 Received: from mailout-de.gmx.net ([213.165.64.22]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1RFVVy-00039S-9l for 9768@debbugs.gnu.org; Sun, 16 Oct 2011 14:32:51 -0400 Received: (qmail 19547 invoked by uid 0); 16 Oct 2011 18:31:57 -0000 Received: from 74.125.122.49 by www009.gmx.net with HTTP; Sun, 16 Oct 2011 20:31:56 +0200 (CEST) Content-Type: text/plain; charset="utf-8" Date: Sun, 16 Oct 2011 20:31:56 +0200 From: "Ralf Wildenhues" In-Reply-To: <201110162027.13630.stefano.lattarini@gmail.com> Message-ID: <20111016183156.123670@gmx.net> MIME-Version: 1.0 References: <4AFF7774.20200@gmail.com> <201110162027.13630.stefano.lattarini@gmail.com> Status: RO Subject: Re: bug#9768: Makefile broken after removing included *.am file To: Stefano Lattarini X-Authenticated: #13673931 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Mutt-Fcc: ~/Mail/outbox X-Mutt-References: <201110162027.13630.stefano.lattarini@gmail.com> X-Priority: 3 X-Provags-ID: V01U2FsdGVkX18oUYEGq4ooTSpe2qtcV9HFIXyGRrJphV14dWZaS9 TkHvdjOyh9M5Ten1h2LE2VuVjJeQOIQiBKYw== Content-Transfer-Encoding: 8bit X-GMX-UID: LhqodnoEMmA6X6DJu2FncLI5MjQ1N53w X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 9768 Cc: 9768@debbugs.gnu.org, automake-patches@gnu.org, Peter Johansson X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Hello, * Stefano Lattarini wrote on Sun, Oct 16, 2011 at 08:27:12PM CEST: > On Sunday 15 November 2009, Peter Johansson wrote: > > make: *** No rule to make target `aminclude.am', needed by > > `Makefile.in'. Stop. > > > > This is very similar to the "deleted header file problem" for *.m4 files > > that was fixed in version 1.11 by adding a stub rule. I suppose this > > problem could be solved in the same fashion. > > > Thanks for the report and the suggestion; I've been bitten few times by > this bug myself, so I agree it's time to fix it. See the attached > minimalistic patch, which I'll push to maint in a few days (as usual, > reviews welcome). There is also a follow-up patch (attached as well) > that ensures the stub rules do not end up covering real errors. What happens if I write include fragment-with-typo-in-name.am but I want that fragment included? IIUC then automake will still error out when it gets rerun, but because of the way dependencies are handled now, it won't get rerun automatically, right? Thanks, Ralf From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 17 04:21:19 2011 Received: (at 9768) by debbugs.gnu.org; 17 Oct 2011 08:21:19 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RFiRi-0006zZ-MB for submit@debbugs.gnu.org; Mon, 17 Oct 2011 04:21:19 -0400 Received: from mail-wy0-f172.google.com ([74.125.82.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RFiRg-0006zK-80 for 9768@debbugs.gnu.org; Mon, 17 Oct 2011 04:21:17 -0400 Received: by wyh22 with SMTP id 22so307136wyh.3 for <9768@debbugs.gnu.org>; Mon, 17 Oct 2011 01:20:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; bh=kG1tk6jz41dqOHDihRskYovAJTm1pG7SLOYFAztauk0=; b=WNPq2/UP4Bb25Dfy4inGnphLs2aJ2bvqAppQec/1Qsoudo3hCQ7bJm5b04rU7cTV48 zox/r+xtheTMd1j9NILGQT5U+AA5VphXZJI3hzeKle5L4PB+JgieLNcoaJ8aHMp5P5Fr ZgGkOXrOdoRS3vBvEbdDBjKvhcLDoV1PXLGmQ= Received: by 10.216.230.11 with SMTP id i11mr3423437weq.65.1318839620189; Mon, 17 Oct 2011 01:20:20 -0700 (PDT) Received: from bigio.localnet (host218-103-dynamic.0-87-r.retail.telecomitalia.it. [87.0.103.218]) by mx.google.com with ESMTPS id i29sm29650138wbp.22.2011.10.17.01.20.15 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Oct 2011 01:20:18 -0700 (PDT) From: Stefano Lattarini To: "Ralf Wildenhues" Subject: Re: bug#9768: Makefile broken after removing included *.am file Date: Mon, 17 Oct 2011 10:20:05 +0200 User-Agent: KMail/1.13.7 (Linux/2.6.30-2-686; KDE/4.6.5; i686; ; ) References: <4AFF7774.20200@gmail.com> <201110162027.13630.stefano.lattarini@gmail.com> <20111016183156.123670@gmx.net> In-Reply-To: <20111016183156.123670@gmx.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201110171020.05917.stefano.lattarini@gmail.com> X-Spam-Score: -3.9 (---) X-Debbugs-Envelope-To: 9768 Cc: 9768@debbugs.gnu.org, automake-patches@gnu.org, Peter Johansson X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.9 (---) On Sunday 16 October 2011, Ralf Wildenhues wrote: > Hello, > Hi Ralf. > * Stefano Lattarini wrote on Sun, Oct 16, 2011 at 08:27:12PM CEST: > > On Sunday 15 November 2009, Peter Johansson wrote: > > > make: *** No rule to make target `aminclude.am', needed by > > > `Makefile.in'. Stop. > > > > > > This is very similar to the "deleted header file problem" for *.m4 files > > > that was fixed in version 1.11 by adding a stub rule. I suppose this > > > problem could be solved in the same fashion. > > > > > Thanks for the report and the suggestion; I've been bitten few times by > > this bug myself, so I agree it's time to fix it. See the attached > > minimalistic patch, which I'll push to maint in a few days (as usual, > > reviews welcome). There is also a follow-up patch (attached as well) > > that ensures the stub rules do not end up covering real errors. > > What happens if I write > include fragment-with-typo-in-name.am > > but I want that fragment included? > I fear I cannot parse this question... Do you mean that you want to include the file `bar.am' but erronously write "include baz.am" in your Makefile.am instead? In this case, automake will obviously complain and bail out, as it did before my patch (in fact, said patch doesn't touch the automake script at all, so this invariance of its behaviour should be obvious). > IIUC then automake will still error out when it gets rerun, but > because of the way dependencies are handled now, it won't get rerun > automatically, right? > Why not? If you change `Makefile.am', the automake-generated makefiles will know that they have to rebuild the corresponding `Makefile.in', so they'll invoke automake -- which will dutifully fail if any file included by the `Makefile.am' does not exist. See also the new `deleted-am.test' test script in my second patch, which should check this behaviour. But all of this seems pretty obvious (unless I'm missing something really fundamental), so I think I must be misunderstanding your questions/doubts here... Regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 17 05:37:16 2011 Received: (at control) by debbugs.gnu.org; 17 Oct 2011 09:37:16 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RFjdD-00012P-QB for submit@debbugs.gnu.org; Mon, 17 Oct 2011 05:37:15 -0400 Received: from mail-wy0-f172.google.com ([74.125.82.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RFjdB-00012D-ON for control@debbugs.gnu.org; Mon, 17 Oct 2011 05:37:14 -0400 Received: by wyh22 with SMTP id 22so371726wyh.3 for ; Mon, 17 Oct 2011 02:36:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:mime-version:content-type :content-transfer-encoding:message-id; bh=thGGZ+7eRHAfTO65IrC2/mKdR/XFn9JHYWxyBwMRJ9o=; b=wCdUeuYZuIg2lmGAO2F4/cxarzfmcw+5oWZ3aWMkxCW0XzopYeTQ/H/I3G3uv2Kfez oEEabbLlxTLHIeiqW6AgpyhOXjhB/7HTzSszWVLK6Ns1VRG8rwYIAXdVikDrYhUdBlqU iskD2C99vqAvGhgQlKeFhJRvwIjdWCIWtg+wE= Received: by 10.227.155.81 with SMTP id r17mr6595954wbw.93.1318844177356; Mon, 17 Oct 2011 02:36:17 -0700 (PDT) Received: from bigio.localnet (host218-103-dynamic.0-87-r.retail.telecomitalia.it. [87.0.103.218]) by mx.google.com with ESMTPS id ei16sm29985588wbb.21.2011.10.17.02.36.15 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Oct 2011 02:36:16 -0700 (PDT) From: Stefano Lattarini To: control@debbugs.gnu.org Subject: foo Date: Mon, 17 Oct 2011 11:36:00 +0200 User-Agent: KMail/1.13.7 (Linux/2.6.30-2-686; KDE/4.6.5; i686; ; ) MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201110171136.01558.stefano.lattarini@gmail.com> X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.8 (--) submitter 9768 Peter Johansson thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 19 15:08:08 2011 Received: (at 9768) by debbugs.gnu.org; 19 Oct 2011 19:08:08 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RGbUl-0001Us-K5 for submit@debbugs.gnu.org; Wed, 19 Oct 2011 15:08:07 -0400 Received: from mailout-de.gmx.net ([213.165.64.23]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1RGbUj-0001UP-SE for 9768@debbugs.gnu.org; Wed, 19 Oct 2011 15:08:06 -0400 Received: (qmail 21413 invoked by uid 0); 19 Oct 2011 19:06:55 -0000 Received: from 74.125.122.49 by www008.gmx.net with HTTP; Wed, 19 Oct 2011 21:06:54 +0200 (CEST) Content-Type: text/plain; charset="utf-8" Date: Wed, 19 Oct 2011 21:06:54 +0200 From: "Ralf Wildenhues" In-Reply-To: <201110171020.05917.stefano.lattarini@gmail.com> Message-ID: <20111019190654.156880@gmx.net> MIME-Version: 1.0 References: <4AFF7774.20200@gmail.com> <201110162027.13630.stefano.lattarini@gmail.com> <20111016183156.123670@gmx.net> <201110171020.05917.stefano.lattarini@gmail.com> Status: RO Subject: Re: bug#9768: Makefile broken after removing included *.am file To: Stefano Lattarini X-Authenticated: #13673931 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Mutt-Fcc: ~/Mail/outbox X-Mutt-References: <201110171020.05917.stefano.lattarini@gmail.com> X-Priority: 3 X-Provags-ID: V01U2FsdGVkX192eFJMhex2oDcK4PW/x9nKAJ3pYsrEEvFfkj9GV1 UbDmnjHFWoALxSToILcWuDfU++vYkIwJeFnw== Content-Transfer-Encoding: 8bit X-GMX-UID: qHv3A3NcbHIhc7md6TQ01pAiJihyapC0 X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 9768 Cc: 9768@debbugs.gnu.org, automake-patches@gnu.org, Peter Johansson X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) * Stefano Lattarini wrote on Mon, Oct 17, 2011 at 10:20:05AM CEST: > On Sunday 16 October 2011, Ralf Wildenhues wrote: > > What happens if I write > > include fragment-with-typo-in-name.am > > > > but I want that fragment included? > > > I fear I cannot parse this question... Do you mean that you want to > include the file `bar.am' but erronously write "include baz.am" in your > Makefile.am instead? In this case, automake will obviously complain > and bail out, as it did before my patch (in fact, said patch doesn't > touch the automake script at all, so this invariance of its behaviour > should be obvious). Alright. The first time you write the include line and invoke automake, it will bail out if there is a typo. But if the fragment file is later (re)moved, and you type 'make' again, you will not get an error, as automake will not be rerun automatically. Only when automake is invoked manually, or triggered by some other out of date file, will the error be noticed. Taken a step further, if some fragment file for some reason does not get included in a release tarball, then the developer might not see that during testing, but users will miss a file needed to tinker with the package. Am I missing something? Thanks, Ralf From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 20 06:22:56 2011 Received: (at 9768) by debbugs.gnu.org; 20 Oct 2011 10:22:56 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RGpm4-00068W-0j for submit@debbugs.gnu.org; Thu, 20 Oct 2011 06:22:56 -0400 Received: from mail-ey0-f172.google.com ([209.85.215.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RGpm0-00068I-DC for 9768@debbugs.gnu.org; Thu, 20 Oct 2011 06:22:54 -0400 Received: by eyg24 with SMTP id 24so3132916eyg.3 for <9768@debbugs.gnu.org>; Thu, 20 Oct 2011 03:21:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:message-id; bh=WJYNB8FggkVGAnPYFwohPX8sON9XkVwvR5knhQzn9xs=; b=xVntW2+qfO799zpHN6r07TS49NCjJCx76OssTOxTZ4KTe/+fpi06yoMv5xRayPcdEa mV+ZJEHez/YPrC+iX7Z2KKDnVsFtPnJ+3fkPPB9lkidCXXFZX4e4Oc0rbzmhoG9FmAr4 JlGE0mx1/3sIuYRNHUJfs0eXLg+6I9Qz6NNeg= Received: by 10.213.32.193 with SMTP id e1mr1356048ebd.3.1319106098000; Thu, 20 Oct 2011 03:21:38 -0700 (PDT) Received: from bigio.localnet (host221-101-dynamic.54-82-r.retail.telecomitalia.it. [82.54.101.221]) by mx.google.com with ESMTPS id v3sm10894425eej.7.2011.10.20.03.21.34 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Oct 2011 03:21:35 -0700 (PDT) From: Stefano Lattarini To: "Ralf Wildenhues" Subject: Re: bug#9768: Makefile broken after removing included *.am file Date: Thu, 20 Oct 2011 12:21:25 +0200 User-Agent: KMail/1.13.7 (Linux/2.6.30-2-686; KDE/4.6.5; i686; ; ) References: <4AFF7774.20200@gmail.com> <201110171020.05917.stefano.lattarini@gmail.com> <20111019190654.156880@gmx.net> In-Reply-To: <20111019190654.156880@gmx.net> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_mY/nOSG5KkJcIV6" Message-Id: <201110201221.26347.stefano.lattarini@gmail.com> X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 9768 Cc: 9768@debbugs.gnu.org, automake-patches@gnu.org, Peter Johansson X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) --Boundary-00=_mY/nOSG5KkJcIV6 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Wednesday 19 October 2011, Ralf Wildenhues wrote: > * Stefano Lattarini wrote on Mon, Oct 17, 2011 at 10:20:05AM CEST: > > On Sunday 16 October 2011, Ralf Wildenhues wrote: > > > What happens if I write > > > include fragment-with-typo-in-name.am > > > > > > but I want that fragment included? > > > > > I fear I cannot parse this question... Do you mean that you want to > > include the file `bar.am' but erronously write "include baz.am" in your > > Makefile.am instead? In this case, automake will obviously complain > > and bail out, as it did before my patch (in fact, said patch doesn't > > touch the automake script at all, so this invariance of its behaviour > > should be obvious). > > Alright. The first time you write the include line and invoke automake, > it will bail out if there is a typo. > Yes. > But if the fragment file is later (re)moved, and you type 'make' again, > you will not get an error, as automake will not be rerun automatically. > Hmm... but `Makefile.in' depends on the included file that has just been removed, so `make' will try to rebuild this file -- and after my patch this will be a no-op, due to the new stub rules -- and will then try to rebuild `Makefile.in' by invoking `automake' -- which will fail due to the missing include file. > Only when automake is invoked manually, or triggered by some other > out of date file, will the error be noticed. > This is not true; and in fact, I've added a new test case to ensure we don't regress in this regard (see `deleted-am.test'). > Taken a step further, if some fragment file for some reason does not > get included in a release tarball, then the developer might not see > that during testing, > This shouldn't be a serious problem, since Automake takes care of automatically distributing included `.am' files. But even if the dist tarball gets messed up in strage ways, and some `.am' files get removed from it, the same reasoning given above should apply, so the error will be caught. Still, it would be nice to have a testcase for this (as well as for the sister situations with included `.m4' files). So I'd like to queue the attached patch as well. [NOTE: while writing this patch, I've hit another automake bug/limitation, that I will report in a new thread soonish]. > but users will miss a file needed to tinker with the package. > > Am I missing something? > I hope so :-) -- otherwise I've completely misunderstood something cardinal here. Thanks, Stefano --Boundary-00=_mY/nOSG5KkJcIV6 Content-Type: text/x-patch; charset="utf-8"; name="0001-coverage-undistributed-.am-and-.m4-files-are-diagnos.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="0001-coverage-undistributed-.am-and-.m4-files-are-diagnos.patch" =46rom 4fa17ed7b6d631a70d84129cbb169578def362ba Mon Sep 17 00:00:00 2001 Message-Id: <4fa17ed7b6d631a70d84129cbb169578def362ba.1319104807.git.stefan= o.lattarini@gmail.com> =46rom: Stefano Lattarini Date: Thu, 20 Oct 2011 11:55:01 +0200 Subject: [PATCH] coverage: undistributed '.am' and '.m4' files are diagnosed The stub rules emitted to work around the "deleted header problem" for `.m4' files (included by autoconf in e.g., configure.ac) and for `.am' files (included by automake in e.g., Makefile.am) should not prevent "make" from correctly complaining when such a required file is missing from a distribution tarball. * tests/dist-missing-am.test: New test. * tests/dist-missing-m4.test: Likewise. * tests/dist-missing-included-m4.test: Likewise. * tests/Makefile.am (TESTS): Add them. Suggestion by Ralf Wildenhues. =2D-- ChangeLog | 14 +++++++ tests/dist-missing-am.test | 67 +++++++++++++++++++++++++++++++= ++ tests/dist-missing-included-m4.test | 69 +++++++++++++++++++++++++++++++= +++ tests/dist-missing-m4.test | 71 +++++++++++++++++++++++++++++++= ++++ 4 files changed, 221 insertions(+), 0 deletions(-) create mode 100755 tests/dist-missing-am.test create mode 100755 tests/dist-missing-included-m4.test create mode 100755 tests/dist-missing-m4.test diff --git a/ChangeLog b/ChangeLog index e5cf3cd..1699347 100644 =2D-- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2011-10-20 Stefano Lattarini + + coverage: undistributed '.am' and '.m4' files are diagnosed + The stub rules emitted to work around the "deleted header problem" + for `.m4' files (included by autoconf in e.g., configure.ac) and + for `.am' files (included by automake in e.g., Makefile.am) should + not prevent "make" from correctly complaining when such a required + file is missing from a distribution tarball. + * tests/dist-missing-am.test: New test. + * tests/dist-missing-m4.test: Likewise. + * tests/dist-missing-included-m4.test: Likewise. + * tests/Makefile.am (TESTS): Add them. + Suggestion by Ralf Wildenhues. + 2011-10-16 Stefano Lattarini =20 coverage: required but missing '.am' and '.m4' files are diagnosed diff --git a/tests/dist-missing-am.test b/tests/dist-missing-am.test new file mode 100755 index 0000000..97f4ff5 =2D-- /dev/null +++ b/tests/dist-missing-am.test @@ -0,0 +1,67 @@ +#! /bin/sh +# Copyright (C) 2011 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# The stub rules emitted to work around the "deleted header problem" +# for `.am' files shouldn't prevent "make" from diagnosing a missing +# required `.am' file from a distribution tarball. + +. ./defs || Exit 1 + +set -e + +echo AC_OUTPUT >> configure.in + +cat > Makefile.am <<'END' +include $(srcdir)/foobar.am +include $(srcdir)/zardoz.am +END + +: > foobar.am +: > zardoz.am + +$ACLOCAL +$AUTOCONF +$AUTOMAKE + +./configure + +# A faulty distribution tarball, with a required `.am' file missing. +# Building from it should fail, both for in-tree and VPATH builds. +ocwd=3D`pwd` || fatal_ "cannot get current working directory" +for vpath in false :; do + $MAKE distdir + test -f $distdir/zardoz.am # Sanity check. + rm -f $distdir/zardoz.am + if $vpath; then + # We can't just build in a subdirectory of $distdir, otherwise + # we'll hit automake bug#???? (FIXME: yet to be reported). + mkdir vpath-distcheck + cd vpath-distcheck + ../$distdir/configure + else + cd $distdir + ./configure + fi + $MAKE >output 2>&1 && { cat output; Exit 1; } + cat output + # This error comes from automake, not make, so we can be stricter + # in our grepping of it. + grep 'cannot open.*zardoz\.am' output + grep 'foobar\.am' output && Exit 1 # No spurious error, please. + cd "$ocwd" || fatal_ "cannot chdir back to top-level test directory" +done + +: diff --git a/tests/dist-missing-included-m4.test b/tests/dist-missing-inclu= ded-m4.test new file mode 100755 index 0000000..ea7ebff =2D-- /dev/null +++ b/tests/dist-missing-included-m4.test @@ -0,0 +1,69 @@ +#! /bin/sh +# Copyright (C) 2011 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# The stub rules emitted to work around the "deleted header problem" +# for `.m4' files shouldn't prevent "make" from diagnosing a missing +# required `.m4' file from a distribution tarball. +# See also sister test `dist-missing-m4.test'. + +. ./defs || Exit 1 + +set -e + +cat >> configure.in <<'END' +m4_include([foobar.m4]) +m4_include([zardoz.m4]) +AC_OUTPUT +END + +: > foobar.m4 +: > zardoz.m4 + +: > Makefile.am + +$ACLOCAL +$AUTOCONF +$AUTOMAKE + +./configure + +# A faulty distribution tarball, with a required `.m4' file missing. +# Building from it should fail, both for in-tree and VPATH builds. +ocwd=3D`pwd` || fatal_ "cannot get current working directory" +for vpath in false :; do + $MAKE distdir + test -f $distdir/zardoz.m4 # Sanity check. + rm -f $distdir/zardoz.m4 + if $vpath; then + # We can't just build in a subdirectory of $distdir, otherwise + # we'll hit automake bug#???? (FIXME: yet to be reported). + mkdir vpath-distcheck + cd vpath-distcheck + ../$distdir/configure + else + cd $distdir + ./configure + fi + $MAKE >output 2>&1 && { cat output; Exit 1; } + cat output + # This error will come from automake, not make, so we can be stricter + # in our grepping of it. + grep 'zardoz\.m4.*does not exist' output + grep 'foobar\.m4' output && Exit 1 # No spurious error, please. + cd "$ocwd" || fatal_ "cannot chdir back to top-level test directory" +done + +: diff --git a/tests/dist-missing-m4.test b/tests/dist-missing-m4.test new file mode 100755 index 0000000..34e0030 =2D-- /dev/null +++ b/tests/dist-missing-m4.test @@ -0,0 +1,71 @@ +#! /bin/sh +# Copyright (C) 2011 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# The stub rules emitted to work around the "deleted header problem" +# for `.m4' files shouldn't prevent "make" from diagnosing a missing +# required `.m4' file from a distribution tarball. +# See also sister test `dist-missing-included-m4.test'. + +. ./defs || Exit 1 + +set -e + +cat >> configure.in <<'END' +m4_pattern_forbid([^MY_]) +MY_FOOBAR || exit 1 +MY_ZARDOZ || exit 1 +AC_OUTPUT +END + +mkdir m4 +echo 'AC_DEFUN([MY_FOOBAR], [:])' > m4/foobar.m4 +echo 'AC_DEFUN([MY_ZARDOZ], [:])' > m4/zardoz.m4 + +echo 'ACLOCAL_AMFLAGS =3D -I m4' > Makefile.am + +$ACLOCAL -I m4 +$AUTOCONF +$AUTOMAKE + +./configure + +# A faulty distribution tarball, with a required `.m4' file missing. +# Building from it should fail, both for in-tree and VPATH builds. +ocwd=3D`pwd` || fatal_ "cannot get current working directory" +for vpath in false :; do + $MAKE distdir + test -f $distdir/m4/zardoz.m4 # Sanity check. + rm -f $distdir/m4/zardoz.m4 + if $vpath; then + # We can't just build in a subdirectory of $distdir, otherwise + # we'll hit automake bug#???? (FIXME: yet to be reported). + mkdir vpath-distcheck + cd vpath-distcheck + ../$distdir/configure + else + cd $distdir + ./configure + fi + $MAKE >output 2>&1 && { cat output; Exit 1; } + cat output + # This error will come from autoconf, not make, so we can be stricter + # in our grepping of it. + grep 'possibly undefined .*MY_ZARDOZ' output + grep 'MY_FOOBAR' output && Exit 1 # No spurious error, please. + cd "$ocwd" || fatal_ "cannot chdir back to top-level test directory" +done + +: =2D-=20 1.7.2.3 --Boundary-00=_mY/nOSG5KkJcIV6-- From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 23 14:17:17 2011 Received: (at 9768) by debbugs.gnu.org; 23 Oct 2011 18:17:17 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RI2bk-0004YE-BQ for submit@debbugs.gnu.org; Sun, 23 Oct 2011 14:17:16 -0400 Received: from mail-wy0-f172.google.com ([74.125.82.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RI2bi-0004Xv-2B for 9768@debbugs.gnu.org; Sun, 23 Oct 2011 14:17:15 -0400 Received: by wyh22 with SMTP id 22so5200428wyh.3 for <9768@debbugs.gnu.org>; Sun, 23 Oct 2011 11:15:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; bh=OkvOJyf86M6d0dgQDH5/Yt4ZGmcz1GQ38LQNHIyvQC4=; b=QMLyyjJjgUYxaLF7mield5bDEyMoQ8rbgvrL2khmQ71MuExVnAUv5JiJrbO2LXg5oL 6rLvJLA3UbugBJ4+DdM4nJCVIrEeIy2zE9qKJY8zyXxjPeApS5A4g+E95ybDT2fOILaV 0kCsBYoOk53PcRiIAPJHxxjbb2uPfKNfKo9rY= Received: by 10.216.221.163 with SMTP id r35mr2261653wep.21.1319393741465; Sun, 23 Oct 2011 11:15:41 -0700 (PDT) Received: from bigio.localnet (host139-95-dynamic.10-79-r.retail.telecomitalia.it. [79.10.95.139]) by mx.google.com with ESMTPS id fr4sm5772061wbb.0.2011.10.23.11.15.39 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 23 Oct 2011 11:15:39 -0700 (PDT) From: Stefano Lattarini To: "Ralf Wildenhues" Subject: Re: bug#9768: Makefile broken after removing included *.am file Date: Sun, 23 Oct 2011 20:15:27 +0200 User-Agent: KMail/1.13.7 (Linux/2.6.30-2-686; KDE/4.6.5; i686; ; ) References: <4AFF7774.20200@gmail.com> <20111019190654.156880@gmx.net> <201110201221.26347.stefano.lattarini@gmail.com> In-Reply-To: <201110201221.26347.stefano.lattarini@gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201110232015.28147.stefano.lattarini@gmail.com> X-Spam-Score: -3.9 (---) X-Debbugs-Envelope-To: 9768 Cc: 9768@debbugs.gnu.org, automake-patches@gnu.org, Peter Johansson X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.9 (---) Hi Ralf. On Thursday 20 October 2011, Stefano Lattarini wrote: > On Wednesday 19 October 2011, Ralf Wildenhues wrote: > > > > Am I missing something? > > > I hope so :-) -- otherwise I've completely misunderstood something > cardinal here. > Ping on this? I'd like to have this patch in 1.11.2 (unless it turns out it's completely broken, of course ;-), so the earlier we can work out our doubts and disagreements, the better. Thanks (and sorry if I'm being a little pushy), Stefano From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 22 16:21:14 2011 Received: (at 9768) by debbugs.gnu.org; 22 Nov 2011 21:21:14 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RSxmD-0005Ep-Qe for submit@debbugs.gnu.org; Tue, 22 Nov 2011 16:21:14 -0500 Received: from mail-ww0-f46.google.com ([74.125.82.46]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RSxmA-0005Eg-PL for 9768@debbugs.gnu.org; Tue, 22 Nov 2011 16:21:11 -0500 Received: by wwe3 with SMTP id 3so1063756wwe.15 for <9768@debbugs.gnu.org>; Tue, 22 Nov 2011 13:19:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; bh=S/FXZFAlZBBkdlWUM7KeWmijqdG4RNOwTP46f6CfaYo=; b=TXNAEIs8AXgCVpzpycws2psfuOy/4dCKDjCUNes8ZpHCXXgQe570HJC4lt+OW48zmv 63wN0oTVk7Qh9BI+2jp2HrkLx4tJYiSh6zK/Tav+yDjQw4SlTdrhRUlRTM6ECcuOoi2V 6wmMK7fnq8TqRcPn/oOH7lwtriXn44gxm7K58= Received: by 10.216.208.167 with SMTP id q39mr3663095weo.79.1321996788574; Tue, 22 Nov 2011 13:19:48 -0800 (PST) Received: from bigio.localnet (host196-30-dynamic.56-82-r.retail.telecomitalia.it. [82.56.30.196]) by mx.google.com with ESMTPS id l2sm18010294wbn.0.2011.11.22.13.19.45 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 Nov 2011 13:19:46 -0800 (PST) From: Stefano Lattarini To: "Ralf Wildenhues" Subject: Re: bug#9768: Makefile broken after removing included *.am file Date: Tue, 22 Nov 2011 22:19:35 +0100 User-Agent: KMail/1.13.7 (Linux/2.6.30-2-686; KDE/4.6.5; i686; ; ) References: <4AFF7774.20200@gmail.com> <201110201221.26347.stefano.lattarini@gmail.com> <201110232015.28147.stefano.lattarini@gmail.com> In-Reply-To: <201110232015.28147.stefano.lattarini@gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201111222219.35863.stefano.lattarini@gmail.com> X-Spam-Score: -3.9 (---) X-Debbugs-Envelope-To: 9768 Cc: 9768@debbugs.gnu.org, automake-patches@gnu.org, Peter Johansson X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.9 (---) On Sunday 23 October 2011, Stefano Lattarini wrote: > Hi Ralf. > > On Thursday 20 October 2011, Stefano Lattarini wrote: > > On Wednesday 19 October 2011, Ralf Wildenhues wrote: > > > > > > Am I missing something? > > > > > I hope so :-) -- otherwise I've completely misunderstood something > > cardinal here. > > > Ping on this? I'd like to have this patch in 1.11.2 (unless it turns > out it's completely broken, of course ;-), so the earlier we can work > out our doubts and disagreements, the better. > > Thanks (and sorry if I'm being a little pushy), > Stefano > For the moment, I've pushed two changes that enhance the testsuite coverage w.r.t. expected remake errors in situations/setups that might be touched by the proposed patch. See: Regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 07 17:53:18 2011 Received: (at control) by debbugs.gnu.org; 7 Dec 2011 22:53:18 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RYQMY-0000up-Hl for submit@debbugs.gnu.org; Wed, 07 Dec 2011 17:53:18 -0500 Received: from mail-ee0-f44.google.com ([74.125.83.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RYQMX-0000uj-Nq for control@debbugs.gnu.org; Wed, 07 Dec 2011 17:53:18 -0500 Received: by eekd4 with SMTP id d4so879494eek.3 for ; Wed, 07 Dec 2011 14:52:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:mime-version:content-type :content-transfer-encoding:message-id; bh=DaYSB2CghJTJRd8j8sp8BQobRc+ppUI3xYnkrfmyc9A=; b=DHJ34Gzpu7yTV5I3rfCnnHUHjQJzxayMR/fR9ijAp7iDh37vfWUBNyx7lqLdOgocic 9mYuw3sFZjsXR4Y+cBkhYp9yGDs1csWaEfCDPQ8PlUqAmamnlTGXrv5cCmWsaE72YAxF TeFc2OR6CEAmqAYaXVMlf78GMrzbkUH0fZPCk= Received: by 10.14.16.79 with SMTP id g55mr37772eeg.175.1323298351178; Wed, 07 Dec 2011 14:52:31 -0800 (PST) Received: from bigio.localnet (host167-102-dynamic.2-87-r.retail.telecomitalia.it. [87.2.102.167]) by mx.google.com with ESMTPS id 58sm11270765eet.11.2011.12.07.14.52.30 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 07 Dec 2011 14:52:30 -0800 (PST) From: Stefano Lattarini To: control@debbugs.gnu.org Subject: am Date: Wed, 7 Dec 2011 23:52:21 +0100 User-Agent: KMail/1.13.7 (Linux/2.6.30-2-686; KDE/4.6.5; i686; ; ) MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201112072352.21490.stefano.lattarini@gmail.com> X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.0 (----) severity 7610 minor severity 7766 minor severity 9625 minor severity 10248 serious severity 7884 important severity 9768 important thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 22 13:23:03 2011 Received: (at 9768-done) by debbugs.gnu.org; 22 Dec 2011 18:23:03 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RdnIB-0007uB-Kq for submit@debbugs.gnu.org; Thu, 22 Dec 2011 13:23:02 -0500 Received: from mail-ee0-f44.google.com ([74.125.83.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RdnI4-0007u0-Uv for 9768-done@debbugs.gnu.org; Thu, 22 Dec 2011 13:22:56 -0500 Received: by eekc14 with SMTP id c14so8494765eek.3 for <9768-done@debbugs.gnu.org>; Thu, 22 Dec 2011 10:20:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type; bh=WnId0YO+1RYNZvz/S3wjK+I8bXHlRsnaYXYKyQMzWhI=; b=CM2t6dhjtAihmtjdv1K4i8zi/ge2tfX7fUZKbyjoLiNj1KDA2YmdC9iRBnOEsMrN9t HtIfXC6ZWr3c5jKc4rQHmj4qnFbsakgB3id9n4ZBQPWUM3T49RpWu6hm+gewTGcpzWyG QrDtoNUTm0tEsM6ArIT87ZNLfmFWkb2C664Y0= Received: by 10.213.2.75 with SMTP id 11mr1009671ebi.134.1324578039254; Thu, 22 Dec 2011 10:20:39 -0800 (PST) Received: from [82.60.36.27] (host27-36-dynamic.60-82-r.retail.telecomitalia.it. [82.60.36.27]) by mx.google.com with ESMTPS id t59sm37121340eeh.10.2011.12.22.10.20.37 (version=SSLv3 cipher=OTHER); Thu, 22 Dec 2011 10:20:38 -0800 (PST) Message-ID: <4EF374F2.6020607@gmail.com> Date: Thu, 22 Dec 2011 19:20:34 +0100 From: Stefano Lattarini User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.24) Gecko/20111114 Icedove/3.1.16 MIME-Version: 1.0 To: Ralf Wildenhues Subject: Re: bug#9768: Makefile broken after removing included *.am file References: <4AFF7774.20200@gmail.com> <201110201221.26347.stefano.lattarini@gmail.com> <201110232015.28147.stefano.lattarini@gmail.com> <201111222219.35863.stefano.lattarini@gmail.com> In-Reply-To: <201111222219.35863.stefano.lattarini@gmail.com> X-Enigmail-Version: 1.1.2 Content-Type: multipart/mixed; boundary="------------040300020004080100000005" X-Spam-Score: -3.9 (---) X-Debbugs-Envelope-To: 9768-done Cc: 9768-done@debbugs.gnu.org, automake-patches@gnu.org, Peter Johansson X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.9 (---) This is a multi-part message in MIME format. --------------040300020004080100000005 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit References: On 11/22/2011 10:19 PM, Stefano Lattarini wrote: > > For the moment, I've pushed two changes that enhance the testsuite > coverage w.r.t. expected remake errors in situations/setups that might > be touched by the proposed patch. See: > > > > Regards, > Stefano > And I've finally applied the attached patch to fix the bug. I'm thus closing this bug report. Regards, Stefano --------------040300020004080100000005 Content-Type: text/x-diff; name="0001-include-avoid-deleted-.am-file-problem.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-include-avoid-deleted-.am-file-problem.patch" >From 9f7864ba9b8a12761db67c16025c45ed95aca47e Mon Sep 17 00:00:00 2001 Message-Id: <9f7864ba9b8a12761db67c16025c45ed95aca47e.1324578021.git.stefano.lattarini@gmail.com> From: Stefano Lattarini Date: Sun, 16 Oct 2011 14:57:37 +0200 Subject: [PATCH] include: avoid "deleted .am file" problem * automake.in (handle_configure): When processing `configure.am', also expand `HAVE-MAKEFILE-IN-DEPS' to a boolean telling whether `MAKEFILE-IN-DEPS' is empty or not. * lib/am/configure.am [?HAVE-MAKEFILE-IN-DEPS?] (%MAKEFILE-IN-DEPS%): New target without dependencies, to avoid the "deleted .am file" problem. Emit this only when `?HAVE-MAKEFILE-IN-DEPS?' is true, to avoid generating an "empty" dependency declaration. * tests/deleted-am.test: Make grepping of error message stricter. * tests/dist-missing-am.test: Likewise. * tests/remake-deleted-am.test: New test. * tests/remake-deleted-am-2.test: Likewise. * tests/remake-deleted-am-subdir.test: Likewise. * tests/remake-renamed-am.test: Likewise. * tests/makefile-deps.test: Likewise. * tests/Makefile.am (TESTS): Add the new tests. * NEWS: Update. Fixes automake bug#9768. Report by Peter Johansson. See also commit `Release-1-10-40-gd0ebf71', which fixed a similar problem for .m4 files included by configure.ac. --- ChangeLog | 25 +++++++++++ NEWS | 4 ++ automake.in | 1 + lib/am/configure.am | 3 + tests/Makefile.am | 5 ++ tests/deleted-am.test | 18 +++----- tests/dist-missing-am.test | 8 +-- tests/makefile-deps.test | 31 ++++++++++++++ tests/remake-deleted-am-2.test | 77 ++++++++++++++++++++++++++++++++++ tests/remake-deleted-am-subdir.test | 79 +++++++++++++++++++++++++++++++++++ tests/remake-deleted-am.test | 69 ++++++++++++++++++++++++++++++ tests/remake-renamed-am.test | 60 ++++++++++++++++++++++++++ 12 files changed, 363 insertions(+), 17 deletions(-) create mode 100755 tests/makefile-deps.test create mode 100755 tests/remake-deleted-am-2.test create mode 100755 tests/remake-deleted-am-subdir.test create mode 100755 tests/remake-deleted-am.test create mode 100755 tests/remake-renamed-am.test diff --git a/ChangeLog b/ChangeLog index d97d461..d630aef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +2011-12-22 Stefano Lattarini + + include: avoid "deleted .am file" problem + * automake.in (handle_configure): When processing `configure.am', + also expand `HAVE-MAKEFILE-IN-DEPS' to a boolean telling whether + `MAKEFILE-IN-DEPS' is empty or not. + * lib/am/configure.am [?HAVE-MAKEFILE-IN-DEPS?] + (%MAKEFILE-IN-DEPS%): New target without dependencies, to + avoid the "deleted .am file" problem. Emit this only when + `?HAVE-MAKEFILE-IN-DEPS?' is true, to avoid generating an + "empty" dependency declaration. + * tests/deleted-am.test: Make grepping of error message stricter. + * tests/dist-missing-am.test: Likewise. + * tests/remake-deleted-am.test: New test. + * tests/remake-deleted-am-2.test: Likewise. + * tests/remake-deleted-am-subdir.test: Likewise. + * tests/remake-renamed-am.test: Likewise. + * tests/makefile-deps.test: Likewise. + * tests/Makefile.am (TESTS): Add the new tests. + * NEWS: Update. + Fixes automake bug#9768. + Report by Peter Johansson. + See also commit `Release-1-10-40-gd0ebf71', which fixed a similar + problem for .m4 files included by configure.ac. + 2011-12-14 Stefano Lattarini tests: better handling of gettext and libtool requirements diff --git a/NEWS b/NEWS index 785d6b0..ec4ab40 100644 --- a/NEWS +++ b/NEWS @@ -82,6 +82,10 @@ Bugs fixed in 1.11.0a: * Long-standing bugs: + - The "deleted header file problem" for *.am files is avoided by stub + rules. This allows `make' to trigger a rerun of `automake' also if + some previously needed `.am' file has been removed. + - "make distcheck" now correctly complains also when "make uninstall" leaves one and only one file installed in $(prefix). diff --git a/automake.in b/automake.in index db7f3c6..309eade 100644 --- a/automake.in +++ b/automake.in @@ -4249,6 +4249,7 @@ sub handle_configure ($$$@) 'MAKEFILE-DEPS' => "@rewritten", 'CONFIG-MAKEFILE' => ($relative_dir eq '.') ? '$@' : '$(subdir)/$@', 'MAKEFILE-IN' => $rel_makefile_in, + 'HAVE-MAKEFILE-IN-DEPS' => (@include_stack > 0), 'MAKEFILE-IN-DEPS' => "@include_stack", 'MAKEFILE-AM' => $rel_makefile_am, 'AUTOMAKE-OPTIONS' => $automake_options, diff --git a/lib/am/configure.am b/lib/am/configure.am index 594ec67..cadb27c 100644 --- a/lib/am/configure.am +++ b/lib/am/configure.am @@ -83,6 +83,9 @@ endif %?TOPDIR_P% cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE% $(am__depfiles_maybe);; \ esac; +## Avoid the "deleted header file" problem for the dependencies. +?HAVE-MAKEFILE-IN-DEPS?%MAKEFILE-IN-DEPS%: + DIST_COMMON += %MAKEFILE-AM% diff --git a/tests/Makefile.am b/tests/Makefile.am index b2a61ec..7097ff7 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -555,6 +555,7 @@ maintclean.test \ maintclean-vpath.test \ maintmode-configure-msg.test \ make.test \ +makefile-deps.test \ makej.test \ makej2.test \ maken.test \ @@ -730,6 +731,10 @@ remake-subdir2.test \ remake-subdir-long-time.test \ remake-am-pr10111.test \ remake-m4-pr10111.test \ +remake-deleted-am.test \ +remake-deleted-am-2.test \ +remake-deleted-am-subdir.test \ +remake-renamed-am.test \ pr8365-remake-timing.test \ regex.test \ req.test \ diff --git a/tests/deleted-am.test b/tests/deleted-am.test index cc82e79..fa41e9e 100755 --- a/tests/deleted-am.test +++ b/tests/deleted-am.test @@ -39,12 +39,9 @@ $MAKE rm -f zardoz.am $MAKE >output 2>&1 && { cat output; Exit 1; } cat output -# FIXME: enable this stricter grepping, once bug#9768 has been taken -# FIXME: care of. -## This error will come from automake, not make, so we can be stricter -## in our grepping of it. -# grep 'cannot open.*zardoz\.am' output -grep 'zardoz\.am' output +# This error will come from automake, not make, so we can be stricter +# in our grepping of it. +grep 'cannot open.*zardoz\.am' output grep 'foobar\.am' output && Exit 1 # No spurious error, please. # Try with one less indirection. @@ -55,11 +52,8 @@ $MAKE # Sanity check. rm -f foobar.am $MAKE >output 2>&1 && { cat output; Exit 1; } cat output -# FIXME: enable this stricter grepping, once bug#9768 has been taken -# FIXME: care of. -## This error will come from automake, not make, so we can be stricter -## in our grepping of it. -# grep 'cannot open.*foobar\.am' output -grep 'foobar\.am' output +# This error will come from automake, not make, so we can be stricter +# in our grepping of it. +grep 'cannot open.*foobar\.am' output : diff --git a/tests/dist-missing-am.test b/tests/dist-missing-am.test index 49e82aa..bb404bc 100755 --- a/tests/dist-missing-am.test +++ b/tests/dist-missing-am.test @@ -58,11 +58,9 @@ for vpath in false :; do fi $MAKE >output 2>&1 && { cat output; Exit 1; } cat output -# FIXME: enable this stricter grepping, once bug#9768 has been taken -# FIXME: care of. -# # This error comes from automake, not make, so we can be stricter -# # in our grepping of it. -# grep 'cannot open.*zardoz\.am' output + # This error comes from automake, not make, so we can be stricter + # in our grepping of it. + grep 'cannot open.*zardoz\.am' output grep 'foobar\.am' output && Exit 1 # No spurious error, please. cd "$ocwd" || fatal_ "cannot chdir back to top-level test directory" done diff --git a/tests/makefile-deps.test b/tests/makefile-deps.test new file mode 100755 index 0000000..819c7d3 --- /dev/null +++ b/tests/makefile-deps.test @@ -0,0 +1,31 @@ +#! /bin/sh +# Copyright (C) 2011 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Make sure we don't emit a rule with empty target if list of +# automatically-computed dependencies for Makefile.in is empty. + +. ./defs || Exit 1 + +set -e + +: > Makefile.am + +$ACLOCAL +$AUTOMAKE + +grep "^ *:" Makefile.in && Exit 1 + +: diff --git a/tests/remake-deleted-am-2.test b/tests/remake-deleted-am-2.test new file mode 100755 index 0000000..07142f6 --- /dev/null +++ b/tests/remake-deleted-am-2.test @@ -0,0 +1,77 @@ +#! /bin/sh +# Copyright (C) 2011 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Check that inclusion of `.am' fragments by automake does not suffer +# of the "deleted header problem". This test checks deeper inclusion +# stacks, and use VPATH builds. + +. ./defs || Exit 1 + +set -e + +echo AC_OUTPUT >> configure.in + +$ACLOCAL +$AUTOCONF + +cat > Makefile.am <<'END' +include $(srcdir)/foo.am +END + +cat > foo.am <<'END' +# this is foo +include sub/bar.am +include baz.am +END + +mkdir sub +echo 'include $(top_srcdir)/sub/zardoz.am' > sub/bar.am +echo '# this is zardoz' > sub/zardoz.am + +echo 'include fnord.am' > baz.am +echo '# you are not seeing this' > fnord.am + +$AUTOMAKE +# Sanity checks. +$FGREP 'this is zardoz' Makefile.in +$FGREP 'you are not seeing this' Makefile.in + +mkdir build +cd build + +srcdir=.. + +$srcdir/configure +$MAKE + +$sleep +echo '# this is baz' > $srcdir/baz.am +rm -f $srcdir/fnord.am +$MAKE +# Sanity checks. +$FGREP 'you are not seeing this' $srcdir/Makefile.in Makefile && Exit 1 +$FGREP 'this is baz' $srcdir/Makefile.in +$FGREP 'this is baz' Makefile + +$sleep +rm -rf $srcdir/sub $srcdir/foo.am $srcdir/baz.am +echo '# no more inclusions' > $srcdir/Makefile.am +$MAKE +# Sanity checks. +$EGREP 'this is (foo|bar|baz)' Makefile $srcdir/Makefile.in && Exit 1 +$FGREP 'no more inclusions' Makefile + +: diff --git a/tests/remake-deleted-am-subdir.test b/tests/remake-deleted-am-subdir.test new file mode 100755 index 0000000..9ed1078 --- /dev/null +++ b/tests/remake-deleted-am-subdir.test @@ -0,0 +1,79 @@ +#! /bin/sh +# Copyright (C) 2011 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Check that inclusion of `.am' fragments by automake does not suffer +# of the "deleted header problem". This test does the check when the +# SUBDIRS variable is involved. + +. ./defs || Exit 1 + +set -e + +cat >> configure.in <<'END' +AC_CONFIG_FILES([sub1/Makefile sub2/Makefile]) +AC_OUTPUT +END + +$ACLOCAL +$AUTOCONF + +cat > Makefile.am <<'END' +include foo.am +SUBDIRS = sub1 sub2 +END + +echo '# this is foo.am' > foo.am + +mkdir sub1 sub2 + +echo 'include $(srcdir)/bar.am' > sub1/Makefile.am +echo '# this is bar.am' > sub1/bar.am + +echo 'include $(top_srcdir)/foo.am' > sub2/Makefile.am + +$AUTOMAKE +# Sanity checks. +$FGREP 'this is foo.am' Makefile.in +$FGREP 'this is bar.am' sub1/Makefile.in +$FGREP 'this is foo.am' sub2/Makefile.in + +./configure +$MAKE # Should be no-op. + +$sleep +echo '# this is sub1/Makefile.am' > sub1/Makefile.am +rm -f sub1/bar.am +$MAKE all +# Sanity checks. +$FGREP 'this is bar' sub1/Makefile.in sub1/Makefile && Exit 1 +$FGREP 'this is sub1/Makefile.am' sub1/Makefile.in +$FGREP 'this is sub1/Makefile.am' sub1/Makefile + +$sleep +for d in . sub2; do + sed "s|.*include.*foo\.am.*|# this is $d/Makefile.am|" $d/Makefile.am > t + mv -f t $d/Makefile.am +done +rm -f foo.am +$MAKE all +# Sanity checks. +$FGREP 'this is foo' sub*/Makefile* Makefile* && Exit 1 +for d in . sub1 sub2; do + $FGREP "this is $d/Makefile.am" $d/Makefile.in + $FGREP "this is $d/Makefile.am" $d/Makefile +done + +: diff --git a/tests/remake-deleted-am.test b/tests/remake-deleted-am.test new file mode 100755 index 0000000..fa5a672 --- /dev/null +++ b/tests/remake-deleted-am.test @@ -0,0 +1,69 @@ +#! /bin/sh +# Copyright (C) 2011 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Check that inclusion of `.am' fragments by automake does not suffer +# of the "deleted header problem". Basic checks are done here. + +. ./defs || Exit 1 + +set -e + +echo AC_OUTPUT >> configure.in + +$ACLOCAL +$AUTOCONF + +cat > Makefile.am <<'END' +include foo.am +include $(srcdir)/bar.am +include $(top_srcdir)/baz.am +END + +echo '# this is foo' > foo.am +echo '# this is bar' > bar.am +echo '# this is baz' > baz.am + +$AUTOMAKE +# Sanity checks. +$FGREP 'this is foo' Makefile.in +$FGREP 'this is bar' Makefile.in +$FGREP 'this is baz' Makefile.in + +./configure +$MAKE # Should be no-op. + +$sleep +sed '/^include foo\.am$/d' Makefile.am > t +mv -f t Makefile.am +rm -f foo.am +$MAKE Makefile +# Sanity checks. +$FGREP 'this is foo' Makefile.in Makefile && Exit 1 +$FGREP 'this is bar' Makefile.in +$FGREP 'this is bar' Makefile +$FGREP 'this is baz' Makefile.in +$FGREP 'this is baz' Makefile + +$sleep +echo '# empty empty' > Makefile.am +rm -f bar.am baz.am +$MAKE Makefile +# Sanity checks. +$FGREP 'empty empty' Makefile.in +$FGREP 'empty empty' Makefile +grep 'this is ba[rz]' Makefile Makefile.in && Exit 1 + +: diff --git a/tests/remake-renamed-am.test b/tests/remake-renamed-am.test new file mode 100755 index 0000000..b3a7a41 --- /dev/null +++ b/tests/remake-renamed-am.test @@ -0,0 +1,60 @@ +#! /bin/sh +# Copyright (C) 2011 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Check that inclusion of `.am' fragments by automake does not suffer +# of the "deleted header problem". This test checks that we can rename +# an included .am file without confusing the remake rules. + +. ./defs || Exit 1 + +set -e + +echo AC_OUTPUT >> configure.in + +cat > Makefile.am <<'END' +include foo.am +END + +cat > foo.am <<'END' +all-local: + echo ok > has-run-1 +END + +$ACLOCAL +$AUTOMAKE +$AUTOCONF + +./configure +$MAKE +test -f has-run-1 + +$sleep +rm -f has-run-1 +mv -f foo.am bar.am +echo include bar.am > Makefile.am +$MAKE Makefile +$FGREP 'foo.am' Makefile Makefile.in && Exit 1 + +$sleep +rm -f has-run-1 bar.am +echo 'all-local:; echo ok > has-run-2' > zardoz.am +echo 'include $(srcdir)/zardoz.am' > Makefile.am +using_gmake || $MAKE Makefile +$MAKE +test ! -f has-run-1 +test -f has-run-2 + +: -- 1.7.7.3 --------------040300020004080100000005-- From unknown Wed Jun 25 02:09:28 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 20 Jan 2012 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator