GNU bug report logs - #13351
Dropping support for split '.info' files in mainline Automake

Previous Next

Package: automake;

Reported by: Stefano Lattarini <stefano.lattarini <at> gmail.com>

Date: Thu, 3 Jan 2013 20:54:02 UTC

Severity: wishlist

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 13351 in the body.
You can then email your comments to 13351 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 bug-automake <at> gnu.org:
bug#13351; Package automake. (Thu, 03 Jan 2013 20:54:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefano Lattarini <stefano.lattarini <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-automake <at> gnu.org. (Thu, 03 Jan 2013 20:54:02 GMT) Full text and rfc822 format available.

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

From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
To: bug-automake <at> gnu.org
Subject: [IMPORTANT] Dropping support for split '.info' files in mainline
	Automake
Date: Thu, 03 Jan 2013 21:53:21 +0100
Severity: wishlist

[This is posted also to the automake and texinfo lists to ensure
 a wider audience.  Discussion should continue exclusively on the
 bug-automake list, to avoid a cross-posting flood]

Automake-generated have for a long time supported "split" info files:
<http://www.gnu.org/software/texinfo/manual/texinfo/texinfo.html#Tag-and-Split-Files>

When I asked the rationale for this feature:

  <http://lists.gnu.org/archive/html/texinfo-devel/2012-08/msg00015.html>

Karl Berry confirmed that the reason for its existence was indeed
"efficiency, especially memory size":

  <http://lists.gnu.org/archive/html/texinfo-devel/2012-08/msg00024.html>

He also added that "The Elisp manual is one of the largest ones around.
Looks like it would be maybe 3.5mb as one file."  Not in any way big by
modern standards.

OTOH, it appears that the use of split info files (at least in the way
Automake-generated rules have been handling them for a long time) can
cause real problems in some (admittedly quite corner-case) situations:

  <http://thread.gmane.org/gmane.comp.parsers.bison.bugs/3963>
  <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12320>

So I believe we could follow suit with Automake-NG (see commit dd603e21,
<http://lists.gnu.org/archive/html/automake-ng/2012-08/msg00147.html>)
and have Automake-generated makefiles pass the '--no-split' option
unconditionally to makeinfo invocations (starting from Automake 1.14).
This would allow some nice simplifications in our Texinfo recipe
(exemplified by the Automake-NG patch referenced above), and offer an
automatic fix for bug#12320.

Another *very* good aspect of such a change is that it would be 100%
transparent to the Automake users.

Thoughts, opinions, objections?

Regards,
  Stefano




Changed bug title to 'Dropping support for split '.info' files in mainline Automake' from '[IMPORTANT] Dropping support for split '.info' files in mainline Automake' Request was from Stefano Lattarini <stefano.lattarini <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 03 Jan 2013 21:48:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-automake <at> gnu.org:
bug#13351; Package automake. (Fri, 04 Jan 2013 14:33:16 GMT) Full text and rfc822 format available.

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

From: Thien-Thi Nguyen <ttn <at> gnuvola.org>
To: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Cc: bug-automake <at> gnu.org
Subject: Re: [IMPORTANT] Dropping support for split '.info' files in mainline
	Automake
Date: Fri, 04 Jan 2013 15:07:03 +0100
[Message part 1 (text/plain, inline)]
() Stefano Lattarini <stefano.lattarini <at> gmail.com>
() Thu, 03 Jan 2013 21:53:21 +0100

   Thoughts, opinions, objections?

I support making ‘--no-split’ the default.  But if the package end-user
can override that, how can Automake drop support for it?

-- 
Thien-Thi Nguyen ..................................... GPG key: 4C807502
.                  NB: ttn at glug dot org is not me                   .
.                 (and has not been since 2007 or so)                  .
.                        ACCEPT NO SUBSTITUTES                         .
........... please send technical questions to mailing lists ...........
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to bug-automake <at> gnu.org:
bug#13351; Package automake. (Fri, 04 Jan 2013 16:44:02 GMT) Full text and rfc822 format available.

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

From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
To: Thien-Thi Nguyen <ttn <at> gnuvola.org>
Cc: 13351 <at> debbugs.gnu.org
Subject: Re: bug#13351: [IMPORTANT] Dropping support for split '.info' files
	in mainline Automake
Date: Fri, 04 Jan 2013 17:43:35 +0100
Hi Thien-Thi, thanks for the feedback.

On 01/04/2013 03:07 PM, Thien-Thi Nguyen wrote:
> () Stefano Lattarini <stefano.lattarini <at> gmail.com>
> () Thu, 03 Jan 2013 21:53:21 +0100
> 
>    Thoughts, opinions, objections?
> 
> I support making ‘--no-split’ the default.  But if the package end-user
> can override that, how can Automake drop support for it?
> 
By adding it unconditionally in the makeinfo invocation, after all the
other options.

Regards,
  Stefano




Information forwarded to bug-automake <at> gnu.org:
bug#13351; Package automake. (Mon, 07 Jan 2013 19:31:01 GMT) Full text and rfc822 format available.

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

From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
To: Thien-Thi Nguyen <ttn <at> gnuvola.org>
Cc: 13351 <at> debbugs.gnu.org, "automake-ng <at> gnu.org" <automake-ng <at> gnu.org>
Subject: Re: bug#13351: [IMPORTANT] Dropping support for split '.info' files
	in mainline Automake
Date: Mon, 07 Jan 2013 20:30:12 +0100
Reference:
<http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13351>

On 01/04/2013 05:43 PM, Stefano Lattarini wrote:
> Hi Thien-Thi, thanks for the feedback.
> 
> On 01/04/2013 03:07 PM, Thien-Thi Nguyen wrote:
>> () Stefano Lattarini <stefano.lattarini <at> gmail.com>
>> () Thu, 03 Jan 2013 21:53:21 +0100
>>
>>    Thoughts, opinions, objections?
>>
>> I support making ‘--no-split’ the default.  But if the package end-user
>> can override that, how can Automake drop support for it?
>>
> By adding it unconditionally in the makeinfo invocation, after all the
> other options.
> 
Here is a a patch.  I will wait four of five days for feedback before
pushing it to master.

Thanks,
  Stefano

----- 8< ---- 8< ----- 8< ---- 8< ----- 8< ---- 8< ----- 8< ---- 8< -----

From cdba479fe5739555ad9ec30e0224f24b2facf548 Mon Sep 17 00:00:00 2001
Message-Id: <cdba479fe5739555ad9ec30e0224f24b2facf548.1357586853.git.stefano.lattarini <at> gmail.com>
From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Date: Fri, 4 Jan 2013 18:12:29 +0100
Subject: [PATCH] texi: no longer support split info files

See automake bug#13351 and bug#12320.

Automake-generated recipes have for a long time supported "split"
info files:

  http://www.gnu.org/software/texinfo/manual/texinfo/texinfo.html#Tag-and-Split-Files

When I asked the rationale for this feature:

  http://lists.gnu.org/archive/html/texinfo-devel/2012-08/msg00015.html

Karl Berry confirmed that the reason for its existence was indeed
"efficiency, especially memory size":

  http://lists.gnu.org/archive/html/texinfo-devel/2012-08/msg00024.html

He also added that "The Elisp manual is one of the largest ones around.
Looks like it would be maybe 3.5mb as one file."  Not in any way big by
modern standards.

OTOH, it appears that the use of split info files (at least in the way
they have been handled by Automake-generated rules for a long time) can
cause real problems in some (admittedly quite corner-case) situations:

  http://thread.gmane.org/gmane.comp.parsers.bison.bugs/3963
  http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12320

So we now follow suit with Automake-NG (see commit v1.12.2-901-gdd603e2,
<http://lists.gnu.org/archive/html/automake-ng/2012-08/msg00147.html>)
and have Automake-generated makefiles pass the '--no-split' option
unconditionally to makeinfo invocations.

This allow some nice simplifications in our Texinfo recipes, and offer
an automatic fix for bug#12320.

Another *very* good aspect of such a change is that it should be 100%
transparent to the Automake users.

* lib/am/texinfos.am: Simplify moderately.
* lib/am/texibuild.am: Simplify greatly the recipe for the creation
of info files.
* t/txinfo-makeinfo-error-no-clobber.sh: Adjust.
* t/txinfo-no-split.sh: New test.
* t/list-of-tests.mk: Add it.

Signed-off-by: Stefano Lattarini <stefano.lattarini <at> gmail.com>
---
 lib/am/texibuild.am                   |   41 +++-----------
 lib/am/texinfos.am                    |   37 ++++++-------
 t/list-of-tests.mk                    |    1 +
 t/txinfo-makeinfo-error-no-clobber.sh |    7 ---
 t/txinfo-no-split.sh                  |   94 +++++++++++++++++++++++++++++++++
 5 files changed, 119 insertions(+), 61 deletions(-)
 create mode 100755 t/txinfo-no-split.sh

diff --git a/lib/am/texibuild.am b/lib/am/texibuild.am
index 2e2a6e1..9f568fb 100644
--- a/lib/am/texibuild.am
+++ b/lib/am/texibuild.am
@@ -22,39 +22,14 @@
 ## should never be dependent upon a non-distributed built file.
 ## Therefore we ensure that %DIRSTAMP% exists in the rule.
 ?!INSRC??DIRSTAMP?	@test -f %DIRSTAMP% || $(MAKE) $(AM_MAKEFLAGS) %DIRSTAMP%
-## Back up the info files before running makeinfo. This is the cheapest
-## way to ensure that
-## 1) If the texinfo file shrinks (or if you start using --no-split),
-##    you'll not be left with some dead info files lying around -- dead
-##    files which would end up in the distribution.
-## 2) If the texinfo file has some minor mistakes which cause makeinfo
-##    to fail, the info files are not removed.  (They are needed by the
-##    developer while he writes documentation.)
-	%AM_V_MAKEINFO%restore=: && backupdir=.am$$$$ && \
-?INSRC?	am__cwd=`pwd` && $(am__cd) $(srcdir) && \
-	rm -rf $$backupdir && mkdir $$backupdir && \
-## If makeinfo is not installed we must not backup the files so
-## 'missing' can do its job and touch $@ if it exists.
-	if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
-	  for f in $@ $@-[0-9] $@-[0-9][0-9]; do \
-	    if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
-	  done; \
-	else :; fi && \
-?INSRC?	cd "$$am__cwd"; \
-	if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS% \
-?!INSRC?	 -o $@ `test -f '%SOURCE_INFO%' || echo '$(srcdir)/'`%SOURCE_INFO%; \
-?INSRC??!GENERIC_INFO?	 -o $@ $(srcdir)/%SOURCE_INFO%; \
-?INSRC??GENERIC_INFO?	 -o $@ $<; \
-	then \
-	  rc=0; \
-?INSRC?	  $(am__cd) $(srcdir); \
-	else \
-	  rc=$$?; \
-## Beware that backup info files might come from a subdirectory.
-?INSRC?	  $(am__cd) $(srcdir) && \
-	  $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
-	fi; \
-	rm -rf $$backupdir; exit $$rc
+## If the texinfo file has some minor mistakes which cause makeinfo
+## to fail, the info files are not removed.
+	$(AM_V_MAKEINFO)$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
+	                %MAKEINFOFLAGS% --no-split -o $@-t \
+?!INSRC?	        `test -f '%SOURCE_INFO%' || echo '$(srcdir)/'`%SOURCE_INFO%
+?INSRC??!GENERIC_INFO?	$(srcdir)/%SOURCE_INFO%
+?INSRC??GENERIC_INFO?	$<
+	$(AM_V_at)mv -f $@-t $@

 INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%

diff --git a/lib/am/texinfos.am b/lib/am/texinfos.am
index 9b92920..a57bb03 100644
--- a/lib/am/texinfos.am
+++ b/lib/am/texinfos.am
@@ -191,12 +191,11 @@ install-info-am: $(INFO_DEPS)
 	  case $$file in \
 	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
 	  esac; \
-	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
-	  for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9]; do \
-	    if test -f $$ifile; then \
-	      echo "$$ifile"; \
-	    else : ; fi; \
-	  done; \
+	  if test -f $$file; then \
+	    echo ./$$file; \
+	  else \
+	    echo $(srcdir)/$$file; \
+	  fi; \
 	done | $(am__base_list) | \
 	while read files; do \
 	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \
@@ -311,8 +310,8 @@ uninstall-info-am:
 	for file in $$list; do \
 	  relfile=`echo "$$file" | sed 's|^.*/||'`; \
 	  (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \
-	     echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9]"; \
-	     rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9]; \
+	     echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile"; \
+	     rm -f $$relfile; \
 	   else :; fi); \
 	done

