Bug 28909 - 2.38 tarball (once again) requires makeinfo
Summary: 2.38 tarball (once again) requires makeinfo
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.38
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-20 17:15 UTC by Mitchell Blank Jr
Modified: 2023-08-01 10:41 UTC (History)
7 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
Preserve timestamps of gas/doc/asconfig.texi (634 bytes, patch)
2023-02-21 16:27 UTC, Benson Muite
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mitchell Blank Jr 2022-02-20 17:15:58 UTC
Similar to what affected 2.34 (#25491) but new:

---- CUT HERE ----

make[4]: Entering directory '/home/mitch/binutils-2.38/gas'
  GEN      doc/asconfig.texi
  MAKEINFO doc/as.info
/home/mitch/binutils-2.38/missing: 81: makeinfo: not found
WARNING: 'makeinfo' is missing on your system.
         You should only need it if you modified a '.texi' file, or
         any other file indirectly affecting the aspect of the manual.
         You might want to install the Texinfo package:
         <http://www.gnu.org/software/texinfo/>
         The spurious makeinfo call might also be the consequence of
         using a buggy 'make' (AIX, DU, IRIX), in which case you might
         want to install GNU make:
         <http://www.gnu.org/software/make/>
make[4]: *** [Makefile:1466: doc/as.info] Error 127

---- CUT HERE ----

Because there isn't a doc/.dirstamp file, the tarball's gas/Makefile.in always decides to re-generate doc/asconfig.tex   After that, doc/as.info is out-of-date so it tries to rebuild that, failing if makeinfo isn't installed.

Doing...
  $ touch -d2020-01-01 gas/doc/.dirstamp
...before building avoids the issue.

I suspect the root cause was the recent reorganization of the gas docs: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=bde299e063de090bf36c1fe51874d1e9f4d94c3c
Comment 1 Tom Vander Aa 2022-12-20 14:56:54 UTC
Still present in binutils-2.39.
Comment 2 Nick Clifton 2022-12-20 17:22:53 UTC
(In reply to Tom Vander Aa from comment #1)
> Still present in binutils-2.39.

Hi Tom,

  Will putting a gas/doc/.dirstamp file into the release tarballs solve 
  this problem ?  

  I am not familiar with the mechanism, but if an unpacked tarball has
  a .dirstamp file with the same timestamp as the info files, won't this
  trigger a rebuild anyway ?  If not, then I can easily at a step to the
  process in binutils/README-how-to-make-a-release to add the .dirstamp
  file.

Cheers
  Nick
Comment 3 Tom Vander Aa 2023-01-04 08:42:53 UTC
Update...

- Touching the .dirstamp seems to do the trick for gas/doc/as.info

- But somehow makeinfo is still needed because make wants to build gprofng/doc/gprofng.info.

I'll investigate some more and update this bugreport.
Comment 4 Benson Muite 2023-02-21 09:18:28 UTC
Same problem in relseases for 2.39 and 2.40. gas/docs in these releases are missing .info files
Comment 5 Andreas Schwab 2023-02-21 09:49:59 UTC
Worksforme:

$ tar -tf binutils-2.40.tar.bz2 | grep -F .info
binutils-2.40/bfd/doc/bfd.info
binutils-2.40/binutils/doc/binutils.info
binutils-2.40/binutils/sysroff.info
binutils-2.40/gas/doc/as.info
binutils-2.40/gprof/gprof.info
binutils-2.40/gprofng/doc/gprofng.info
binutils-2.40/ld/ld.info
binutils-2.40/libctf/doc/ctf-spec.info
binutils-2.40/libsframe/doc/sframe-spec.info
Comment 6 Benson Muite 2023-02-21 16:27:57 UTC
Created attachment 14701 [details]
Preserve timestamps of gas/doc/asconfig.texi

The issue is with line 144 of gas/doc/local.mk 

https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gas/doc/local.mk;h=f611a50913ca85b4218b11a66a724c23a7eff8c5;hb=HEAD#l44

This contains

$(AM_V_GEN)cp $(srcdir)/%D%/$(CONFIG).texi %D%/asconfig.texi

instead of

$(AM_V_GEN)cp -p $(srcdir)/%D%/$(CONFIG).texi %D%/asconfig.texi

which changes timestamps so that the .info file is older than asconfig.texi file

The line 2233 of the generated file gas/Makefile.in

https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gas/Makefile.in;h=d8d4953655af7050f6fb67acd8eb538bc3dd03bb;hb=HEAD#l2233

should also be updated similarly. 

Patch attached. Can someone with commit rights examine?
Comment 7 Sourceware Commits 2023-02-27 13:36:22 UTC
The master branch has been updated by Nick Clifton <nickc@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8034b0baeac1b209b1742b3e8fa25015191b57b8

commit 8034b0baeac1b209b1742b3e8fa25015191b57b8
Author: Benson Muite <benson_muite@emailplus.org>
Date:   Mon Feb 27 13:35:49 2023 +0000

    Do not change the timestamp when updating the gas asconfig file.
    
     PR 28909 * doc/local.mk (asconfig.texi): Use "cp -p" to preserve timestamps. * Makefile.in: Regenerate.
Comment 8 Nick Clifton 2023-02-27 13:37:04 UTC
Hi Benson,

  Thanks for the patch.  I have gone ahead and applied it to the sources.

Cheers
  Nick
Comment 9 Jan Beulich 2023-07-31 12:34:52 UTC
Sadly this breaks the build on Cygwin, for me at least:

  GEN      doc/asconfig.texi
cp: failed to preserve ownership for 'doc/asconfig.texi': Permission denied
  CC       config/tc-aarch64.o
make[4]: *** [Makefile:2233: doc/asconfig.texi] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [Makefile:1663: all-recursive] Error 1
make[2]: *** [Makefile:1009: all] Error 2
make[1]: *** [Makefile:5477: all-gas] Error 2
make: *** [Makefile:1009: all] Error 2

Which is even more unfortunate because with the use of "cp -p" we aren't really after preserving ownership here.
Comment 10 Sourceware Commits 2023-08-01 10:40:01 UTC
The master branch has been updated by Jan Beulich <jbeulich@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c7de8f2570c31fc634f500a3f4693597004dfebf

commit c7de8f2570c31fc634f500a3f4693597004dfebf
Author: Jan Beulich <jbeulich@suse.com>
Date:   Tue Aug 1 12:39:44 2023 +0200

    gas: rework timestamp preservation on doc/asconfig.texi
    
    PR 28909
    
    Sadly "cp -p", doing more than just preserving the time stamp, can fail
    e.g. upon trying to preserve ownership (which we don't care about), as
    can be observed on e.g. Cygwin. Replace the use of -p by a use of touch,
    this way also only preserving modification time.
Comment 11 Sourceware Commits 2023-08-01 10:41:43 UTC
The binutils-2_41-branch branch has been updated by Jan Beulich <jbeulich@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=31b78cc991781265d9404bd55151691bedd6d556

commit 31b78cc991781265d9404bd55151691bedd6d556
Author: Jan Beulich <jbeulich@suse.com>
Date:   Tue Aug 1 12:39:44 2023 +0200

    gas: rework timestamp preservation on doc/asconfig.texi
    
    PR 28909
    
    Sadly "cp -p", doing more than just preserving the time stamp, can fail
    e.g. upon trying to preserve ownership (which we don't care about), as
    can be observed on e.g. Cygwin. Replace the use of -p by a use of touch,
    this way also only preserving modification time.