Subject: [bug#75501] [PATCH] gnu: mandoc: Support zstd-compressed man pages.

From: Maxim Cournoyer <[email-masked]>
Date: Sun, 19 Jan 2025 16:11:54 +0900

Hi Sören,

Sören Tempel <[email-masked]> writes:

> Hello Maxim,
>
> thank you for having a look at the patch and your fast feedback!
>
> Maxim Cournoyer <[email-masked]> wrote:
>> While moving things around, I'd use a plain list for the arguments, and
>> format the phases under the #:phases argument (newline), to satisfy our
>> max 80 columns of width convention.
>
> Changed accordingly in the v2 that I just send.
>
>> Interesting solution!  The issue should be ideally be brought upstream
>> though, and referenced here.  With the leading implementation man-db
>> having gained zstd support, others should follow suite.  They may be
>> interested in using your solution, or otherwise adding "native" support
>> for it.
>> 
>> Could you please create such an issue with them, cross-reference it in
>> your patch, and send a v2?
>
> Having worked with upstream mandoc before, I doubt that they would be
> interested in implementing additional compression schemes. mandoc is an
> OpenBSD project, and OpenBSD doesn't compress its man pages. Usually,
> its hard to convince them to add features that do not benefit OpenBSD.

I see.  I think just at least a mention of that issue and a pointer to
the solution devised for Guix would be useful to share with upstream, in
case it'd motivate them to address it themselves.

You could argue why mandoc is such a great piece of software that you
want to use it over man-db on other systems than OpenBSD, they may
soften a bit on their position, ha!

> Specifically, regarding compression there is a prior thread on adding
> bzip2 where the mandoc maintainer states “compressing manual pages
> makes absolutely no sense to me […]”:
>
> 	https://inbox.vuxu.org/mandoc-discuss/[email-masked]/

Interesting position, but a bit extreme.  It's true that a few megabytes
saved are not the end of the world, especially if users are using full
disk compression such as Btrfs + Zstd, but it's still a plus in my book.

I had done some limited number crunching in [0], which found zstd mildy
better at compressing man pages than zstd (about 10% size reduction),
and 1.5x faster at decompressing.

[0]  https://issues.guix.gnu.org/68242#16

> If it is a requirement, I can create another “compression support”
> thread on their ML but I would prefer to use my time elsewhere.

I'd encourage you to do so, whatever the outcome.

-- 
Thanks,
Maxim