GNU bug report logs - #9037
distcheck should check for missing m4 files too (was: Re: bug#9026: Supporting $ACLOCAL_PATH?)

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: automake; Reported by: Stefano Lattarini <stefano.lattarini@HIDDEN>; dated Sat, 9 Jul 2011 14:58:01 UTC; Maintainer for automake is bug-automake@HIDDEN.

Message received at 9037 <at> debbugs.gnu.org:


Received: (at 9037) by debbugs.gnu.org; 9 Sep 2011 09:46:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 09 05:46:18 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1R1xf7-00011V-Tl
	for submit <at> debbugs.gnu.org; Fri, 09 Sep 2011 05:46:18 -0400
Received: from mail-ww0-f46.google.com ([74.125.82.46])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1R1xf3-00011M-RD
	for 9037 <at> debbugs.gnu.org; Fri, 09 Sep 2011 05:46:15 -0400
Received: by wwg7 with SMTP id 7so872238wwg.15
	for <9037 <at> debbugs.gnu.org>; Fri, 09 Sep 2011 02:42:09 -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
	:x-kmail-markup:mime-version:content-type:message-id;
	bh=AvPwJD1thJISC0enE0EiaNmSaBukJUfPE+QA6G3Mp/g=;
	b=rQjMIzUH+t+wJRCYA9+X93pGTPOKhlog5cwuCVudkvZRTLoH+hSvc592Bq/tWnlKrO
	GjZfE0TIC9fJB73Lt/sYH3OOrUxsJAWe2Si7F+IWyU8Xz4JkB+vKkO773d+AHQOVr/t5
	sJiz24tflHaPEgNvskgeRqGss9CRi349em0mI=
Received: by 10.227.170.139 with SMTP id d11mr1930287wbz.9.1315561329374;
	Fri, 09 Sep 2011 02:42:09 -0700 (PDT)
Received: from bigio.localnet
	(host175-94-dynamic.2-87-r.retail.telecomitalia.it [87.2.94.175])
	by mx.google.com with ESMTPS id b3sm6906005wbp.10.2011.09.09.02.42.05
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 09 Sep 2011 02:42:06 -0700 (PDT)
From: Stefano Lattarini <stefano.lattarini@HIDDEN>
To: ludo@HIDDEN
Subject: Re: bug#9037: distcheck should check for missing m4 files too
Date: Fri, 9 Sep 2011 11:41:53 +0200
User-Agent: KMail/1.13.7 (Linux/2.6.30-2-686; KDE/4.6.5; i686; ; )
References: <87wrfs7oxc.fsf@HIDDEN>
	<201107091656.44198.stefano.lattarini@HIDDEN>
	<201109011504.36101.stefano.lattarini@HIDDEN>
In-Reply-To: <201109011504.36101.stefano.lattarini@HIDDEN>
X-KMail-Markup: true
MIME-Version: 1.0
Content-Type: Multipart/Mixed;
  boundary="Boundary-00=_i9daOJD37sZP+ZO"
Message-Id: <201109091141.54755.stefano.lattarini@HIDDEN>
X-Spam-Score: -3.9 (---)
X-Debbugs-Envelope-To: 9037
Cc: Peter Johansson <trojkan@HIDDEN>, bruno@HIDDEN, 9037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -3.9 (---)

--Boundary-00=_i9daOJD37sZP+ZO
Content-Type: multipart/alternative;
  boundary="Boundary-01=_i9daO6U3V+46Oje"
Content-Transfer-Encoding: 7bit

--Boundary-01=_i9daO6U3V+46Oje
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit

On Thursday 01 September 2011, Stefano Lattarini wrote:
> Hello automakers, and sorry for the delay.
> 
> References:
>  <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9037>
>  <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9026>
> 
> [SNIP]
>
> > > There is, obviously, a risk doing this way, as mentioned above in this 
> > > thread, because if I'm not careful I may release a tarball with missing 
> > > m4 files. Would distcheck detect a missing m4 file, or would it be 
> > > possible to modify distcheck so it could warn about this case?
> > >
> > I think improving distcheck to catch such an error would be worthwhile.
> >
> OK, I've managed to come up with a test case that demonstrates how one can
> use a "distcheck-hook" to diagnose this kind of errors.  I'm not sure if
> this should integrated into the automake-generated distcheck recipe proper
> (maybe only when a new automake option, say "check-m4-distribution", is
> used?), or if we should report Peter's description of the potential
> problems with `--install' in the manual, and add our distcheck-hook there
> in a new example (to be kept synced with the new testcase).
> 
> Opinions?
> 
> Regards,
>   Stefano
>
I've recooked the patch to take advantage of the recent improvements
in maint w.r.t. `acdir' overriding (see commit `v1.11-441-g30f99cb'
"aclocal: more granularity in acdir overriding").  Since I was at it,
I've increased coverage a bit to ensure that the proposed idiom also
catch outdated .m4 files, not only missing ones.

Attached is the patch that I've pushed (to maint).  Now we should only
decide whether to document the idiom, or integrate it into distcheck
proper.

Regards,
  Stefano

--Boundary-01=_i9daO6U3V+46Oje
Content-Type: text/html;
  charset="utf-8"
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Bitstream Vera Sans Mono'; font-size:11pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">On Thursday 01 September 2011, Stefano Lattarini wrote:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; Hello automakers, and sorry for the delay.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; References:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt;  &lt;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9037&gt;</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt;  &lt;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9026&gt;</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; [SNIP]</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt;</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; &gt; There is, obviously, a risk doing this way, as mentioned above in this </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; &gt; thread, because if I'm not careful I may release a tarball with missing </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; &gt; m4 files. Would distcheck detect a missing m4 file, or would it be </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; &gt; possible to modify distcheck so it could warn about this case?</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; &gt;</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; I think improving distcheck to catch such an error would be worthwhile.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt;</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; OK, I've managed to come up with a test case that demonstrates how one can</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; use a &quot;distcheck-hook&quot; to diagnose this kind of errors.  I'm not sure if</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; this should integrated into the automake-generated distcheck recipe proper</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; (maybe only when a new automake option, say &quot;check-m4-distribution&quot;, is</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; used?), or if we should report Peter's description of the potential</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; problems with `--install' in the manual, and add our distcheck-hook there</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; in a new example (to be kept synced with the new testcase).</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; Opinions?</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; Regards,</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt;   Stefano</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt;</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">I've recooked the patch to take advantage of the recent improvements</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">in maint w.r.t. `acdir' overriding (see commit `v1.11-441-g30f99cb'</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&quot;aclocal: more granularity in acdir overriding&quot;).  Since I was at it,</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">I've increased coverage a bit to ensure that the proposed idiom also</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">catch outdated .m4 files, not only missing ones.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Attached is the patch that I've pushed (to maint).  Now we should only</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">decide whether to document the idiom, or integrate it into distcheck</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">proper.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Regards,</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">  Stefano</p></body></html>
--Boundary-01=_i9daO6U3V+46Oje--

--Boundary-00=_i9daOJD37sZP+ZO
Content-Type: text/x-patch;
  charset="utf-8";
  name="0001-coverage-distcheck-hook-to-catch-missing-outdated-.m.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline;
	filename="0001-coverage-distcheck-hook-to-catch-missing-outdated-.m.patch"

=46rom 2d5a0d87ddeaaab474e4fc1d9816feb275711384 Mon Sep 17 00:00:00 2001
Message-Id: <2d5a0d87ddeaaab474e4fc1d9816feb275711384.1315560967.git.stefan=
o.lattarini@HIDDEN>
=46rom: Stefano Lattarini <stefano.lattarini@HIDDEN>
Date: Thu, 1 Sep 2011 17:42:41 +0200
Subject: [PATCH] coverage: distcheck-hook to catch missing/outdated *.m4 fi=
les

Related to automake bug#9037.

* tests/distcheck-missing-m4.test: New test.
* tests/distcheck-outdated-m4.test: Likewise.
* tests/distcheck-hook-m4.am: New data file, used by the new
tests.
* tests/Makefile.am (distcheck-m4-missing.log,
distcheck-m4-outdated.log): Depend on it.
(EXTRA_DIST): Distribute it.
(TESTS): Add the new tests.
=2D--
 ChangeLog                        |   13 +++++
 tests/Makefile.am                |    5 ++
 tests/Makefile.in                |    7 ++-
 tests/distcheck-hook-m4.am       |   30 +++++++++++
 tests/distcheck-missing-m4.test  |  102 ++++++++++++++++++++++++++++++++++=
++++
 tests/distcheck-outdated-m4.test |   88 ++++++++++++++++++++++++++++++++
 6 files changed, 244 insertions(+), 1 deletions(-)
 create mode 100644 tests/distcheck-hook-m4.am
 create mode 100755 tests/distcheck-missing-m4.test
 create mode 100755 tests/distcheck-outdated-m4.test

diff --git a/ChangeLog b/ChangeLog
index c25b41e..696150b 100644
=2D-- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2011-09-09  Stefano Lattarini  <stefano.lattarini@HIDDEN>
+
+	coverage: distcheck-hook to catch missing/outdated *.m4 files
+	Related to automake bug#9037.
+	* tests/distcheck-missing-m4.test: New test.
+	* tests/distcheck-outdated-m4.test: Likewise.
+	* tests/distcheck-hook-m4.am: New data file, used by the new
+	tests.
+	* tests/Makefile.am (distcheck-m4-missing.log,
+	distcheck-m4-outdated.log): Depend on it.
+	(EXTRA_DIST): Distribute it.
+	(TESTS): Add the new tests.
+
 2011-09-06  Stefano Lattarini  <stefano.lattarini@HIDDEN>
=20
 	aclocal: more granularity in acdir overriding
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f01a6dd..35b96fe 100644
=2D-- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -327,6 +327,8 @@ distcheck-configure-flags-am.test \
 distcheck-configure-flags-subpkg.test \
 distcheck-hook.test \
 distcheck-hook2.test \
+distcheck-missing-m4.test \
+distcheck-outdated-m4.test \
 dmalloc.test \
 doc-parsing-buglets-colneq-subst.test \
 doc-parsing-buglets-tabs.test \
@@ -880,6 +882,9 @@ $(parallel_tests)
=20
 EXTRA_DIST =3D ChangeLog-old gen-parallel-tests $(TESTS)
=20
+distcheck-missing-m4.log distcheck-outdated-m4.log: distcheck-hook-m4.am
+EXTRA_DIST +=3D distcheck-hook-m4.am
+
 # Each test case depends on defs, aclocal, and automake.
 check_SCRIPTS =3D defs aclocal-$(APIVERSION) automake-$(APIVERSION)
=20
diff --git a/tests/Makefile.in b/tests/Makefile.in
index eed1ef9..2227ee8 100644
=2D-- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -605,6 +605,8 @@ distcheck-configure-flags-am.test \
 distcheck-configure-flags-subpkg.test \
 distcheck-hook.test \
 distcheck-hook2.test \
+distcheck-missing-m4.test \
+distcheck-outdated-m4.test \
 dmalloc.test \
 doc-parsing-buglets-colneq-subst.test \
 doc-parsing-buglets-tabs.test \
@@ -1156,7 +1158,8 @@ yflags.test \
 yflags2.test \
 $(parallel_tests)
=20
=2DEXTRA_DIST =3D ChangeLog-old gen-parallel-tests $(TESTS)
+EXTRA_DIST =3D ChangeLog-old gen-parallel-tests $(TESTS) \
+	distcheck-hook-m4.am
=20
 # Each test case depends on defs, aclocal, and automake.
 check_SCRIPTS =3D defs aclocal-$(APIVERSION) automake-$(APIVERSION)
@@ -1494,6 +1497,8 @@ $(parallel_tests): $(parallel_tests:-p.test=3D.test) =
Makefile.am
 	  < $(srcdir)/$$input >$@
 	chmod a+rx $@
=20
+distcheck-missing-m4.log distcheck-outdated-m4.log: distcheck-hook-m4.am
+
 clean-local: clean-local-check
 .PHONY: clean-local-check
 clean-local-check:
diff --git a/tests/distcheck-hook-m4.am b/tests/distcheck-hook-m4.am
new file mode 100644
index 0000000..88681e9
=2D-- /dev/null
+++ b/tests/distcheck-hook-m4.am
@@ -0,0 +1,30 @@
+## Data files for some tests.  Not used in the automake build system.
+##
+## 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 <http://www.gnu.org/licenses/>.
+
+distcheck-hook:
+	@fatal () { echo "$@: $$*" >&2; exit 1; }; \
+	$(am__cd) $(distdir) && chmod u+w . && mkdir _m4 \
+	  || fatal "cannot setup distdir"; \
+	$(ACLOCAL) -I _m4 $(ACLOCAL_AMFLAGS) --install --output=3D_am.m4 \
+	  || fatal "cannot regenerate aclocal.m4"; \
+	lst=3D`ls _m4 | tr '\012\015' '  '`; \
+	if test -n "$$lst"; then \
+	  fatal "required m4 files not distributed or outdated: $$lst"; \
+	fi; \
+	$(AUTOCONF) -o /dev/null || fatal "can't remake configure"; \
+	rm -rf _m4 _am.m4 autom4te.cache && chmod a-w . \
+	  || fatal "cannot reset distdir"
diff --git a/tests/distcheck-missing-m4.test b/tests/distcheck-missing-m4.t=
est
new file mode 100755
index 0000000..f4e0eda
=2D-- /dev/null
+++ b/tests/distcheck-missing-m4.test
@@ -0,0 +1,102 @@
+#! /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 <http://www.gnu.org/licenses/>.
+
+# Test that we can define a distcheck-hook to diagnose m4 files
+# missing from the dist tarball (interaction with `--install').
+# See automake bug#9037.
+
+. ./defs || Exit 1
+
+set -e
+
+cwd=3D`pwd` || fatal_ "cannot get current working directory"
+
+cp "$testsrcdir"/distcheck-hook-m4.am . \
+  || fatal_ "cannot fetch makefile fragment \`distcheck-hook-m4.am'"
+
+cat > Makefile.am << 'END'
+## The lack of `--install' here is meant.
+ACLOCAL_AMFLAGS =3D -I m4
+include $(srcdir)/distcheck-hook-m4.am
+END
+
+cat >> configure.in << 'END'
+dnl We *deliberately* don't use m4_pattern_forbid here.
+AC_OUTPUT
+MY_FOO
+MY_BAR
+MY_BAZ
+END
+
+mkdir m4 acdir acdir1 acdir2
+
+cat > acdir/dirlist << END
+$cwd/acdir1
+$cwd/acdir2
+END
+
+echo 'AC_DEFUN([MY_FOO], [:])' > m4/foo.m4
+echo 'AC_DEFUN([MY_BAR], [:])' > acdir1/bar.m4
+echo 'AC_DEFUN([MY_BAZ], [:])' > acdir1/baz.m4
+echo 'AC_DEFUN([MY_QUX], [:])' > acdir2/qux.m4
+
+ACLOCAL=3D"$ACLOCAL --system-acdir=3D$cwd/acdir"; export ACLOCAL
+
+# We don't use `--install' here.  Our distcheck-hook should catch this.
+$ACLOCAL -I m4
+$AUTOCONF
+$EGREP 'MY_(FOO|BAR|BAZ)' configure && Exit 1 # Sanity check.
+$AUTOMAKE
+
+./configure
+
+$MAKE distcheck >output 2>&1 && { cat output; Exit 1; }
+cat output
+$EGREP "required m4 file.*not distributed.* bar.m4( |$)" output
+$EGREP "required m4 file.*not distributed.* baz.m4( |$)" output
+# Check that we don't fail for spurious errors.
+$EGREP -i 'mkdir:|autom4te.*\.cache|:.*(permission|denied)' output && Exit=
 1
