Skip to content

build: Sync man page infrastructure with bootc - #346

Merged
cgwalters merged 1 commit into
mainfrom
agent/sync-man-page-infra-6b58c12c273b96b4
Sep 3, 2026
Merged

cgwalters merged 1 commit into
mainfrom
agent/sync-man-page-infra-6b58c12c273b96b4

Conversation

@bootc-bot

@bootc-bot bootc-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR syncs the man page infrastructure with bootc-dev/bootc by simplifying the Makefile and removing duplicate logic. The key changes are:

  • Removed hardcoded section 8 assumptions: The Makefile previously assumed all man pages were section 8 (MAN8_SOURCES, MAN8_TARGETS), but the xtask code already supports flexible section numbers
  • Delegated to xtask: All man page generation now goes through cargo xtask manpages instead of having duplicate go-md2man and sed logic in the Makefile
  • Updated install target: Now dynamically installs man pages to the correct section directories (man1-man9) based on their actual section numbers

What 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:

  • Pattern rules for generating .8 man pages
  • Manual temp file creation and cleanup
  • Hardcoded sed commands for apostrophe handling
  • Fixed section 8 assumptions

The xtask implementation already handles all of this plus:

  • Flexible section number parsing from filenames
  • CLI option synchronization
  • Version placeholder replacement
  • Proper error handling

##Test plan

  • make manpages generates man pages correctly
  • make install installs man pages to appropriate section directories
  • Man pages include synced CLI options
  • Version placeholders are replaced

Validation

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.com
  • api.github.com
  • github.com
  • raw.githubusercontent.com

[!TIP]
api.github.com is blocked because GitHub API access uses the built-in GitHub tools by default. Instead of adding api.github.com to network.allowed, use tools.github.mode: gh-proxy for direct pre-authenticated GitHub CLI access without requiring network access to api.github.com:

tools:
  github:
    mode: gh-proxy

See GitHub Tools for more information on gh-proxy mode.

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "api.anthropic.com"
    - "api.github.com"
    - "github.com"
    - "raw.githubusercontent.com"

See Network Configuration for more information.

Generated by Drafter for #345 · claude · sonnet45 · 133.1 AIC · ⌖ 61.3 AIC · ⊞ 4.4K · ◷

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
@bootc-bot bootc-bot Bot mentioned this pull request Sep 3, 2026
@bootc-bot bootc-bot Bot added agent/review-working The review agent is actively working on this PR agent/lgtm Reviewer agent approved; ready to auto-merge labels Sep 3, 2026

@bootc-bot bootc-bot Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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 the generate_man_pages function 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/man directory exists
    • Extracts section numbers using sed pattern 's/.*\.\([0-9]\)$/\1/'
    • Installs to appropriate man$section/ directories

✅ 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.

@bootc-bot bootc-bot Bot removed the agent/review-working The review agent is actively working on this PR label Sep 3, 2026
@cgwalters
cgwalters marked this pull request as ready for review September 3, 2026 20:26
@cgwalters
cgwalters enabled auto-merge (rebase) September 3, 2026 20:27
@cgwalters

Copy link
Copy Markdown
Collaborator

retro: review agent should add its AIC cost

@cgwalters
cgwalters merged commit fdbe150 into main Sep 3, 2026
43 of 55 checks passed
cgwalters pushed a commit that referenced this pull request Sep 14, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent/lgtm Reviewer agent approved; ready to auto-merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sync man page infra

1 participant