rust-lang / rust-lang/cargo

The "unused manifest key" warning doesn't print or halt the publishing with `cargo publish`

Open
#7,380 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-diagnostics A-new-lint Command-publish S-triage
Dominant language
Rust
Stars
15.5k
Forks
3k
Avg merge
23h 30m
Merged PRs (30d)
51

Description

Normally if you have a manifest key that cargo doesn't understand many of the commands will print a warning

D:\dev\cargo-gba>cargo build
warning: unused manifest key: package.repsitory

However, if you use cargo publish not only does the accidental key not halt the publishing process without an override flag (as one might expect, similar to how you can't publish with a dirty git state without a flag), but it doesn't even directly print the warning about a bad key. Instead I got the warning about "no documentation, homepage or repository."

D:\dev\cargo-gba>cargo publish
    Updating crates.io index
warning: manifest has no documentation, homepage or repository.
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.

(Was posted as https://github.com/rust-lang/rust/issues/64476 and then I was told to repost here because apparently there's a gap in the permissions among triage folks, which has already also been reported elsewhere so we can have that solved too soon enough)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with a manifest containing an unused key, then compare the output and publishing behavior of cargo build and cargo publish. Trace the publish command's manifest validation and warning handling. Done means cargo publish reports the unused key clearly and applies the intended publishing validation behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.