Skip to content
This repository was archived by the owner on Sep 1, 2026. It is now read-only.

docs: generate manpages - #504

Merged
brlane-rht merged 2 commits into
osbuild:mainfrom
supakeen:manpages
Apr 29, 2026
Merged

brlane-rht merged 2 commits into
osbuild:mainfrom
supakeen:manpages

Conversation

@supakeen

@supakeen supakeen commented Apr 28, 2026 •

Copy link
Copy Markdown
Member

Create manpages by using Cobra's built-in ability to do so. Add a hidden command that we call in our RPM specfile to generate the pages and install them in the appropriate location.

Also adds a new Makefile option to generate the manpages.


Looks like:

image image

Etc.

@supakeen
supakeen requested a review from a team as a code owner April 28, 2026 06:04
@supakeen

supakeen commented Apr 28, 2026 •

Copy link
Copy Markdown
Member Author

Mmm; seems to fail with on CentOS/RHEL, but not Fedora.

+ '%{gobuilddir}/bin/image-builder' gen-man-pages man/man1/
/var/tmp/rpm-tmp.r2wsy8: line 64: fg: no job control

Wonder what the actual error is.

@supakeen

Copy link
Copy Markdown
Member Author

Mmm; seems to fail with on CentOS/RHEL, but not Fedora.

+ '%{gobuilddir}/bin/image-builder' gen-man-pages man/man1/
/var/tmp/rpm-tmp.r2wsy8: line 64: fg: no job control

Wonder what the actual error is.

It means that the macro isn't expanded at all; maybe we're lacking a buildrequires for Go macros or the version in EL doesn't contain this macro.

lzap
lzap previously approved these changes Apr 28, 2026

@lzap lzap left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, not sure what you mean by the macro not being expanded, it is used in the file already why it would not error out there?

@supakeen

Copy link
Copy Markdown
Member Author

Looks good, not sure what you mean by the macro not being expanded, it is used in the file already why it would not error out there?

Mmm; you're right. Confusing. Maybe it's only available under %install on RHEL I don't know if macros can do that.

Comment thread cmd/image-builder/manpages.go Resolved
@brlane-rht

Copy link
Copy Markdown

Yeah, it's not getting expanded on RHEL :) From a different PR where it works on accident:

+ install -m 0755 -vp '%{gobuilddir}/bin/image-builder' /builddir/build/BUILDROOT/image-builder-62-1.20260428083453660281.pr462.6.gc430891.el10.x86_64/usr/bin/
'%{gobuilddir}/bin/image-builder' -> '/builddir/build/BUILDROOT/image-builder-62-1.20260428083453660281.pr462.6.gc430891.el10.x86_64/usr/bin/image-builder'

You could just write it to . in gobuild and install and run from there instead.

@supakeen

Copy link
Copy Markdown
Member Author

Yeah, it's not getting expanded on RHEL :) From a different PR where it works on accident:


+ install -m 0755 -vp '%{gobuilddir}/bin/image-builder' /builddir/build/BUILDROOT/image-builder-62-1.20260428083453660281.pr462.6.gc430891.el10.x86_64/usr/bin/

'%{gobuilddir}/bin/image-builder' -> '/builddir/build/BUILDROOT/image-builder-62-1.20260428083453660281.pr462.6.gc430891.el10.x86_64/usr/bin/image-builder'

You could just write it to . in gobuild and install and run from there instead.

Ah because it's quoted in the other case. Ok I'll change both of them. Thanks 🙂

Create manpages by using Cobra's built-in ability to do so. Add a hidden
command that we call in our RPM specfile to generate the pages and
install them in the appropriate location.

Also adds a new Makefile option to generate the manpages.

Signed-off-by: Simon de Vlieger <[email protected]>
This macro doesn't exist (yet) on ELs; instead use `_bin` as the prefix.
This accidentally works because install quotes the paths so they work
even when not expanded.

We use `_bin` in our other spec files for Go projects.

Signed-off-by: Simon de Vlieger <[email protected]>
@supakeen
supakeen requested review from brlane-rht and lzap April 29, 2026 05:14

@brlane-rht brlane-rht left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@brlane-rht
brlane-rht added this pull request to the merge queue Apr 29, 2026
Merged via the queue into osbuild:main with commit d98cbaa Apr 29, 2026
39 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants