Repository navigation
build: link each crate's README from its manifest - #838
Merged
Merged
Conversation
Every workspace crate has had a README since NVIDIA#818, and no manifest pointed at one. `readme` is what puts that file on the crate's docs.rs and crates.io front page; without it those pages carry the one-line `description` and nothing else. Twenty-four of the twenty-six crates are publishable, so the READMEs were written and then left unreachable from the place a reader arrives. Per-crate rather than inherited, deliberately. `[workspace.package]` carries edition, authors, license and repository, and inheriting `readme` from there would resolve every crate's path against the workspace root -- pointing all twenty-six at the top-level README instead of their own. Cargo offers no relative-to-member form, so the key belongs in each manifest, next to `description`, which is the other per-crate metadata key. Applied to all twenty-six, including the two `publish = false` crates. The key is inert there, and a uniform rule is easier to keep than an exception list that invites the question later. Verified: `cargo metadata --locked` parses and now reports a readme for 25/25 members it resolves, every path points at a file that exists, and the license inventory guard -- which reads `cargo metadata` -- is still green. Signed-off-by: Vyncint Ng <[email protected]>
Collaborator
|
Gist: right change, wrong story. The explicit Verified here:
Landing once CI is green. |
nihalpasham
approved these changes
Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every workspace crate has had a README since #818, and no manifest pointed at
one. This adds an explicit
readme = "README.md"key to all twenty-six.What the key changes: Cargo has auto-inferred a root
README.mdsince 1.46,so crates.io already picked these files up without it (and docs.rs front pages
render the crate docs from
lib.rs, not the README, either way). What theexplicit key adds is robustness and self-documentation: if a named README is
renamed or deleted,
cargo packagefails loudly instead of silentlypublishing a bare page, and tools reading crate metadata get a stated link
rather than an inference. Large workspaces (tokio, serde, clap) write the key
for the same reason.
Per-crate, not inherited — deliberately
[workspace.package]already carriesedition,authors,licenseandrepository, and each crate inherits them with.workspace = true.readmecannot follow that pattern: Cargo resolves a workspace-level
readmerelative to the workspace root, so inheriting it would point all
twenty-six crates at the top-level README instead of their own. There is no
relative-to-member form, so the key belongs in each manifest — placed next to
description, the other per-crate metadata key.Applied to all twenty-six, including the two
publish = falsecrates. The keyis inert there, and a uniform rule is easier to keep than an exception list
that invites the question later.
Verification
cargo metadata --lockedparses; every member reports a readme (as beforevia inference; now stated explicitly);
readmepath points at a file that exists (checked, 0 broken);scripts/check-dependency-licenses.sh, which readscargo metadata, isstill green — the one guard this could plausibly have disturbed.
No code, no behaviour change.
(Maintainer edit: reworded the motivation and first verification bullet — the
original text described READMEs as unreachable without the key, but Cargo
auto-infers a root README.md since 1.46; the key's value is the fail-loud
cargo packagecheck and explicitness, not new rendering.)