Bug 257982

Summary: devel/binutils: manpages are empty after 2.37 update
Product: Ports & Packages Reporter: Jan Beich <jbeich>
Component: Individual Port(s)Assignee: Fernando Apesteguía <fernape>
Status: Closed FIXED    
Severity: Affects Only Me CC: chris, fernape, jflopezfernandez, lwhsu, rhurlin
Priority: --- Keywords: regression
Version: LatestFlags: bugzilla: maintainer-feedback? (jflopezfernandez)
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 251385    
Attachments:
Description Flags
Proposed patch fernape: maintainer-approval? (jflopezfernandez)

Description Jan Beich freebsd_committer 2021-08-21 10:59:33 UTC
$ pkg install binutils
$ pkg info -l binutils | fgrep man/ | xargs file -z
/usr/local/man/man1/addr2line.1.gz: empty (gzip compressed data, max compression, from Unix)
/usr/local/man/man1/ar.1.gz:        empty (gzip compressed data, max compression, from Unix)
/usr/local/man/man1/as.1.gz:        empty (gzip compressed data, max compression, from Unix)
/usr/local/man/man1/c++filt.1.gz:   empty (gzip compressed data, max compression, from Unix)
/usr/local/man/man1/elfedit.1.gz:   empty (gzip compressed data, max compression, from Unix)
/usr/local/man/man1/gprof.1.gz:     empty (gzip compressed data, max compression, from Unix)
/usr/local/man/man1/ld.1.gz:        empty (gzip compressed data, max compression, from Unix)
/usr/local/man/man1/nm.1.gz:        empty (gzip compressed data, max compression, from Unix)
/usr/local/man/man1/objcopy.1.gz:   empty (gzip compressed data, max compression, from Unix)
/usr/local/man/man1/objdump.1.gz:   empty (gzip compressed data, max compression, from Unix)
/usr/local/man/man1/ranlib.1.gz:    empty (gzip compressed data, max compression, from Unix)
/usr/local/man/man1/readelf.1.gz:   empty (gzip compressed data, max compression, from Unix)
/usr/local/man/man1/size.1.gz:      empty (gzip compressed data, max compression, from Unix)
/usr/local/man/man1/strings.1.gz:   empty (gzip compressed data, max compression, from Unix)
/usr/local/man/man1/strip.1.gz:     empty (gzip compressed data, max compression, from Unix)
$ pkg info -l binutils | fgrep man/ | xargs md5
MD5 (/usr/local/man/man1/addr2line.1.gz) = 4a4dd3598707603b3f76a2378a4504aa
MD5 (/usr/local/man/man1/ar.1.gz) = 4a4dd3598707603b3f76a2378a4504aa
MD5 (/usr/local/man/man1/as.1.gz) = 4a4dd3598707603b3f76a2378a4504aa
MD5 (/usr/local/man/man1/c++filt.1.gz) = 4a4dd3598707603b3f76a2378a4504aa
MD5 (/usr/local/man/man1/elfedit.1.gz) = 4a4dd3598707603b3f76a2378a4504aa
MD5 (/usr/local/man/man1/gprof.1.gz) = 4a4dd3598707603b3f76a2378a4504aa
MD5 (/usr/local/man/man1/ld.1.gz) = 4a4dd3598707603b3f76a2378a4504aa
MD5 (/usr/local/man/man1/nm.1.gz) = 4a4dd3598707603b3f76a2378a4504aa
MD5 (/usr/local/man/man1/objcopy.1.gz) = 4a4dd3598707603b3f76a2378a4504aa
MD5 (/usr/local/man/man1/objdump.1.gz) = 4a4dd3598707603b3f76a2378a4504aa
MD5 (/usr/local/man/man1/ranlib.1.gz) = 4a4dd3598707603b3f76a2378a4504aa
MD5 (/usr/local/man/man1/readelf.1.gz) = 4a4dd3598707603b3f76a2378a4504aa
MD5 (/usr/local/man/man1/size.1.gz) = 4a4dd3598707603b3f76a2378a4504aa
MD5 (/usr/local/man/man1/strings.1.gz) = 4a4dd3598707603b3f76a2378a4504aa
MD5 (/usr/local/man/man1/strip.1.gz) = 4a4dd3598707603b3f76a2378a4504aa
Comment 1 Fernando Apesteguía freebsd_committer 2021-08-22 18:08:24 UTC
(In reply to Jan Beich from comment #0)
I can confirm this. Man pages are empty right after extract.

$ ls -latrth binutils/doc/*.1
-rw-r--r--  1 fernape  fernape     0B Jul 18 18:48 binutils/doc/addr2line.1
-rw-r--r--  1 fernape  fernape     0B Jul 18 18:48 binutils/doc/windres.1
-rw-r--r--  1 fernape  fernape     0B Jul 18 18:48 binutils/doc/windmc.1
-rw-r--r--  1 fernape  fernape     0B Jul 18 18:48 binutils/doc/strip.1
-rw-r--r--  1 fernape  fernape     0B Jul 18 18:48 binutils/doc/strings.1
-rw-r--r--  1 fernape  fernape     0B Jul 18 18:48 binutils/doc/size.1
-rw-r--r--  1 fernape  fernape     0B Jul 18 18:48 binutils/doc/readelf.1
-rw-r--r--  1 fernape  fernape     0B Jul 18 18:48 binutils/doc/ranlib.1
-rw-r--r--  1 fernape  fernape     0B Jul 18 18:48 binutils/doc/objdump.1
-rw-r--r--  1 fernape  fernape     0B Jul 18 18:48 binutils/doc/objcopy.1
-rw-r--r--  1 fernape  fernape     0B Jul 18 18:48 binutils/doc/nm.1
-rw-r--r--  1 fernape  fernape     0B Jul 18 18:48 binutils/doc/elfedit.1
-rw-r--r--  1 fernape  fernape     0B Jul 18 18:48 binutils/doc/dlltool.1
-rw-r--r--  1 fernape  fernape     0B Jul 18 18:48 binutils/doc/c++filt.1
-rw-r--r--  1 fernape  fernape     0B Jul 18 18:48 binutils/doc/ar.1

It seems to be a really ugly bug upstream:

https://www.mail-archive.com/search?l=bug-binutils%40gnu.org&q=28144&submit.x=0&submit.y=0
Comment 2 Li-Wen Hsu freebsd_committer 2021-08-30 15:17:27 UTC
Fix seems available https://sourceware.org/bugzilla/show_bug.cgi?id=28144#c3
Comment 3 Fernando Apesteguía freebsd_committer 2021-08-30 18:05:35 UTC
(In reply to Li-Wen Hsu from comment #2)
I am not very familiar with this port, but in our case, man pages are empty right after extract.

If I understand the Makefiles correctly, texti2pod.pl is supposed to run first to generate .pod files from binutils.texi and then, pod2man should be generating the final manual pages.

I just tried in any case to give it a try and after applying the patch and building the port the .gz files are 20B and the manual pages are effectively empty.

In my poudriere log there is no reference to texi2pod.pl whatsoever.
Comment 4 Fernando Apesteguía freebsd_committer 2021-08-30 18:22:40 UTC
Created attachment 227554 [details]
Proposed patch

I am not very familiar with this port, but in our case, man pages are empty right after extract.

If I understand the Makefiles correctly, texti2pod.pl is supposed to run first to generate .pod files from binutils.texi and then, pod2man should be generating the final manual pages.

In addition to the patch, I needed to remove the empty .1 man files that come with the distribution in post-patch. Otherwise the Makefile do not generate them.

Tested in 12.2 amd64. Build testing @work for other environments (may take a while)
Comment 5 Fernando Apesteguía freebsd_committer 2021-08-30 18:54:48 UTC
Builds fine in

{11.4,12.2}{amd64,i386}, 13.0amd64 and current amd64.

I would like to see at least one other architecture tested before committing this :-)
Comment 6 commit-hook freebsd_committer 2021-09-02 05:54:41 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a055899f4f1c41d07ae5b8d3f5a9983173ef76f6

commit a055899f4f1c41d07ae5b8d3f5a9983173ef76f6
Author:     Fernando Apesteguía <fernape@FreeBSD.org>
AuthorDate: 2021-08-30 17:19:36 +0000
Commit:     Fernando Apesteguía <fernape@FreeBSD.org>
CommitDate: 2021-09-02 05:43:11 +0000

    devel/binutils: Fix manpage generation after 2.37

    A bug[1] upstream in 2.37 left empty man pages after build.
    The downloaded distribution file comes with empty man pages too.

    Apply patch from upstream[1] and force man page regeration by removing the ones
    which come with the distribution.

    [1] https://sourceware.org/bugzilla/show_bug.cgi?id=28144
    [1] https://sourceware.org/bugzilla/show_bug.cgi?id=28144#c3

    PR:     257982
    Reported by:    jbeich@

 devel/binutils/Makefile                          |  3 +++
 devel/binutils/files/patch-etc_texi2pod.pl (new) | 11 +++++++++++
 2 files changed, 14 insertions(+)
Comment 7 Fernando Apesteguía freebsd_committer 2021-09-02 05:56:51 UTC
Committed,

Thanks!