+
+# Now we use `--install', and "make distcheck" should pass.
+$ACLOCAL -I m4 --install
+test -f m4/bar.m4 # Sanity check.
+test -f m4/baz.m4 # Likewise.
+using_gmake || $MAKE Makefile
+$MAKE distcheck
+
+# We start to use a new "third-party" macro from a new .m4 file, but forget
+# to re-run "aclocal --install" by hand, relying on automatic remake rules.
+# Our distcheck-hook should catch this too.
+echo MY_QUX >> configure.in
+
+$MAKE
+$EGREP 'MY_(FOO|BAR|BAZ|QUX)' configure && Exit 1 # Sanity check.
+
+$MAKE distcheck >output 2>&1 && { cat output; Exit 1; }
+cat output
+$EGREP "required m4 file.*not distributed.* qux.m4( |$)" output
+# Check that we don't fail for spurious errors.
+$EGREP -i 'mkdir:|autom4te.*\.cache|permission|denied' output && Exit 1
+# Check that we don't complain for files that should have been found.
+grep " ba[rz].m4" output && Exit 1
+
+# Now we again use `--install', and "make distcheck" should pass.
+$ACLOCAL -I m4 --install
+test -f m4/qux.m4 # Sanity check.
+using_gmake || $MAKE Makefile
+$MAKE distcheck
+
+:
diff --git a/tests/distcheck-outdated-m4.test b/tests/distcheck-outdated-m4=
=2Etest
new file mode 100755
index 0000000..74f2922
=2D-- /dev/null
+++ b/tests/distcheck-outdated-m4.test
@@ -0,0 +1,88 @@
+#! /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 <http://www.gnu.org/licenses/>.
+
+# Test that we can define a distcheck-hook to diagnose outdated m4
+# files in a dist tarball (interaction with `--install').
+# See automake bug#9037.
+
+. ./defs || Exit 1
+
+set -e
+
+cwd=3D`pwd` || fatal_ "cannot get current working directory"
+
+cp "$testsrcdir"/distcheck-hook-m4.am . \
+  || fatal_ "cannot fetch makefile fragment \`distcheck-hook-m4.am'"
+
+cat > Makefile.am << 'END'
+## The lack of `--install' here is meant.
+ACLOCAL_AMFLAGS =3D -I m4
+include $(srcdir)/distcheck-hook-m4.am
+END
+
+cat >> configure.in << 'END'
+AC_OUTPUT
+MY_FOO
+MY_BAR
+MY_BAZ
+END
+
+mkdir m4 acdir
+echo 'AC_DEFUN([MY_FOO], [:])' > m4/foo.m4
+echo 'AC_DEFUN([MY_BAR], [:])' > acdir/bar.m4
+cat > acdir/baz.m4 << 'END'
+# serial 1
+AC_DEFUN([MY_BAZ], [:])
+END
+
+ACLOCAL=3D"$ACLOCAL --system-acdir=3D$cwd/acdir"; export ACLOCAL
+
+# We don't use `--install' here.  Our distcheck-hook should catch this.
+$ACLOCAL -I m4 --install
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+$MAKE distcheck # Sanity check.
+
+# We start to use a new "third-party" macro in a new version
+# of a pre-existing third-party m4 file, but forget to re-run
+# "aclocal --install" by hand, relying on automatic remake
+# rules.  Our distcheck-hook should catch this too.
+echo MY_ZARDOZ >> configure.in
+
+cat > acdir/baz.m4 << 'END'
+# serial 2
+AC_DEFUN([MY_BAZ], [:])
+AC_DEFUN([MY_ZARDOZ], [:])
+END
+
+$MAKE # Rebuild configure and makefiles.
+$MAKE distcheck >output 2>&1 && { cat output; Exit 1; }
+cat output
+
+$EGREP "required m4 file.* outdated.* baz.m4( |$)" output
+# Check that we don't fail for spurious errors.
+$EGREP -i 'mkdir:|autom4te.*\.cache|permission|denied' output && Exit 1
+# Check that we don't complain for files that should have been found.
+$EGREP " (foo|bar).m4" output && Exit 1
+
+# Now we again use `--install', and "make distcheck" should pass.
+$ACLOCAL -I m4 --install
+using_gmake || $MAKE Makefile
+$MAKE distcheck
+
+:
=2D-=20
1.7.2.3


