Skip to content

refactor(help): embed man pages without a tarball - #17640

Merged
rustbot merged 2 commits into
rust-lang:masterfrom
weihanglo:build-man
Oct 25, 2026
Merged

rustbot merged 2 commits into
rust-lang:masterfrom
weihanglo:build-man

Conversation

@weihanglo

@weihanglo weihanglo commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

What does this PR try to resolve?

Inspired by #17637.

Two things

This shows that we can move build time code generation to xtask :)

Notes to reviewers

Binary size benchmark result (LLM assisted):

Binary raw gzip -9 xz -6 xz -9e
master 32,585,520 11,536,545 7,387,624 7,288,568
this PR 33,245,408 11,531,622 7,341,252 7,240,164
diff +659,888 −4,923 −46,372 −48,404

so, about 644 KiB larger on disk, but about 4.8 KiB smaller gzipped and about 45-47 KB smaller xz-compressed. I think compressed size may matter more for downloads, unless we are going to expand our help man pages ten times more in the future.

BTW, in the future we should probably move some of our CI check to (snapshot) tests.
That is a pattern we kinda want to advocate.


🤖 LLM involvement: Help verify everything is the same and working well, as well as the binary size benchmark.

@rustbot rustbot added A-cli Area: Command-line interface, option parsing, etc. A-documenting-cargo-itself Area: Cargo's documentation A-infrastructure Area: infrastructure around the cargo repo, ci, releases, etc. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 24, 2026
@rustbot

rustbot commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator

r? @Muscraft

rustbot has assigned @Muscraft.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @Muscraft, @epage, @weihanglo
  • @Muscraft, @epage, @weihanglo expanded to Muscraft, epage, weihanglo
  • Random selection from Muscraft, epage

@epage

epage commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Alternatively, we stop compressing and include the text directly. Wasn't sure how reproducible the tgz would be or having a binary in the repo when I was planning to address this.

@weihanglo

Copy link
Copy Markdown
Member Author

Under flate2's gz deterministic mode it should be fairly reproducible I think. Granted on Windows we need to deal with crlf stuff perhaps via gitattribute or normalization.

I can try digging a bit deeper and check the size difference with and without compression.

@weihanglo

Copy link
Copy Markdown
Member Author

Under flate2's gz deterministic mode it should be fairly reproducible I think. Granted on Windows we need to deal with crlf stuff perhaps via gitattribute or normalization.

I can try digging a bit deeper and check the size difference with and without compression.

The result looks promising especially for the compressed size!

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

If you feel the numbers look good, go ahead

View changes since this review

@weihanglo

Copy link
Copy Markdown
Member Author

Those numbers in any direction don't matter that much. build.rs reduction is what I looks for.

Let's go.

@rustbot merge.

@rustbot
rustbot enabled auto-merge October 25, 2026 01:17
@weihanglo weihanglo changed the title refactor(build-man): move help compression in refactor(help): embed man pages without a tarball Oct 25, 2026
@rustbot
rustbot added this pull request to the merge queue Oct 25, 2026
Merged via the queue into rust-lang:master with commit b578633 Oct 25, 2026
32 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 25, 2026
@weihanglo
weihanglo deleted the build-man branch October 28, 2026 20:51
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Oct 29, 2026
Update cargo submodule

7 commits in cad07cf8e597397fff5d0f6cb79c9f870c0b1dd2..31d3246e0e8d3a80d4a90b54aa48ff180adb408b
2026-10-23 22:04:58 +0000 to 2026-10-27 13:54:39 +0000
- Warn about conflicting proc-macro manifest settings (rust-lang/cargo#17641)
- docs: use latest `resolver` and `edition` in examples (rust-lang/cargo#17644)
- docs(hints): write mostly-unused docs as end-user documentation (rust-lang/cargo#17549)
- refactor(help): embed man pages without a tarball  (rust-lang/cargo#17640)
- refactor(cargo-test-support): remove build.rs (rust-lang/cargo#17638)
- fix: exclude abspath of path deps from `-Cmetadata` hash (rust-lang/cargo#17624)
- use build-rs for buildscripts (rust-lang/cargo#17637)

r? ghost
@rustbot rustbot added this to the 1.101.0 milestone Oct 29, 2026
hashcatHitman pushed a commit to hashcatHitman/miri that referenced this pull request Oct 30, 2026
Update cargo submodule

7 commits in cad07cf8e597397fff5d0f6cb79c9f870c0b1dd2..31d3246e0e8d3a80d4a90b54aa48ff180adb408b
2026-10-23 22:04:58 +0000 to 2026-10-27 13:54:39 +0000
- Warn about conflicting proc-macro manifest settings (rust-lang/cargo#17641)
- docs: use latest `resolver` and `edition` in examples (rust-lang/cargo#17644)
- docs(hints): write mostly-unused docs as end-user documentation (rust-lang/cargo#17549)
- refactor(help): embed man pages without a tarball  (rust-lang/cargo#17640)
- refactor(cargo-test-support): remove build.rs (rust-lang/cargo#17638)
- fix: exclude abspath of path deps from `-Cmetadata` hash (rust-lang/cargo#17624)
- use build-rs for buildscripts (rust-lang/cargo#17637)

r? ghost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area: Command-line interface, option parsing, etc. A-documenting-cargo-itself Area: Cargo's documentation A-infrastructure Area: infrastructure around the cargo repo, ci, releases, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants