Hi Nelson,

At 2026-11-10T07:03:22-0700, Nelson H. F. Beebe wrote:
> I'm pleased to report that I have successfully built, validated (with
> 0 test failures), and installed groff-1.25.0 on 65 systems in our Utah
> test lab, partly in preparation for the TeX Live 2027 build season
> that starts in a few weeks.  
> 
> The test operating systems include several versions of DragonFlyBSD,
> FreeBSD, GhostBSD, GNU/Hurd, HardenedBSD, Hello-OS, Linux,
> MidnightBSD, NetBSD, OpenBSD, and Solaris, with various underlying
> big-endian and little-endian CPUs [Alpha, ARM32, ARM64 (including
> Apple's M1, M2, M3, M4, and M5), HPPA (PA-RISC), IA-64 (Itanium), LA64
> (Loongson), M68K, MIPS32, MIPS64, PowerPC, RISC-V, S390x, SPARC64, x86
> (i286, i386, i486, i586, i686), and x86_64 (AMD64)].

I'd just like to reiterate my privately expressed astonishment at the
breadth of systems here.

i286 is an especial surprise.  So someone's doing the triple-fault trick
to switch back to real mode, eh?  ;-)

Thank you for the beyond-comprehensive testing!

> There are another 8 builds where there were a small number of test
> failures, of which this is typical:
> 
>       FAIL: contrib/mom/examples/test-mom.sh
>       FAIL: src/devices/gropdf/tests/interpret-grout-correctly.sh
>       XFAIL: tmac/tests/pdf_bookmark-starting-with-control-char-works.sh
>       XFAIL: src/roff/groff/tests/current-language-and-environment-in-sync.sh
>       XFAIL: src/roff/groff/tests/html-device-works-with-grn-and-eqn.sh
>       XFAIL: 
> src/roff/groff/tests/stringup-request-transforms-non-basic-latin.sh
>       FAIL: tmac/tests/an_UR-works.sh
>       XFAIL: tmac/tests/e_footnotes-work-with-columns.sh
>       # XFAIL: 5
>       # FAIL:  3

XFAILs are "expected failures".  I use them more or less to keep track
of bugs that are hard to fix due to design issues, or because I don't
understand exactly what code needs to change to resolve them.  If an
XFAIL should start passing, that's an "XPASS" and is a _failure_,
meaning it makes the test run "red", and tells us we, perhaps
inadvertently, fixed a bug--we need to document the change, understand
and explain the consequence, and ideally update the "XFAIL" test's
expectations and make it a "regular" test.

These three:

>       FAIL: contrib/mom/examples/test-mom.sh
>       FAIL: src/devices/gropdf/tests/interpret-grout-correctly.sh
>       FAIL: tmac/tests/an_UR-works.sh

...I'm curious to see the "test-suite.log" file from the affected
systems.  Please let me know the "uname -a" info (or some rough
equivalent) corresponding to each such log.

> I have a small question about a possible change in "groff -man -Tps"
> processing.

Right.  Now that I've re-read your email while fully awake, I think I
can field this one.  I had thought URW font-finding weirdness was
involved, but I now suspect it's nothing so subtle.

> A couple of weeks ago, I made some experiments with a manual page file
> to change the body font from TimesRoman to Bookman, by simply adding
> ".fam BM" before the ".TH" command.  That did the job nicely, as can
> be seen in the pawk.* files at
> 
>       https://www.math.utah.edu/~beebe/pawk/
> 
> when I used /usr/bin/groff (1.22.2) on CentOS 7.9 and 1.22.4 on Ubuntu
> 20.04.

Right.  I would expect that from groff 1.22.x and earlier.

> However, with version 1.23 on Ubuntu 24.04, and also with the new
> 1.25, the same input file is typeset in Times.  Compare
> 
>       % /usr/bin/groff -man -Tps pawk.1 | head -10
>       %!PS-Adobe-3.0
>       %%Creator: groff version 1.22.4
>       %%CreationDate: Tue Nov 10 13:48:15 2026
>       %%DocumentNeededResources: font Times-Roman
>       %%+ font Bookman-Demi
>       %%+ font Bookman-Light
>       %%+ font Bookman-LightItalic
>       %%+ font Courier
>       %%+ font Courier-Oblique
>       %%+ font Symbol
> 
> with 
> 
>       % /usr/bin/groff -man -Tps pawk.1 | head -8
>       %!PS-Adobe-3.0
>       %%Creator: groff version 1.23.0
>       %%CreationDate: Tue Nov 10 06:48:44 2026
>       %%DocumentNeededResources: font Times-Italic
>       %%+ font Times-Roman
>       %%+ font Times-Bold
>       %%+ font Courier
>       %%+ font Symbol
> 
> I looked at the installed an.tmac files, but could not quickly see a
> reason why ".fam BM" fails to work on the newer groff releases.
[...]
> Do you have any insight?  Can you reproduce this at your site?

