Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert man pages to specialist tooling: scdoc #3591

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pmatilai
Copy link
Member

@pmatilai pmatilai commented Feb 20, 2025

Pandoc do a passable job of generating man pages out of Markdown, but pandoc itself is a horrible build dependency for the mundane task of generating man pages. We've avoided this build dependency by shipping rendered man-pages in our source releases. That was not such a big deal in the autotools ecosystem where source releases are built, but that's really an oxymoron. We want to move to a model where our source releases are really nothing more than what git-archive outputs, and something that anybody can verify anywhere at all.

To preserve man page availability, switch over to a tool that we can trivially add as a hard build requirement. scdoc is a trivially buildable piece of < 1000 lines of C code and depends on nothing that rpm doesn't otherwise depend. Being a specialized tool for man pages, I think it also does a better job at it than pandoc. Should make CI faster too because there are fewer dependencies to install.

This is quite a chainsaw change, the main purpose is just to make our man pages buildable with scdoc. Making it pretty and unifying all the wildly different styles is a job for another day.

Fixes: #3563

@pmatilai pmatilai requested a review from a team as a code owner February 20, 2025 15:50
@pmatilai pmatilai requested review from dmnks and removed request for a team February 20, 2025 15:50
Pandoc do a passable job of generating man pages out of Markdown, but
pandoc itself is a horrible build dependency for the mundane task of
generating man pages. We've avoided this build dependency by shipping
rendered man-pages in our source releases. That was not such a big deal
in the autotools ecosystem where source releases are *built*, but
that's really an oxymoron. We want to move to a model where our source
releases are really nothing more than what git-archive outputs, and
something that anybody can verify anywhere at all.

To preserve man page availability, switch over to a tool that we can
trivially add as a hard build requirement. scdoc is a trivially
buildable piece of < 1000 lines of C code and depends on nothing that
rpm doesn't otherwise depend. Being a specialized tool for man pages,
I think it also does a better job at it than pandoc. Should make CI
faster too because there are fewer dependencies to install.

This is quite a chainsaw change, the main purpose is just to make
our man pages buildable with scdoc. Making it pretty and unifying all
the wildly different styles is a job for another day.

Fixes: rpm-software-management#3563
@pmatilai
Copy link
Member Author

Note that after this change, the files are of course no longer Markdown, but I left renaming to proper extension to another patch to keep this somehow reviewable.

@pmatilai
Copy link
Member Author

Interestingly built pandoc doesn't have many dependencies at all, it's just the build-requirements that kill. The size-difference is quite remarkable though:

$ rpm -q --qf "%{size:humansi} %{name}\n" pandoc pandoc-common scdoc
194M pandoc
1.9M pandoc-common
33K scdoc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert man pages to scdoc
1 participant