Hi Alex,

At 2025-09-11T10:59:19+0200, Alejandro Colomar wrote:
> I'm trying hard to have reproducible builds, so that I can verify that
> my build system produces the same exact thing as long as the tools
> used with it are the same (or a reasonably similar version).

A worthy goal!

> I found that groff(1) doesn't seem to be consistent, as it produces
> slightly different output on different runs.  Here's just an example:

Are all of the variable segments of output like your example?  Namely,
do they:

1.  affect only output prepared for the 'html' device, and
2.  exhibit differences only in lines starting with 'x F' in the grout?

> Did I inadvertently do something that would trigger such a difference?

I doubt it.

> I used the same exact system to produce both files.  I was testing
> that some changes to the Linux man-pages build system (which are just
> cosmetic changes) are in fact cosmetic, so I'm surprised to see these
> changes.
> 
> Is groff(1) just random in some sense?  Would it be possible to remove
> that randomness from groff(1)?

I'll need to look at what data structure is being used to house the list
of file names that get dumped into GNU troff(1)'s output for HTML
devices.  I suspect that feature was put in as a grohtml(1) debugging
aid, as there's nothing about it that necessarily couples it to the HTML
format.  Output for any target device could dump into its grout the list
of input files that were read during formatting.

It's possible that the data structure is effectively an unordered map,
and so is subject to the host system's stochastic and history-dependent
dynamic memory allocations.  However, I'm not strongly confident about
that because the output doesn't seem quite random _enough_.

Anyway, one shouldn't theorize ahead of facts, so I'll check out the
data structure and see what there is to see.

Regards,
Branden

Attachment: signature.asc
Description: PGP signature

Reply via email to