It is because the `TH` macro now resets many rendering parameters,
including the font family.  To batch-render many man pages together so
that one could generate a "book" of them,[1] I needed to make the man(7)
and mdoc(7) packages more aggressive about resetting state, so that once
document's voyages off the beaten track of the documented macro calls
didn't mess up the rendering of subsequent documents.

Here is why your `fam` request does not take, using groff 1.25.0's
"an.tmac" file.  First, I modify the package to make it squawk and
produce a backtrace, so that I can see the macro call stack causing the
font family to be reset.

$ git diff tmac/
diff --git a/tmac/an.tmac b/tmac/an.tmac
index 74de44023..1b03c614b 100644
--- a/tmac/an.tmac
+++ b/tmac/an.tmac
@@ -247,6 +247,8 @@ .de an*reset-tab-stops
 ..
 .
 .de an*reset-section-parameters
+.  tm GBR: \\$0: resetting the body family to \\*[an*body-family]
+.  backtrace
 .  fam \\*[an*body-family]
 .  nr an*inset-level 1
 .  nr an*margin \\n[BP]

Then I use the and `-z` options to discard rendered output.

$ ./build/test-groff -z -man ./ATTIC/pawk.1 2>&1 | head -n 8
GBR: an*reset-section-parameters: resetting the body family to T
troff: backtrace: '/home/branden/src/GIT/groff/build/../tmac/an.tmac':251: 
macro 'an*reset-section-parameters'
troff: backtrace: '/home/branden/src/GIT/groff/build/../tmac/an.tmac':384: 
macro 'TH'
troff: backtrace: file './ATTIC/pawk.1':47
GBR: an*reset-section-parameters: resetting the body family to T
troff: backtrace: '/home/branden/src/GIT/groff/build/../tmac/an.tmac':251: 
macro 'an*reset-section-parameters'
troff: backtrace: '/home/branden/src/GIT/groff/build/../tmac/an.tmac':806: 
macro 'SH'
troff: backtrace: file './ATTIC/pawk.1':50

There are two workarounds.  I strongly urge the first.

1.  Change rendering parameters _at the command line_, not within the
    document.

    $ ~/groff-1.25.0/bin/groff -f BM -man -T pdf ./ATTIC/pawk.1 \
        > ATTIC/pawk.1.pdf

    Screenshot attached.

2.  Issue the `fam` request _after_ the `TH` macro call.  Of course,
    this will just get reset again every time `an*reset-section-parameters`
    gets called, which as you can likely guess will occur with every
    `SH` and `SS` macro call.  You could add requests by hand after
    every such call, or append to the macros with `am`.

    However I caution against this technique for man pages intended for
    public distribution because (a) the Bookman font family won't
    necessarily be available on all output devices (and indeed, it does
    not exist on any groff output devices apart from "ps" and "pdf");
    and (b) except for specialized purposes of limited scope within the
    document, changing the font family like this overrides the
    _reader's_ styling preferences.

    The pawk.1 document says this:

.\" This changes from the default, but dense and tired old, TimesRoman to 
Bookman, which I find more readable
.fam BM

    I do not challenge your preferences at all, but if you want man
    pages authored by other people to respect yours, you should use the
    first technique above.

I couldn't help but also notice these.

.de EX
.nf
.ft CR
..
.de EE
.br
.fi
.ft 1
..

These macro definitions are unnecessary in 2026 on almost any system you
might encounter--though you in particular obviously encounter more than
most people!  Almost everyone uses groff 1.19 or later; or mandoc(1),
which compatibly implements `EX` and `EE`; or Heirloom Doctools troff,
which incorporates groff 1.19 (or so)'s "an-ext.tmac" file which defines
these.

The only exception I know of to my "everyone" statement is Solaris 10.
I believe HP-UX and AIX package groff, but I don't know if or to what
extend they've retained their AT&T troffs.

Even Solaris 11.4 (SRU66) has discarded its System V troff for groff
1.23.0[2] (where, however, the `-F` option doesn't work due to a mistake
on my part--fixed in groff 1.24.0[3]).

Regards,
Branden

[1] https://www.gnu.org/software/groff/manual/groff-man-pages.pdf
[2] https://blogs.oracle.com/solaris/announcing-oracle-solaris-114-sru66
[3] https://savannah.gnu.org/bugs/?64130

Attachment: signature.asc
Description: PGP signature

  • ... G. Branden Robinson
    • ... Deri via discussion of the GNU roff typesetting system and related software
    • ... G. Branden Robinson

Reply via email to