Bug 268568

Summary: FreeBSD basic manual pages should not depend on external packages or ports
Product: Base System Reporter: Wolfram Schneider <wosch>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Some People CC: concussious.bugzilla, emaste, np
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 263310    

Description Wolfram Schneider freebsd_committer freebsd_triage 2022-12-26 10:14:04 UTC
I tried to read the "lesskey" manual page and got this error:

$ env PATH=/bin:/usr/bin /usr/bin/man lesskey
This manpage needs groff(1) to be rendered
First install groff(1):
pkg install groff


Looking for other manual pages with the same problem I found another one:

$ find /usr/share/man /usr/share/openssl/man ! -name mandoc.db -type f -print0 | perl -n0e 'chomp; print qq[PATH=/bin:/usr/bin; ulimit -t 30; /usr/bin/man $_ >/dev/null 2>&1 || echo $_\0]' | xargs -0 -n1 -P$(sysctl -n hw.ncpu) /bin/sh -c

/usr/share/man/man1/lesskey.1.gz
/usr/share/man/man8/cxgbetool.8.gz
Comment 1 Graham Perrin freebsd_committer freebsd_triage 2022-12-26 13:11:51 UTC
*** Bug 268567 has been marked as a duplicate of this bug. ***
Comment 2 Wolfram Schneider freebsd_committer freebsd_triage 2022-12-26 15:07:47 UTC
Looking at the shell script man(1) I see that mandoc fails with exit status 4 for the given parameters:

$ /usr/bin/zcat /usr/share/man/man1/lesskey.1.gz | mandoc -Tlint -Wunsupp
mandoc: <stdin>:220:3: UNSUPP: ignoring macro in table: goto-mark

$ echo $?
4
Comment 3 Alexander Ziaee 2023-09-15 09:31:40 UTC
Tested on 13.2p2

- cxgbetool.8 runs fine for me.

- Patch [0] submitted upstream which fixes lesskey.1 on mandoc.

[0] https://github.com/concussious/less/pull/1
Comment 4 Alexander Ziaee 2023-09-15 10:32:33 UTC
(In reply to Alexander Ziaee from comment #3)
> - cxgbetool.8 runs fine for me.

Excuse me, I don't know where I got that, cxgbetool.8 does not run for me.

For cxgbetool.8, mandoc does not support mdoc/man macros inside of tables.

https://man.freebsd.org/cgi/man.cgi?cxgbetool(8)
Comment 5 Alexander Ziaee 2023-09-15 18:48:43 UTC
(In reply to Alexander Ziaee from comment #4)

This was the upstream pull to fix lesskey.1, sorry.

https://github.com/gwsw/less/pull/427
Comment 6 Alexander Ziaee 2023-09-16 07:28:40 UTC
The fix [0] for lesskey.1 is just +2 characters and has been merged upstream.

cxgbetool.8 is really beautiful and the page seems fundamentally designed around features unsupported in mandoc. I am not nearly powerful enough to do anything about that one at this time. 

[0] https://github.com/gwsw/less/commit/974468fc779d4e57de00788dc5039aa64aacb003