Repository navigation
build: Sync man page infrastructure with bootc - #346
Conversation
Simplify the Makefile by removing duplicate man page generation logic and delegating to the xtask implementation. This change addresses drift with the bootc-dev/bootc repository by: - Removing hardcoded section 8 assumptions (MAN8_SOURCES, MAN8_TARGETS) - Delegating all man page generation to `cargo xtask manpages` - Updating install target to handle man pages in any section (1-9) - Removing duplicate go-md2man and sed apostrophe-handling logic The xtask implementation already handles: - Flexible section number parsing - CLI option synchronization - Version placeholder replacement - Man page conversion via go-md2man - Apostrophe handling fixes This consolidates the man page build logic in one place (man.rs) rather than maintaining separate implementations in the Makefile and Rust code. Fixes #345 Generated-by: AI
There was a problem hiding this comment.
Review Summary
This PR successfully consolidates man page generation logic and removes hardcoded section 8 assumptions. The changes are correct and improve maintainability.
What I Checked
✅ Code Correctness
-
xtask implementation (
crates/xtask/src/man.rs): Verified thegenerate_man_pagesfunction handles all the steps previously in the Makefile:- CLI option synchronization (line 421)
- Flexible section number parsing from filenames (lines 442-453)
- Version placeholder replacement (line 459)
- go-md2man conversion (line 465)
- Apostrophe handling fixes via
apply_man_page_fixes(lines 619-640)
-
Install target: The new shell loop correctly:
- Checks if
target/mandirectory exists - Extracts section numbers using sed pattern
's/.*\.\([0-9]\)$/\1/' - Installs to appropriate
man$section/directories
- Checks if
✅ Removes Duplication
The Makefile previously duplicated logic that was already implemented more flexibly in the xtask. Consolidating this in one place (Rust code) is the right approach.
✅ Maintains Current Behavior
Verified that all 24 current man page files lack section numbers in their filenames, so they'll default to section 8 (lines 451-453 of man.rs), maintaining existing behavior while adding flexibility for future use.
✅ Repository Conventions
- Commit message follows format:
build: Sync man page infrastructure with bootc - Small, focused change (15 additions, 25 deletions)
- Clear comments explaining xtask delegation
- No error swallowing or magic values
Ready to Merge
This is a clean refactoring that improves the build system's maintainability and consistency with bootc.
|
retro: review agent should add its AIC cost |
In #346 the manpage generation was changed to mirror bootc, however it missed the important part that bootc does not directly run `cargo xtask` but instead runs `cargo run --release --package xtask -- ...`, which is an important distinction because the former requires the `cargo-xtask` binary to be present in $PATH somewhere. In the RPM buildroot we don't have `cargo-xtask` so this fails to generate manpages via packit (and would eventually FTBFS in Fedora, too). Closes: #355 Signed-off-by: John Eckersberg <dev@eckersberg.com>
Summary
This PR syncs the man page infrastructure with bootc-dev/bootc by simplifying the Makefile and removing duplicate logic. The key changes are:
cargo xtask manpagesinstead of having duplicate go-md2man and sed logic in the MakefileWhat was the drift?
The Makefile contained duplicate man page generation logic that was already implemented more flexibly in
crates/xtask/src/man.rs. This included:.8man pagesThe xtask implementation already handles all of this plus:
##Test plan
make manpagesgenerates man pages correctlymake installinstalls man pages to appropriate section directoriesValidation
The changes consolidate man page build logic in one place (Rust xtask) rather than maintaining it in two places (Makefile + Rust), making the build system more maintainable and consistent with bootc.
Fixes #345
🤖 Generated with [Claude Code]((claude.com/redacted)
Warning
Firewall blocked 4 domains
The following domains were blocked by the firewall during workflow execution:
api.anthropic.comapi.github.comgithub.comraw.githubusercontent.com[!TIP]
api.github.comis blocked because GitHub API access uses the built-in GitHub tools by default. Instead of addingapi.github.comtonetwork.allowed, usetools.github.mode: gh-proxyfor direct pre-authenticated GitHub CLI access without requiring network access toapi.github.com:See GitHub Tools for more information on
gh-proxymode.To allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.