--Boundary-00=_i9daOJD37sZP+ZO--




Information forwarded to owner <at> debbugs.gnu.org, bug-automake@HIDDEN:
bug#9037; Package automake. Full text available.

Message received at 9037 <at> debbugs.gnu.org:


Received: (at 9037) by debbugs.gnu.org; 1 Sep 2011 13:08:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 01 09:08:14 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Qz70A-0004tE-1P
	for submit <at> debbugs.gnu.org; Thu, 01 Sep 2011 09:08:14 -0400
Received: from mail-ey0-f176.google.com ([209.85.215.176])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1Qz706-0004t4-9j
	for 9037 <at> debbugs.gnu.org; Thu, 01 Sep 2011 09:08:12 -0400
Received: by eyz10 with SMTP id 10so1793628eyz.21
	for <9037 <at> debbugs.gnu.org>; Thu, 01 Sep 2011 06:04:50 -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
	:x-kmail-markup:mime-version:content-type:message-id;
	bh=NItdRMZDIBgLS+xZhcE1+mSSlHvVeQ7Pc3+Y+0pp4Xg=;
	b=J1IJQRU4pL3Kwe3r+YdhxmDPgBUohm9G7grpRWJIkcm/JlxU4Gb6eF46ok9x0AoW0i
	v7SpycH9O2kaQLfj8jz7mYPIt7u5UTSzYxZbcZDxB2EVsyzADfgW3/B6oe93nJCasRnp
	JCDDNQYZV28xMoyvjjlhvn6fkvpaAN8NclzU4=
Received: by 10.213.29.74 with SMTP id p10mr63109ebc.48.1314882290747;
	Thu, 01 Sep 2011 06:04:50 -0700 (PDT)
Received: from bigio.localnet
	(host103-28-dynamic.56-82-r.retail.telecomitalia.it [82.56.28.103])
	by mx.google.com with ESMTPS id n15sm20083eef.5.2011.09.01.06.04.45
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 01 Sep 2011 06:04:46 -0700 (PDT)
From: Stefano Lattarini <stefano.lattarini@HIDDEN>
To: ludo@HIDDEN
Subject: Re: bug#9037: distcheck should check for missing m4 files too
Date: Thu, 1 Sep 2011 15:04:34 +0200
User-Agent: KMail/1.13.7 (Linux/2.6.30-2-686; KDE/4.6.5; i686; ; )
References: <87wrfs7oxc.fsf@HIDDEN> <4E18683A.5050406@HIDDEN>
	<201107091656.44198.stefano.lattarini@HIDDEN>
In-Reply-To: <201107091656.44198.stefano.lattarini@HIDDEN>
X-KMail-Markup: true
MIME-Version: 1.0
Content-Type: Multipart/Mixed;
  boundary="Boundary-00=_kL4XOqLMZa6Fmlr"
Message-Id: <201109011504.36101.stefano.lattarini@HIDDEN>
X-Spam-Score: -3.9 (---)
X-Debbugs-Envelope-To: 9037
Cc: Peter Johansson <trojkan@HIDDEN>, bruno@HIDDEN, 9037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -3.8 (---)

--Boundary-00=_kL4XOqLMZa6Fmlr
Content-Type: multipart/alternative;
  boundary="Boundary-01=_jL4XOQWuq5X4N9F"
Content-Transfer-Encoding: 7bit

--Boundary-01=_jL4XOQWuq5X4N9F
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit

Hello automakers, and sorry for the delay.

References:
 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9037>
 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9026>

