GNU bug report logs - #8360
distcheck-hook never called

Previous Next

Package: automake;

Reported by: pitamila <at> free.fr

Date: Mon, 28 Mar 2011 07:20:03 UTC

Severity: normal

Tags: patch

Done: Stefano Lattarini <stefano.lattarini <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8360 in the body.
You can then email your comments to 8360 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-automake <at> gnu.org:
bug#8360; Package automake. (Mon, 28 Mar 2011 07:20:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to pitamila <at> free.fr:
New bug report received and forwarded. Copy sent to bug-automake <at> gnu.org. (Mon, 28 Mar 2011 07:20:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: pitamila <at> free.fr
To: bug-automake <at> gnu.org
Subject: distcheck-hook never called
Date: Mon, 28 Mar 2011 09:17:09 +0200 (CEST)
Hi,

I'd like to make a rpm buildpackage in my distcheck-hook rule.
My 'distcheck-hook' rule in my root Makefile.am is never called.
I tryed to define a 'distcheck-local' too without success.
Is there something more to know than 14.4 of automake manual?

thx for support

Pitamila

PS: I use automake  1.9.6 on redhat 5.6




Information forwarded to owner <at> debbugs.gnu.org, bug-automake <at> gnu.org:
bug#8360; Package automake. (Mon, 28 Mar 2011 17:56:02 GMT) Full text and rfc822 format available.

Message #8 received at 8360 <at> debbugs.gnu.org (full text, mbox):

From: Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de>
To: pitamila <at> free.fr
Cc: 8360 <at> debbugs.gnu.org
Subject: Re: bug#8360: distcheck-hook never called
Date: Mon, 28 Mar 2011 19:55:29 +0200
Hello Pitamila,

thanks for the report.

* pitamila <at> free.fr wrote on Mon, Mar 28, 2011 at 09:17:09AM CEST:
> I'd like to make a rpm buildpackage in my distcheck-hook rule.
> My 'distcheck-hook' rule in my root Makefile.am is never called.
> I tryed to define a 'distcheck-local' too without success.
> Is there something more to know than 14.4 of automake manual?

Can you show the Makefile.am file?  distcheck-hook should work.

> PS: I use automake  1.9.6 on redhat 5.6

Wow, that's six years old.  Consider upgrading.  Still, it should
work even with that version.

Cheers,
Ralf




Information forwarded to owner <at> debbugs.gnu.org, bug-automake <at> gnu.org:
bug#8360; Package automake. (Sat, 09 Apr 2011 11:28:02 GMT) Full text and rfc822 format available.

Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de>
To: pitamila <at> free.fr
Cc: bug-automake <at> gnu.org
Subject: Re: bug#8360: distcheck-hook never called
Date: Sat, 9 Apr 2011 13:11:58 +0200
Hello Pitamila,

let's keep the mailing list in Cc:, please.  I would've seen your reply
earlier then.

* pitamila <at> free.fr wrote on Mon, Apr 04, 2011 at 04:02:53PM CEST:
> ----- "Ralf Wildenhues" a écrit :
> > 
> > thanks for the report.
> 
> thanks for the support, I hope my answer is not too late.

There's (almost) never a "too late" when giving useful feedback!

> > * pitamila <at> free.fr wrote on Mon, Mar 28, 2011 at 09:17:09AM CEST:
> > > I'd like to make a rpm buildpackage in my distcheck-hook rule.
> > > My 'distcheck-hook' rule in my root Makefile.am is never called.
> > > I tryed to define a 'distcheck-local' too without success.
> > > Is there something more to know than 14.4 of automake manual?
> > 
> > Can you show the Makefile.am file?  distcheck-hook should work.
> 
> Find attached the Makefile.am of my doc/ subdir
> In fact I try to call a clean-local without success (I suppose
> it's the same bug than my distcheck-local not beeing called
> in my top Makefile.am)

Yep.  And you have indeed stumbled over a limitation in automake;
I could call it a bug, but I'm inclined to document it rather than
fix it as it is worked around easily.

Quoting your Makefile.am:

clean-local	:
		-rm -rf html/* html @PACKAGE@.pdf latex/* latex

There is a literal TAB after 'clean-local'.  automake's parser is pretty
dumb when it comes to distinguishing rule commands from rule lines from
variable assignments, mostly because it is hard to get things right when
hard-core GNU make code is used.

Anyway, in this case it gets things wrong due to the TAB.  Solution is
to remove the TAB before the colon, maybe replacing it with a number of
spaces.  Then everything will work out fine.

OK to add you to THANKS for the eventual documentation patch I've yet to
write?

Thanks again for the report,
Ralf




Information forwarded to owner <at> debbugs.gnu.org, bug-automake <at> gnu.org:
bug#8360; Package automake. (Sat, 09 Apr 2011 11:28:02 GMT) Full text and rfc822 format available.

Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de>
To: pitamila <at> free.fr
Cc: bug-automake <at> gnu.org
Subject: Re: bug#8360: distcheck-hook never called
Date: Sat, 9 Apr 2011 13:12:35 +0200
* Ralf Wildenhues wrote on Sat, Apr 09, 2011 at 01:11:58PM CEST:
> OK to add you to THANKS for the eventual documentation patch I've yet to
> write?

Can we have a full name for that too?




Information forwarded to owner <at> debbugs.gnu.org, bug-automake <at> gnu.org:
bug#8360; Package automake. (Thu, 01 Sep 2011 18:59:01 GMT) Full text and rfc822 format available.

Message #17 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
To: pitamila <at> free.fr,
 bug-automake <at> gnu.org
Cc: Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de>, automake-patches <at> gnu.org
Subject: Re: bug#8360: distcheck-hook never called
Date: Thu, 1 Sep 2011 20:12:37 +0200
[Message part 1 (text/plain, inline)]
Resurrecting an old thread, for reference see:
  <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8360>

On Saturday 09 April 2011, Ralf Wildenhues wrote:
> Hello Pitamila,
> 
> let's keep the mailing list in Cc:, please.  I would've seen your reply
> earlier then.
> 
> * pitamila <at> free.fr wrote on Mon, Apr 04, 2011 at 04:02:53PM CEST:
> > ----- "Ralf Wildenhues" a écrit :
> > > 
> > > thanks for the report.
> > 
> > thanks for the support, I hope my answer is not too late.
> 
> There's (almost) never a "too late" when giving useful feedback!
> 
> > > * pitamila <at> free.fr wrote on Mon, Mar 28, 2011 at 09:17:09AM CEST:
> > > > I'd like to make a rpm buildpackage in my distcheck-hook rule.
> > > > My 'distcheck-hook' rule in my root Makefile.am is never called.
> > > > I tryed to define a 'distcheck-local' too without success.
> > > > Is there something more to know than 14.4 of automake manual?
> > > 
> > > Can you show the Makefile.am file?  distcheck-hook should work.
> > 
> > Find attached the Makefile.am of my doc/ subdir
> > In fact I try to call a clean-local without success (I suppose
> > it's the same bug than my distcheck-local not beeing called
> > in my top Makefile.am)
> 
> Yep.  And you have indeed stumbled over a limitation in automake;
> I could call it a bug, but I'm inclined to document it rather than
> fix it as it is worked around easily.
> 
> Quoting your Makefile.am:
> 
> clean-local	:
> 		-rm -rf html/* html @PACKAGE@.pdf latex/* latex
> 
> There is a literal TAB after 'clean-local'.  automake's parser is pretty
> dumb when it comes to distinguishing rule commands from rule lines from
> variable assignments, mostly because it is hard to get things right when
> hard-core GNU make code is used.
> 
> Anyway, in this case it gets things wrong due to the TAB.  Solution is
> to remove the TAB before the colon, maybe replacing it with a number of
> spaces.  Then everything will work out fine.
> 
I've ended up writing a documentation patch for this, as well for another
unrelated limitation encountered by Roberto Bagnara in an older thread on
the automake list, see:
  <http://lists.gnu.org/archive/html/automake/2010-08/msg00074.html>
Since I was at it, I've written two tests verifying the documented
behaviour.

I will wait a few hours before pushing (to maint), to allow for reviews.

Regards,
  Stefano
[Message part 2 (text/html, inline)]
[0001-docs-report-few-more-automake-parsing-limitations.patch (text/x-patch, inline)]
From 00e845afb826107a14db247a465eefea728f9bc5 Mon Sep 17 00:00:00 2001
Message-Id: <00e845afb826107a14db247a465eefea728f9bc5.1314900069.git.stefano.lattarini <at> gmail.com>
From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Date: Thu, 1 Sep 2011 19:17:39 +0200
Subject: [PATCH] docs: report few more automake parsing limitations

Partly motivated by automake bug#8360.

* doc/automake.texi (General Operation): Report few more automake
limitations w.r.t. parsing of unusual makefile constructs.  Related
minor reorderings.
* tests/doc-parsing-buglets-colneq-subst.test: New test.
* tests/doc-parsing-buglets-tabs.test: Likewise.
* tests/Makefile.am (TESTS): Update.
---
 ChangeLog                                   |   11 +++++
 doc/automake.texi                           |   26 +++++++++--
 tests/Makefile.am                           |    2 +
 tests/Makefile.in                           |    2 +
 tests/doc-parsing-buglets-colneq-subst.test |   39 ++++++++++++++++
 tests/doc-parsing-buglets-tabs.test         |   64 +++++++++++++++++++++++++++
 6 files changed, 139 insertions(+), 5 deletions(-)
 create mode 100755 tests/doc-parsing-buglets-colneq-subst.test
 create mode 100755 tests/doc-parsing-buglets-tabs.test

diff --git a/ChangeLog b/ChangeLog
index 7c11ab3..5d0eda1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-09-01  Stefano Lattarini  <stefano.lattarini <at> gmail.com>
+
+	docs: report few more automake parsing limitations
+	Partly motivated by automake bug#8360.
+	* doc/automake.texi (General Operation): Report few more automake
+	limitations w.r.t. parsing of unusual makefile constructs.  Related
+	minor reorderings.
+	* tests/doc-parsing-buglets-colneq-subst.test: New test.
+	* tests/doc-parsing-buglets-tabs.test: Likewise.
+	* tests/Makefile.am (TESTS): Update.
+
 2011-08-25  Stefano Lattarini  <stefano.lattarini <at> gmail.com>
 
 	tests: list "forgotten" test script in TESTS
diff --git a/doc/automake.texi b/doc/automake.texi
index 49a6cd1..3be8578 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -1813,14 +1813,30 @@ supported.  This operator appends its right hand argument to the variable
 specified on the left.  Automake will translate the operator into
 an ordinary @samp{=} operator; @samp{+=} will thus work with any make program.
 
-@cindex indentation
-Further note that variable assignments should not be indented with
-@key{TAB} characters, use spaces if necessary.  On the other hand,
-rule commands should be indented with a leading @key{TAB} character.
-
 Automake tries to keep comments grouped with any adjoining rules or
 variable definitions.
 
+@cindex Limitations of automake parser
+@cindex Automake parser, limitations of
+@cindex indentation in Makefile.am
+Generally, Automake is not particularly smart in the parsing of unusual
+Makefile constructs, so you're advised to avoid fancy constructs or
+``creative'' use of whitespaces.
+@c Keep this in sync with doc-parsing-buglets-tabs.test.
+For example, @key{TAB} characters cannot be used between a target name
+and the following ``@code{:}'' character, and variable assignments
+shouldn't be indented with @key{TAB} characters.
+@c Keep this in sync with doc-parsing-buglets-colneq-subst.test.
+Also, using more complex macro in target names can cause trouble:
+
+@example
+% @kbd{cat Makefile.am}
+$(FOO:=x): bar
+% @kbd{automake}
+Makefile.am:1: bad characters in variable name `$(FOO'
+Makefile.am:1: `:='-style assignments are not portable
+@end example
+
 @cindex Make targets, overriding
 @cindex Make rules, overriding
 @cindex Overriding make rules
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a1c67ff..6101460 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -325,6 +325,8 @@ distcheck-configure-flags-subpkg.test \
 distcheck-hook.test \
 distcheck-hook2.test \
 dmalloc.test \
+doc-parsing-buglets-colneq-subst.test \
+doc-parsing-buglets-tabs.test \
 dollar.test \
 dollarvar.test \
 dollarvar2.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 4b2d845..108672d 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -603,6 +603,8 @@ distcheck-configure-flags-subpkg.test \
 distcheck-hook.test \
 distcheck-hook2.test \
 dmalloc.test \
+doc-parsing-buglets-colneq-subst.test \
+doc-parsing-buglets-tabs.test \
 dollar.test \
 dollarvar.test \
 dollarvar2.test \
diff --git a/tests/doc-parsing-buglets-colneq-subst.test b/tests/doc-parsing-buglets-colneq-subst.test
new file mode 100755
index 0000000..685d2b6
--- /dev/null
+++ b/tests/doc-parsing-buglets-colneq-subst.test
@@ -0,0 +1,39 @@
+#! /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/>.
+
+# Check a documented limitation of the Automake's Makefile parser
+# w.r.t. POSIX variable substitutions used in the name of targets.
+# See Section "General Operation" in the Automake manual.
+# If you cause some parts of this test to fail, chances are that you've
+# improved the Automake parser ;-)
+# See: <http://lists.gnu.org/archive/html/automake/2010-08/msg00074.html>
+# or: <http://thread.gmane.org/gmane.comp.sysutils.automake.general/11943/focus=11962>
+
+. ./defs || Exit 1
+
+set -e
+
+cat > Makefile.am <<'END'
+$(FOO:=x): bar
+END
+
+$ACLOCAL
+AUTOMAKE_fails
+
+grep 'bad characters.*variable name.*\$(FOO' stderr
+grep ':=.*assignments.*not portable' stderr
+
+:
diff --git a/tests/doc-parsing-buglets-tabs.test b/tests/doc-parsing-buglets-tabs.test
new file mode 100755
index 0000000..eee4a81
--- /dev/null
+++ b/tests/doc-parsing-buglets-tabs.test
@@ -0,0 +1,64 @@
+#! /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/>.
+
+# Check the documented limitation of the Automake's Makefile parser w.r.t.
+# use of TAB characters; see Section "General Operation" in the Automake
+# manual, and automake bug#8360.
+# If you cause some parts of this test to fail, chances are that you've
+# improved the Automake parser ;-)
+
+. ./defs || Exit 1
+
+set -e
+
+cat > Makefile.am <<END
+.PHONY: test
+test: all check
+
+fail:
+${tab}@echo "'\$@ recipe executed'"; exit 1
+
+## This won't be recognized as a target+recipe by Automake.
+all-local${tab}:
+${tab}@exit 1
+#check-local :
+#${tab}@exit 1
+
+## This won't be recognized as a target+rdependency by Automake.
+all-local${tab}: fail
+#check-local : fail
+
+just_to_separate: dummy deps
+
+## This won't be recognized as a variable assignment by Automake.
+${tab}bin_PROGRAMS = foo
+END
+
+echo AC_OUTPUT >> configure.in
+
+$ACLOCAL
+$AUTOMAKE
+
+$FGREP '$(EXEEEXT)' Makefile.in && Exit 1
+grep 'all:.*all-local' Makefile.in && Exit 1
+grep "^${tab}bin_PROGRAMS = foo" Makefile.in
+
+$AUTOCONF
+./configure
+
+$MAKE test
+
+:
-- 
1.7.2.3


Information forwarded to owner <at> debbugs.gnu.org, bug-automake <at> gnu.org:
bug#8360; Package automake. (Fri, 02 Sep 2011 08:13:01 GMT) Full text and rfc822 format available.

Message #20 received at 8360 <at> debbugs.gnu.org (full text, mbox):

From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
To: pitamila <at> free.fr,
 automake-patches <at> gnu.org
Cc: Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de>, 8360 <at> debbugs.gnu.org
Subject: Re: bug#8360: distcheck-hook never called
Date: Fri, 2 Sep 2011 10:08:48 +0200
[Message part 1 (text/plain, inline)]
tags 8360 + patch
close 8360
thanks

On Thursday 01 September 2011, Stefano Lattarini wrote:
> Resurrecting an old thread, for reference see:
>   <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8360>
> 
> On Saturday 09 April 2011, Ralf Wildenhues wrote:
> > Anyway, in this case it gets things wrong due to the TAB.  Solution is
> > to remove the TAB before the colon, maybe replacing it with a number of
> > spaces.  Then everything will work out fine.
> > 
> I've ended up writing a documentation patch for this, as well for another
> unrelated limitation encountered by Roberto Bagnara in an older thread on
> the automake list, see:
>   <http://lists.gnu.org/archive/html/automake/2010-08/msg00074.html>
> Since I was at it, I've written two tests verifying the documented
> behaviour.
> 
> I will wait a few hours before pushing (to maint), to allow for reviews.
> 
> Regards,
>   Stefano
> 
I've pushed the patch now:
 <http://lists.gnu.org/archive/html/automake-patches/2011-09/msg00002.html>
and I'm closing this bug report.

Regards,
  Stefano
[Message part 2 (text/html, inline)]

Added tag(s) patch. Request was from Stefano Lattarini <stefano.lattarini <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 02 Sep 2011 08:13:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 8360 <at> debbugs.gnu.org and pitamila <at> free.fr Request was from Stefano Lattarini <stefano.lattarini <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 02 Sep 2011 08:13:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 30 Sep 2011 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 271 days ago.

Previous Next


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