@@ -345,15 +344,14 @@ dist-info: $(INFO_DEPS)
 	  case $$base in \
 	    $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
 	  esac; \
-	  if test -f $$base; then d=.; else d=$(srcdir); fi; \
-	  for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9]; do \
-	    if test -f $$file; then \
-## Strip leading '$$d/'.
-	      relfile=`expr "$$file" : "$$d/\(.*\)"`; \
-	      test -f "$(distdir)/$$relfile" || \
-		cp -p $$file "$(distdir)/$$relfile"; \
-	    else :; fi; \
-	  done; \
+	  if test -f $$base; then \
+	    file=./$$base; \
+	  else \
+	    file=$(srcdir)/$$base; \
+	  fi; \
+	  if test -f $$file && test ! -f "$(distdir)/$$base"; then \
+	    cp -p $$file "$(distdir)/$$base"; \
+	  fi; \
 	done
 endif %?LOCAL-TEXIS%

@@ -383,10 +381,7 @@ clean-aminfo:

 .PHONY maintainer-clean-am: maintainer-clean-aminfo
 maintainer-clean-aminfo:
-	@list='$(INFO_DEPS)'; for i in $$list; do \
-	  echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9]"; \
-	  rm -f $$i $$i-[0-9] $$i-[0-9][0-9]; \
-	done
+	-test -z "$(INFO_DEPS)" || rm -f $(INFO_DEPS)
 ## Use '-rf', not just '-f'; see comments in 'mostlyclean-aminfo'
 ## above for details.
 ?MAINTCLEAN?	-test -z "%MAINTCLEAN%" \
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index e8efe45..a6b379c 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -1170,6 +1170,7 @@ t/txinfo-no-clutter.sh \
 t/txinfo-no-extra-dist.sh \
 t/txinfo-no-installinfo.sh \
 t/txinfo-no-repeated-targets.sh \
+t/txinfo-no-split.sh \
 t/txinfo-other-suffixes.sh \
 t/txinfo-override-infodeps.sh \
 t/txinfo-override-texinfo-tex.sh \
diff --git a/t/txinfo-makeinfo-error-no-clobber.sh b/t/txinfo-makeinfo-error-no-clobber.sh
index f4b7d01..c567e89 100755
--- a/t/txinfo-makeinfo-error-no-clobber.sh
+++ b/t/txinfo-makeinfo-error-no-clobber.sh
@@ -45,10 +45,6 @@ $AUTOCONF
 ./configure
 $MAKE

-# Feign more info files.
-: > main.info-1
-: > sub/main.info-1
-
 # Break main.texi.
 $sleep
 cp main.texi main.old
@@ -64,15 +60,12 @@ END
 # makeinfo will bail out, but we should conserve the old info files.
 $MAKE && exit 1
 test -f main.info
-test -f main.info-1

 # Restore main.texi, and break sub/main.texi.
 cp main.texi sub/main.texi
 mv main.old main.texi
 $MAKE && exit 1
 test -f main.info
-test ! -e main.info-1
 test -f sub/main.info
-test -f sub/main.info-1

 :
diff --git a/t/txinfo-no-split.sh b/t/txinfo-no-split.sh
new file mode 100755
index 0000000..aecf7e7
--- /dev/null
+++ b/t/txinfo-no-split.sh
@@ -0,0 +1,94 @@
+#! /bin/sh
+# Copyright (C) 2013 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/>.
+
+# Info split files should not be produced (automake bug#13351).
+
+required=makeinfo
+. test-init.sh
+
+echo AC_OUTPUT >> configure.ac
+
+cat > Makefile.am <<'END'
+MAKEINFO = makeinfo --split-size 10
+info_TEXINFOS = foo.texi
+
+test-split: # A sanity check.
+	$(MAKEINFO) -o split.info foo.texi
+
+check-local:
+	test -f $(srcdir)/foo.info
+	test ! -f $(srcdir)/foo.info-1
+	test "`find $(srcdir) . | grep '\.info'`" = "$(srcdir)/foo.info"
+END
+
+cat > foo.texi << 'END'
+\input texinfo
+@setfilename foo.info
+@settitle foo
+@dircategory Dummy utilities
+@direntry
+* Foo: (foo).  Does nothing at all.
+@end direntry
+
+@node Top
+@top Foo
+
+@menu
+* Intro::    Introduction
+* Planets::  List of Planets
+@end menu
+
+@node Intro
+@chapter Introduction
+Will list planets.
+
+@node Planets
+@chapter List of planets
+Hello Mercury.
+Hello Venus
+Hello Earth
+Hello Mars.
+Hello Jupiter.
+Hello Saturn.
+Hello Uran.
+Hello Neptune.
+Hello Pluto.
+@bye
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+
+$MAKE test-split
+ls -l # For debugging.
+test -f split.info
+test -f split.info-1
+test -f split.info-2
+rm -f split*
+
+$MAKE
+
+ls -l # For debugging.
+test -f foo.info
+test ! -f foo.info-1
+test "$(find . | $FGREP '.info' | sed 's|^\./||')" = foo.info
+
+$MAKE distcheck
+
+:
-- 
1.7.10.4




Information forwarded to bug-automake <at> gnu.org:
bug#13351; Package automake. (Tue, 08 Jan 2013 13:38:01 GMT) Full text and rfc822 format available.

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

From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
To: Thien-Thi Nguyen <ttn <at> gnuvola.org>
Cc: 13351 <at> debbugs.gnu.org,
	"automake-patches <at> gnu.org" <automake-patches <at> gnu.org>
Subject: Re: bug#13351: [IMPORTANT] Dropping support for split '.info' files
	in mainline Automake
Date: Tue, 08 Jan 2013 14:36:58 +0100
On 01/07/2013 08:30 PM, Stefano Lattarini wrote:
> Reference:
> <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13351>
> 
> On 01/04/2013 05:43 PM, Stefano Lattarini wrote:
>> Hi Thien-Thi, thanks for the feedback.
>>
>> On 01/04/2013 03:07 PM, Thien-Thi Nguyen wrote:
>>> () Stefano Lattarini <stefano.lattarini <at> gmail.com>
>>> () Thu, 03 Jan 2013 21:53:21 +0100
>>>
>>>    Thoughts, opinions, objections?
>>>
>>> I support making ‘--no-split’ the default.  But if the package end-user
>>> can override that, how can Automake drop support for it?
>>>
>> By adding it unconditionally in the makeinfo invocation, after all the
>> other options.
>>
> Here is a a patch.  I will wait four of five days for feedback before
> pushing it to master.
>
Oops, I had sent the patch to the Automake-NG list rather than the
Automake one.  Sorry for the confusion.

Stefano

---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ----

From cdba479fe5739555ad9ec30e0224f24b2facf548 Mon Sep 17 00:00:00 2001
Message-Id: <cdba479fe5739555ad9ec30e0224f24b2facf548.1357651902.git.stefano.lattarini <at> gmail.com>
From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Date: Fri, 4 Jan 2013 18:12:29 +0100
Subject: [PATCH] texi: no longer support split info files

See automake bug#13351 and bug#12320.

Automake-generated recipes have for a long time supported "split"
info files:

  http://www.gnu.org/software/texinfo/manual/texinfo/texinfo.html#Tag-and-Split-Files

When I asked the rationale for this feature:

  http://lists.gnu.org/archive/html/texinfo-devel/2012-08/msg00015.html

Karl Berry confirmed that the reason for its existence was indeed
"efficiency, especially memory size":

  http://lists.gnu.org/archive/html/texinfo-devel/2012-08/msg00024.html

He also added that "The Elisp manual is one of the largest ones around.
Looks like it would be maybe 3.5mb as one file."  Not in any way big by
modern standards.

OTOH, it appears that the use of split info files (at least in the way
they have been handled by Automake-generated rules for a long time) can
cause real problems in some (admittedly quite corner-case) situations:

  http://thread.gmane.org/gmane.comp.parsers.bison.bugs/3963
  http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12320

So we now follow suit with Automake-NG (see commit v1.12.2-901-gdd603e2,
<http://lists.gnu.org/archive/html/automake-ng/2012-08/msg00147.html>)
and have Automake-generated makefiles pass the '--no-split' option
unconditionally to makeinfo invocations.

This allow some nice simplifications in our Texinfo recipes, and offer
an automatic fix for bug#12320.

Another *very* good aspect of such a change is that it should be 100%
transparent to the Automake users.

* lib/am/texinfos.am: Simplify moderately.
* lib/am/texibuild.am: Simplify greatly the recipe for the creation
of info files.
* t/txinfo-makeinfo-error-no-clobber.sh: Adjust.
* t/txinfo-no-split.sh: New test.
* t/list-of-tests.mk: Add it.

Signed-off-by: Stefano Lattarini <stefano.lattarini <at> gmail.com>
---
 lib/am/texibuild.am                   |   41 +++-----------
 lib/am/texinfos.am                    |   37 ++++++-------
 t/list-of-tests.mk                    |    1 +
 t/txinfo-makeinfo-error-no-clobber.sh |    7 ---
 t/txinfo-no-split.sh                  |   94 +++++++++++++++++++++++++++++++++
 5 files changed, 119 insertions(+), 61 deletions(-)
 create mode 100755 t/txinfo-no-split.sh

diff --git a/lib/am/texibuild.am b/lib/am/texibuild.am
index 2e2a6e1..9f568fb 100644
--- a/lib/am/texibuild.am
+++ b/lib/am/texibuild.am
@@ -22,39 +22,14 @@
 ## should never be dependent upon a non-distributed built file.
 ## Therefore we ensure that %DIRSTAMP% exists in the rule.
 ?!INSRC??DIRSTAMP?	@test -f %DIRSTAMP% || $(MAKE) $(AM_MAKEFLAGS) %DIRSTAMP%
-## Back up the info files before running makeinfo. This is the cheapest
-## way to ensure that
-## 1) If the texinfo file shrinks (or if you start using --no-split),
-##    you'll not be left with some dead info files lying around -- dead
-##    files which would end up in the distribution.
-## 2) If the texinfo file has some minor mistakes which cause makeinfo
-##    to fail, the info files are not removed.  (They are needed by the
-##    developer while he writes documentation.)
-	%AM_V_MAKEINFO%restore=: && backupdir=.am$$$$ && \
-?INSRC?	am__cwd=`pwd` && $(am__cd) $(srcdir) && \
-	rm -rf $$backupdir && mkdir $$backupdir && \
-## If makeinfo is not installed we must not backup the files so
-## 'missing' can do its job and touch $@ if it exists.
-	if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
-	  for f in $@ $@-[0-9] $@-[0-9][0-9]; do \
-	    if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
-	  done; \
-	else :; fi && \
-?INSRC?	cd "$$am__cwd"; \
-	if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS% \
-?!INSRC?	 -o $@ `test -f '%SOURCE_INFO%' || echo '$(srcdir)/'`%SOURCE_INFO%; \
-?INSRC??!GENERIC_INFO?	 -o $@ $(srcdir)/%SOURCE_INFO%; \
-?INSRC??GENERIC_INFO?	 -o $@ $<; \
-	then \
-	  rc=0; \
-?INSRC?	  $(am__cd) $(srcdir); \
-	else \
-	  rc=$$?; \
-## Beware that backup info files might come from a subdirectory.
-?INSRC?	  $(am__cd) $(srcdir) && \
-	  $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
-	fi; \
-	rm -rf $$backupdir; exit $$rc
+## If the texinfo file has some minor mistakes which cause makeinfo
+## to fail, the info files are not removed.
+	$(AM_V_MAKEINFO)$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
+	                %MAKEINFOFLAGS% --no-split -o $@-t \
+?!INSRC?	        `test -f '%SOURCE_INFO%' || echo '$(srcdir)/'`%SOURCE_INFO%
+?INSRC??!GENERIC_INFO?	$(srcdir)/%SOURCE_INFO%
+?INSRC??GENERIC_INFO?	$<
+	$(AM_V_at)mv -f $@-t $@

 INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%

diff --git a/lib/am/texinfos.am b/lib/am/texinfos.am
index 9b92920..a57bb03 100644
--- a/lib/am/texinfos.am
+++ b/lib/am/texinfos.am
@@ -191,12 +191,11 @@ install-info-am: $(INFO_DEPS)
 	  case $$file in \
 	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
 	  esac; \
-	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
-	  for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9]; do \
-	    if test -f $$ifile; then \
-	      echo "$$ifile"; \
-	    else : ; fi; \
-	  done; \
+	  if test -f $$file; then \
+	    echo ./$$file; \
+	  else \
+	    echo $(srcdir)/$$file; \
+	  fi; \
 	done | $(am__base_list) | \
 	while read files; do \
 	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \
@@ -311,8 +310,8 @@ uninstall-info-am:
 	for file in $$list; do \
 	  relfile=`echo "$$file" | sed 's|^.*/||'`; \
 	  (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \
-	     echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9]"; \
-	     rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9]; \
+	     echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile"; \
+	     rm -f $$relfile; \
 	   else :; fi); \
 	done

@@ -345,15 +344,14 @@ dist-info: $(INFO_DEPS)
 	  case $$base in \
 	    $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
 	  esac; \
-	  if test -f $$base; then d=.; else d=$(srcdir); fi; \
-	  for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9]; do \
-	    if test -f $$file; then \
-## Strip leading '$$d/'.
-	      relfile=`expr "$$file" : "$$d/\(.*\)"`; \
-	      test -f "$(distdir)/$$relfile" || \
-		cp -p $$file "$(distdir)/$$relfile"; \
-	    else :; fi; \
-	  done; \
+	  if test -f $$base; then \
+	    file=./$$base; \
+	  else \
+	    file=$(srcdir)/$$base; \
+	  fi; \
+	  if test -f $$file && test ! -f "$(distdir)/$$base"; then \
+	    cp -p $$file "$(distdir)/$$base"; \
+	  fi; \
 	done
 endif %?LOCAL-TEXIS%

@@ -383,10 +381,7 @@ clean-aminfo:

 .PHONY maintainer-clean-am: maintainer-clean-aminfo
 maintainer-clean-aminfo:
-	@list='$(INFO_DEPS)'; for i in $$list; do \
-	  echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9]"; \
-	  rm -f $$i $$i-[0-9] $$i-[0-9][0-9]; \
-	done
+	-test -z "$(INFO_DEPS)" || rm -f $(INFO_DEPS)
 ## Use '-rf', not just '-f'; see comments in 'mostlyclean-aminfo'
 ## above for details.
 ?MAINTCLEAN?	-test -z "%MAINTCLEAN%" \
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index e8efe45..a6b379c 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -1170,6 +1170,7 @@ t/txinfo-no-clutter.sh \
 t/txinfo-no-extra-dist.sh \
 t/txinfo-no-installinfo.sh \
 t/txinfo-no-repeated-targets.sh \
+t/txinfo-no-split.sh \
 t/txinfo-other-suffixes.sh \
 t/txinfo-override-infodeps.sh \
 t/txinfo-override-texinfo-tex.sh \
diff --git a/t/txinfo-makeinfo-error-no-clobber.sh b/t/txinfo-makeinfo-error-no-clobber.sh
index f4b7d01..c567e89 100755
--- a/t/txinfo-makeinfo-error-no-clobber.sh
+++ b/t/txinfo-makeinfo-error-no-clobber.sh
@@ -45,10 +45,6 @@ $AUTOCONF
 ./configure
 $MAKE

-# Feign more info files.
-: > main.info-1
-: > sub/main.info-1
-
 # Break main.texi.
 $sleep
 cp main.texi main.old
@@ -64,15 +60,12 @@ END
 # makeinfo will bail out, but we should conserve the old info files.
 $MAKE && exit 1
 test -f main.info
-test -f main.info-1

 # Restore main.texi, and break sub/main.texi.
 cp main.texi sub/main.texi
 mv main.old main.texi
 $MAKE && exit 1
 test -f main.info