On Saturday 09 July 2011, Stefano Lattarini wrote:
> On Saturday 09 July 2011, Peter Johansson wrote:
> > Hi Bruno,
> > 
> > On 7/8/11 5:24 PM, Bruno Haible wrote:
> > > +If you are using GNU @code{automake} 1.10 or newer, it is even easier:
> > > +Add the line
> > > +
> > > +@example
> > > +ACLOCAL_AMFLAGS = --install -I m4
> > > +@end example
> > > +
> > > +@noindent
> > > +to your top level @file{Makefile.am}, and run @samp{aclocal --install -I m4}.
> > > +This will copy the needed files to the @file{m4/} subdirectory automatically,
> > > +before updating @file{aclocal.m4}.
> > > +
> > I used to do this as it is an easy way to stay up to date with 3rd party 
> > m4 files. I stopped doing this, however, after Ralf Wildenhues made me 
> > aware there is a risk doing so. The risk is that aclocal will copy 3rd 
> > party m4 files into m4 not only for you but also for your users if they 
> > happen to run aclocal. Say, e.g., that a user want to build a somewhat 
> > old version of your package from git; he bootstraps and as he has newer 
> > versions of the m4 files available on his system aclocal copies them 
> > into m4, which may cause problems as they are not necessarily compatible 
> > with your configure.ac. To avoid this from happen, I've removed the 
> > --install flag from my packages and calls aclocal --install -I m4 
> > frequently instead.
> >
> Oh, good point, I hadn't thought about the precise semantics of `--install'
> when I wrote my answer.
> 
> > There is, obviously, a risk doing this way, as mentioned above in this 
> > thread, because if I'm not careful I may release a tarball with missing 
> > m4 files. Would distcheck detect a missing m4 file, or would it be 
> > possible to modify distcheck so it could warn about this case?
> >
> I think improving distcheck to catch such an error would be worthwhile.
>
OK, I've managed to come up with a test case that demonstrates how one can
use a "distcheck-hook" to diagnose this kind of errors.  I'm not sure if
this should integrated into the automake-generated distcheck recipe proper
(maybe only when a new automake option, say "check-m4-distribution", is
used?), or if we should report Peter's description of the potential
problems with `--install' in the manual, and add our distcheck-hook there
in a new example (to be kept synced with the new testcase).

Opinions?

Regards,
  Stefano

--Boundary-01=_jL4XOQWuq5X4N9F
Content-Type: text/html;
  charset="utf-8"
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Bitstream Vera Sans Mono'; font-size:11pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Hello automakers, and sorry for the delay.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">References:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> &lt;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9037&gt;</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> &lt;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9026&gt;</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">On Saturday 09 July 2011, Stefano Lattarini wrote:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; On Saturday 09 July 2011, Peter Johansson wrote:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; Hi Bruno,</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; On 7/8/11 5:24 PM, Bruno Haible wrote:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; &gt; +If you are using GNU @code{automake} 1.10 or newer, it is even easier:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; &gt; +Add the line</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; &gt; +</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; &gt; +@example</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; &gt; +ACLOCAL_AMFLAGS = --install -I m4</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; &gt; +@end example</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; &gt; +</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; &gt; +@noindent</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; &gt; +to your top level @file{Makefile.am}, and run @samp{aclocal --install -I m4}.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; &gt; +This will copy the needed files to the @file{m4/} subdirectory automatically,</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; &gt; +before updating @file{aclocal.m4}.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; &gt; +</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; I used to do this as it is an easy way to stay up to date with 3rd party </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; m4 files. I stopped doing this, however, after Ralf Wildenhues made me </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; aware there is a risk doing so. The risk is that aclocal will copy 3rd </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; party m4 files into m4 not only for you but also for your users if they </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; happen to run aclocal. Say, e.g., that a user want to build a somewhat </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; old version of your package from git; he bootstraps and as he has newer </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; versions of the m4 files available on his system aclocal copies them </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; into m4, which may cause problems as they are not necessarily compatible </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; with your configure.ac. To avoid this from happen, I've removed the </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; --install flag from my packages and calls aclocal --install -I m4 </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; frequently instead.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt;</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; Oh, good point, I hadn't thought about the precise semantics of `--install'</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; when I wrote my answer.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; There is, obviously, a risk doing this way, as mentioned above in this </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; thread, because if I'm not careful I may release a tarball with missing </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; m4 files. Would distcheck detect a missing m4 file, or would it be </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; possible to modify distcheck so it could warn about this case?</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt;</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; I think improving distcheck to catch such an error would be worthwhile.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt;</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">OK, I've managed to come up with a test case that demonstrates how one can</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">use a &quot;distcheck-hook&quot; to diagnose this kind of errors.  I'm not sure if</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">this should integrated into the automake-generated distcheck recipe proper</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">(maybe only when a new automake option, say &quot;check-m4-distribution&quot;, is</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">used?), or if we should report Peter's description of the potential</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">problems with `--install' in the manual, and add our distcheck-hook there</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">in a new example (to be kept synced with the new testcase).</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Opinions?</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Regards,</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">  Stefano</p></body></html>
--Boundary-01=_jL4XOQWuq5X4N9F--

--Boundary-00=_kL4XOqLMZa6Fmlr
Content-Type: application/x-shellscript;
  name="distcheck-m4.test"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
	filename="distcheck-m4.test"

#! /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 <http://www.gnu.org/licenses/>.

# Test that we can define a distcheck-hook to diagnose m4 files missing
# from the dist tarball.
# See automake bug#9037.

. ./defs || Exit 1

set -e

cwd=`pwd`

cat > Makefile.am << 'END'
## The lack of `--install' here is meant.
ACLOCAL_AMFLAGS = -I m4

distcheck-hook:
	@fatal () { echo "$@: $$*" >&2; exit 1; }; \
	$(am__cd) $(distdir) && chmod u+w . && mkdir _m4 \
	  || fatal "cannot setup distdir"; \
	$(ACLOCAL) -I _m4 $(ACLOCAL_AMFLAGS) --install --output=_am.m4 \
	  || fatal "cannot regenerate aclocal.m4"; \
	lst=`ls _m4 | tr '\012\015' '  '`; \
	if test -n "$$lst"; then \
	  fatal "required m4 files not distributed: $$lst"; \
	fi; \
	rm -rf _m4 _am.m4 autom4te.cache && chmod a-w . \
	  || fatal "cannot reset distdir"
END

cat >> configure.in << 'END'
AC_OUTPUT
MY_FOO
MY_BAR
MY_BAZ
END

# We need absolute paths in dirlist.
mkdir acdir
cp "$testsrcdir/../m4/"*.m4 acdir
echo "$cwd/dirlist1" > acdir/dirlist
echo "$cwd/dirlist2" >> acdir/dirlist

mkdir m4 dirlist1 dirlist2
echo 'AC_DEFUN([MY_FOO], [:])' > m4/foo.m4
echo 'AC_DEFUN([MY_BAR], [:])' > dirlist1/bar.m4
echo 'AC_DEFUN([MY_BAZ], [:])' > dirlist1/baz.m4
echo 'AC_DEFUN([MY_QUX], [:])' > dirlist2/qux.m4

# FIXME: Gross hacks to work around the limitations of our wrapper scripts.
# FIXME: We should really improve those scripts ...
mkdir bin
cat > bin/aclocal-$APIVERSION <<END
#!/bin/sh
PATH='$PATH'; export PATH
case \$1 in
  -I)
    ACLOCAL_TESTSUITE_FLAGS="-I \$2"; export ACLOCAL_TESTSUITE_FLAGS
    shift; shift; 
    ;;
esac
exec $ACLOCAL --acdir "$cwd/acdir" \${1+"\$@"}
END
chmod a+x bin/aclocal-$APIVERSION
cp bin/aclocal-$APIVERSION bin/aclocal
PATH=$cwd/bin$PATH_SEPARATOR$PATH; export PATH
ACLOCAL=aclocal-$APIVERSION; export ACLOCAL
ACLOCAL_TESTSUITE_FLAGS="-I m4"; export ACLOCAL_TESTSUITE_FLAGS

# We don't use `--install' here.  Our distcheck-hook should catch this.
$ACLOCAL
$AUTOCONF
$EGREP 'MY_(FOO|BAR|BAZ)' configure && Exit 1 # Sanity check.
$AUTOMAKE

./configure

$MAKE distcheck >output 2>&1 && { cat output; Exit 1; }
cat output
$EGREP "required m4 file.*not distributed:.* bar.m4( |$)" output
$EGREP "required m4 file.*not distributed:.* baz.m4( |$)" output
# Check that we don't fail for spurious errors.
$EGREP -i 'mkdir:|autom4te.*\.cache|permission|denied' output && Exit 1

# Now we use `--install', and "make distcheck" should pass.
$ACLOCAL -I m4 --install
test -f m4/bar.m4 # Sanity check.
test -f m4/baz.m4 # Likewise.
using_gmake || $MAKE Makefile
$MAKE distcheck

# We start to use a new "third-party" macro, but forget to re-run
# "aclocal --install" by hand, relying on automatic remake rules.
# Our distcheck-hook should catch this too.
echo MY_QUX >> configure.in

$MAKE
$EGREP 'MY_(FOO|BAR|BAZ|QUX)' configure && Exit 1 # Sanity check.

$MAKE distcheck >output 2>&1 && { cat output; Exit 1; }
cat output
$EGREP "required m4 file.*not distributed:.* qux.m4( |$)" output
# Check that we don't fail for spurious errors.
$EGREP -i 'mkdir:|autom4te.*\.cache|permission|denied' output && Exit 1
# Check that we don't ciomplain for files that should have been found.
grep " ba[rz].m4" output && Exit 1

# Now we again use `--install', and "make distcheck" should pass.
$ACLOCAL -I m4 --install
test -f m4/qux.m4 # Sanity check.
using_gmake || $MAKE Makefile
$MAKE distcheck

:

--Boundary-00=_kL4XOqLMZa6Fmlr--




Information forwarded to owner <at> debbugs.gnu.org, bug-automake@HIDDEN:
bug#9037; Package automake. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 9 Jul 2011 14:57:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 09 10:57:30 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1QfYyH-0002FB-FJ
	for submit <at> debbugs.gnu.org; Sat, 09 Jul 2011 10:57:29 -0400
Received: from eggs.gnu.org ([140.186.70.92])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1QfYyG-0002F0-BV
	for submit <at> debbugs.gnu.org; Sat, 09 Jul 2011 10:57:28 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1QfYy8-00078o-SG
	for submit <at> debbugs.gnu.org; Sat, 09 Jul 2011 10:57:22 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	RCVD_IN_DNSWL_LOW,T_DKIM_INVALID autolearn=unavailable version=3.3.1
