Skip to content

Document v3 binary size checks#2366

Merged
dearchap merged 2 commits into
urfave:mainfrom
rupayon123:codex/v3-binary-size-docs
Jun 13, 2026
Merged

Document v3 binary size checks#2366
dearchap merged 2 commits into
urfave:mainfrom
rupayon123:codex/v3-binary-size-docs

Conversation

@rupayon123

Copy link
Copy Markdown

Summary

  • add a v3 docs page for measuring and reducing Go binary size
  • document that v3 currently does not define urfave_cli_no_* build tags
  • add practical commands for go build, go version -m, and go tool nm
  • link the page from the v3 MkDocs nav

Why

Addresses #2365 with a concise starting point for users who want to understand where binary size comes from before proposing build tags or package splits.

Validation

  • git diff --check
  • inspected the generated Markdown content locally

I did not run the MkDocs build because mkdocs is not installed in my local Python environment.

@rupayon123 rupayon123 marked this pull request as ready for review June 13, 2026 04:04
@rupayon123

Copy link
Copy Markdown
Author

I reran local checks with Go installed and the pinned docs dependencies:

  • go test ./... — passed
  • mkdocs build --strict — passed

Marking this ready for review.

@rupayon123 rupayon123 requested a review from a team as a code owner June 13, 2026 04:04

@dearchap dearchap 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.

Review of PR #2366

This is a well-written, practical documentation page that addresses issue #2365. The content is accurate and useful. A few suggestions:

1. Add a link to new-issue page (line ~50) — The paragraph says "open an issue" but does not provide a URL. Add a link to https://github.com/urfave/cli/issues/new for convenience.

2. Mention make check-binary-size — The PR title says "binary size checks" but the page doesn't reference the existing make check-binary-size target already in the Makefile/scripts. This is the most relevant CI check and would be worth mentioning.

3. Combine the two go build examples — Showing -trimpath and -ldflags="-s -w" in separate code blocks is fine, but many readers will want the release recipe as one command. Consider adding a combined example like:

go build -trimpath -ldflags="-s -w" -o myapp ./path/to/main

4. Remove "already" — Line 1: s/Go already removes/Go removes/ for tighter prose.

5. Section order — Consider moving "Current v3 Build Tags" after "Practical Checks". The reader benefits from learning how to measure before learning about v3-specific tag caveats.

The mkdocs.yml change is indented correctly and follows the existing nav pattern.

@rupayon123

Copy link
Copy Markdown
Author

Thanks for the detailed pass. I updated the page with the issue link, make check-binary-size, a combined release-build command, the wording cleanup, and moved the build-tag caveat after the practical checks.

I reran go test ./..., make check-binary-size, and mkdocs build --strict; all pass.

@dearchap dearchap merged commit c66ca03 into urfave:main Jun 13, 2026
9 checks passed
@rupayon123

Copy link
Copy Markdown
Author

Thanks for the review and merge. Glad the docs update landed; I followed you here too so I can keep up with the project.

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.

2 participants