-test ! -e main.info-1
 test -f sub/main.info
-test -f sub/main.info-1

 :
diff --git a/t/txinfo-no-split.sh b/t/txinfo-no-split.sh
new file mode 100755
index 0000000..aecf7e7
--- /dev/null
+++ b/t/txinfo-no-split.sh
@@ -0,0 +1,94 @@
+#! /bin/sh
+# Copyright (C) 2013 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/>.
+
+# Info split files should not be produced (automake bug#13351).
+
+required=makeinfo
+. test-init.sh
+
+echo AC_OUTPUT >> configure.ac
+
+cat > Makefile.am <<'END'
+MAKEINFO = makeinfo --split-size 10
+info_TEXINFOS = foo.texi
+
+test-split: # A sanity check.
+	$(MAKEINFO) -o split.info foo.texi
+
+check-local:
+	test -f $(srcdir)/foo.info
+	test ! -f $(srcdir)/foo.info-1
+	test "`find $(srcdir) . | grep '\.info'`" = "$(srcdir)/foo.info"
+END
+
+cat > foo.texi << 'END'
+\input texinfo
+@setfilename foo.info
+@settitle foo
+@dircategory Dummy utilities
+@direntry
+* Foo: (foo).  Does nothing at all.
+@end direntry
+
+@node Top
+@top Foo
+
+@menu
+* Intro::    Introduction
+* Planets::  List of Planets
+@end menu
+
+@node Intro
+@chapter Introduction
+Will list planets.
+
+@node Planets
+@chapter List of planets
+Hello Mercury.
+Hello Venus
+Hello Earth
+Hello Mars.
+Hello Jupiter.
+Hello Saturn.
+Hello Uran.
+Hello Neptune.
+Hello Pluto.
+@bye
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+
+$MAKE test-split
+ls -l # For debugging.
+test -f split.info
+test -f split.info-1
+test -f split.info-2
+rm -f split*
+
+$MAKE
+
+ls -l # For debugging.
+test -f foo.info
+test ! -f foo.info-1
+test "$(find . | $FGREP '.info' | sed 's|^\./||')" = foo.info
+
+$MAKE distcheck
+
+:
-- 
1.7.10.4




Information forwarded to bug-automake <at> gnu.org:
bug#13351; Package automake. (Wed, 09 Jan 2013 11:40:03 GMT) Full text and rfc822 format available.

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

From: Akim Demaille <akim.demaille <at> gmail.com>
To: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Cc: 13351 <at> debbugs.gnu.org, Thien-Thi Nguyen <ttn <at> gnuvola.org>,
	"automake-ng <at> gnu.org" <automake-ng <at> gnu.org>
Subject: Re: [Automake-NG] bug#13351: [IMPORTANT] Dropping support for split
	'.info' files in mainline Automake
Date: Wed, 9 Jan 2013 12:38:50 +0100
Le 7 janv. 2013 à 20:30, Stefano Lattarini <stefano.lattarini <at> gmail.com> a écrit :

> Reference:
> <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13351>
> 
> On 01/04/2013 05:43 PM, Stefano Lattarini wrote:
>> Hi Thien-Thi, thanks for the feedback.
>> 
>> On 01/04/2013 03:07 PM, Thien-Thi Nguyen wrote:
>>> () Stefano Lattarini <stefano.lattarini <at> gmail.com>
>>> () Thu, 03 Jan 2013 21:53:21 +0100
>>> 
>>>   Thoughts, opinions, objections?
>>> 
>>> I support making ‘--no-split’ the default.  But if the package end-user
>>> can override that, how can Automake drop support for it?
>>> 
>> By adding it unconditionally in the makeinfo invocation, after all the
>> other options.
>> 
> Here is a a patch.  I will wait four of five days for feedback before
> pushing it to master.

Very much in favor of it!



Information forwarded to bug-automake <at> gnu.org:
bug#13351; Package automake. (Fri, 11 Jan 2013 21:57:02 GMT) Full text and rfc822 format available.

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

From: Paolo Bonzini <bonzini <at> gnu.org>
To: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Cc: bug-automake <at> gnu.org
Subject: Re: [IMPORTANT] Dropping support for split '.info' files in mainline
	Automake