Received: from lists.gnu.org ([140.186.70.17]:51929)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1QfYy8-00078k-L0
	for submit <at> debbugs.gnu.org; Sat, 09 Jul 2011 10:57:20 -0400
Received: from eggs.gnu.org ([140.186.70.92]:46765)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1QfYy7-0005Ah-3W
	for bug-automake@HIDDEN; Sat, 09 Jul 2011 10:57:20 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1QfYy5-00078T-T6
	for bug-automake@HIDDEN; Sat, 09 Jul 2011 10:57:18 -0400
Received: from mail-wy0-f169.google.com ([74.125.82.169]:35858)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <stefano.lattarini@HIDDEN>)
	id 1QfYy2-000785-L5; Sat, 09 Jul 2011 10:57:14 -0400
Received: by wyg36 with SMTP id 36so2232017wyg.0
	for <multiple recipients>; Sat, 09 Jul 2011 07:57:13 -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=uoH+0Q9+MA4ofvox5VA6BBff/545sDY//Cm99JgJjqs=;
	b=kjEnlGlSdeAAVSbbKJGM6Wsv9EEFT7TGUBzBGWPKOwd0YtA8focXTn+YnE4QjTTyTy
	Jniks6/Xa5kaEr1lug4/xl23vRnZxkHOuWd4ovm5LPwjB+Izw7ccszROlEGGs5ETV3r4
	aSzfuhCi175eQ8JkWDYXy1qEbPc3EizmWBN/o=
Received: by 10.216.178.206 with SMTP id f56mr2593153wem.114.1310223433186;
	Sat, 09 Jul 2011 07:57:13 -0700 (PDT)
Received: from bigio.localnet
	(host249-94-dynamic.7-79-r.retail.telecomitalia.it [79.7.94.249])
	by mx.google.com with ESMTPS id g2sm5931668weg.14.2011.07.09.07.57.11
	(version=TLSv1/SSLv3 cipher=OTHER);
	Sat, 09 Jul 2011 07:57:12 -0700 (PDT)
From: Stefano Lattarini <stefano.lattarini@HIDDEN>
To: Peter Johansson <trojkan@HIDDEN>
Subject: distcheck should check for missing m4 files too (was: Re: bug#9026:
	Supporting $ACLOCAL_PATH?)
Date: Sat, 9 Jul 2011 16:56:43 +0200
User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )
References: <87wrfs7oxc.fsf@HIDDEN> <201107082324.55185.bruno@HIDDEN>
	<4E18683A.5050406@HIDDEN>
In-Reply-To: <4E18683A.5050406@HIDDEN>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201107091656.44198.stefano.lattarini@HIDDEN>
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.9 (----)
X-Debbugs-Envelope-To: submit
Cc: 9026 <at> debbugs.gnu.org, ludo@HIDDEN, bug-automake@HIDDEN,
	Bruno Haible <bruno@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -5.0 (-----)

On Saturday 09 July 2011, Peter Johansson wrote:
> Hi Bruno,
> 
> On 7/8/11 5:24 PM, Bruno Haible wrote:
> > +If you are using GNU @code{automake} 1.10 or newer, it is even easier:
> > +Add the line
> > +
> > +@example
> > +ACLOCAL_AMFLAGS = --install -I m4
> > +@end example
> > +
> > +@noindent
> > +to your top level @file{Makefile.am}, and run @samp{aclocal --install -I m4}.
> > +This will copy the needed files to the @file{m4/} subdirectory automatically,
> > +before updating @file{aclocal.m4}.
> > +
> I used to do this as it is an easy way to stay up to date with 3rd party 
> m4 files. I stopped doing this, however, after Ralf Wildenhues made me 
> aware there is a risk doing so. The risk is that aclocal will copy 3rd 
> party m4 files into m4 not only for you but also for your users if they 
> happen to run aclocal. Say, e.g., that a user want to build a somewhat 
> old version of your package from git; he bootstraps and as he has newer 
> versions of the m4 files available on his system aclocal copies them 
> into m4, which may cause problems as they are not necessarily compatible 
> with your configure.ac. To avoid this from happen, I've removed the 
> --install flag from my packages and calls aclocal --install -I m4 
> frequently instead.
>
Oh, good point, I hadn't thought about the precise semantics of `--install'
when I wrote my answer.

> There is, obviously, a risk doing this way, as mentioned above in this 
> thread, because if I'm not careful I may release a tarball with missing 
> m4 files. Would distcheck detect a missing m4 file, or would it be 
> possible to modify distcheck so it could warn about this case?
>
I think improving distcheck to catch such an error would be worthwhile.
I'm not sure how easy or difficult that would be, though, and I can't
look into it right now; so I'm opening a new bug report to make sure we
won't forget about the issue.

Thanks,
  Stefano




Acknowledgement sent to Stefano Lattarini <stefano.lattarini@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-automake@HIDDEN. Full text available.
Report forwarded to owner <at> debbugs.gnu.org, bug-automake@HIDDEN:
bug#9037; Package automake. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

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