Date: Fri, 11 Jan 2013 22:55:36 +0100
Il 03/01/2013 21:53, Stefano Lattarini ha scritto:
> Severity: wishlist
> 
> [This is posted also to the automake and texinfo lists to ensure
>  a wider audience.  Discussion should continue exclusively on the
>  bug-automake list, to avoid a cross-posting flood]
> 
> Automake-generated have for a long time supported "split" info files:
> <http://www.gnu.org/software/texinfo/manual/texinfo/texinfo.html#Tag-and-Split-Files>
> 
> When I asked the rationale for this feature:
> 
>   <http://lists.gnu.org/archive/html/texinfo-devel/2012-08/msg00015.html>
> 
> Karl Berry confirmed that the reason for its existence was indeed
> "efficiency, especially memory size":
> 
>   <http://lists.gnu.org/archive/html/texinfo-devel/2012-08/msg00024.html>
> 
> He also added that "The Elisp manual is one of the largest ones around.
> Looks like it would be maybe 3.5mb as one file."  Not in any way big by
> modern standards.
> 
> OTOH, it appears that the use of split info files (at least in the way
> Automake-generated rules have been handling them for a long time) can
> cause real problems in some (admittedly quite corner-case) situations:
> 
>   <http://thread.gmane.org/gmane.comp.parsers.bison.bugs/3963>
>   <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12320>
> 
> So I believe we could follow suit with Automake-NG (see commit dd603e21,
> <http://lists.gnu.org/archive/html/automake-ng/2012-08/msg00147.html>)
> and have Automake-generated makefiles pass the '--no-split' option
> unconditionally to makeinfo invocations (starting from Automake 1.14).
> This would allow some nice simplifications in our Texinfo recipe
> (exemplified by the Automake-NG patch referenced above), and offer an
> automatic fix for bug#12320.
> 
> Another *very* good aspect of such a change is that it would be 100%
> transparent to the Automake users.
> 
> Thoughts, opinions, objections?

*This* is a change I support.

Paolo





Information forwarded to bug-automake <at> gnu.org:
bug#13351; Package automake. (Sat, 12 Jan 2013 15:59:01 GMT) Full text and rfc822 format available.

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

From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
To: Paolo Bonzini <bonzini <at> gnu.org>
Cc: 13351 <at> debbugs.gnu.org
Subject: Re: bug#13351: [IMPORTANT] Dropping support for split '.info' files
	in mainline Automake
Date: Sat, 12 Jan 2013 16:58:20 +0100
On 01/11/2013 10:55 PM, Paolo Bonzini wrote:
> Il 03/01/2013 21:53, Stefano Lattarini ha scritto:
>
>> So I believe we could follow suit with Automake-NG (see commit dd603e21,
>> <http://lists.gnu.org/archive/html/automake-ng/2012-08/msg00147.html>)
>> and have Automake-generated makefiles pass the '--no-split' option
>> unconditionally to makeinfo invocations (starting from Automake 1.14).
>> This would allow some nice simplifications in our Texinfo recipe
>> (exemplified by the Automake-NG patch referenced above), and offer an
>> automatic fix for bug#12320.
>>
>> Another *very* good aspect of such a change is that it would be 100%
>> transparent to the Automake users.
>>
>> Thoughts, opinions, objections?
> 
> *This* is a change I support.
>
> Paolo
> 
Glad to hear that.  Since so far I've received only positive feedback, I
will proceed to push the change to master in a couple of days if nobody
objects.

Regards,
  Stefano




Reply sent to Stefano Lattarini <stefano.lattarini <at> gmail.com>:
You have taken responsibility. (Wed, 16 Jan 2013 12:49:02 GMT) Full text and rfc822 format available.

Notification sent to Stefano Lattarini <stefano.lattarini <at> gmail.com>:
bug acknowledged by developer. (Wed, 16 Jan 2013 12:49:02 GMT) Full text and rfc822 format available.

Message #33 received at 13351-done <at> debbugs.gnu.org (full text, mbox):

From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
To: Paolo Bonzini <bonzini <at> gnu.org>
Cc: 13351-done <at> debbugs.gnu.org
Subject: Re: bug#13351: [IMPORTANT] Dropping support for split '.info' files
	in mainline Automake
Date: Wed, 16 Jan 2013 13:47:40 +0100
On 01/12/2013 04:58 PM, Stefano Lattarini wrote:
> On 01/11/2013 10:55 PM, Paolo Bonzini wrote:
>> Il 03/01/2013 21:53, Stefano Lattarini ha scritto:
>>
>>> So I believe we could follow suit with Automake-NG (see commit dd603e21,
>>> <http://lists.gnu.org/archive/html/automake-ng/2012-08/msg00147.html>)
>>> and have Automake-generated makefiles pass the '--no-split' option
>>> unconditionally to makeinfo invocations (starting from Automake 1.14).
>>> This would allow some nice simplifications in our Texinfo recipe
>>> (exemplified by the Automake-NG patch referenced above), and offer an
>>> automatic fix for bug#12320.
>>>
>>> Another *very* good aspect of such a change is that it would be 100%
>>> transparent to the Automake users.
>>>
>>> Thoughts, opinions, objections?
>>
>> *This* is a change I support.
>>
>> Paolo
>>
> Glad to hear that.  Since so far I've received only positive feedback, I
> will proceed to push the change to master in a couple of days if nobody
> objects.
> 
Pushed now.  I'm thus closing this bug report.

Regards,
  Stefano




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 14 Feb 2013 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 45 days ago.

Previous Next


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