Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Lokathor opened this issue Sep 18, 2019 · 3 comments
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself. Command-publish S-triage Status: This issue is waiting on initial triage.

Comments

@Lokathor
Copy link

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 rust-lang/rust#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)

@stefanhoelzl
Copy link

I tried to reproduce your issue, but didn't get the same result with cargo build

$ cargo --version
cargo 1.41.0-nightly (750cb1482 2019-11-23)

$ cargo new issue-7380
     Created binary (application) `issue-7380` package
$ cd issue-7380

$ cargo build
   Compiling issue-7380 v0.1.0 (/Users/stefan/Development/cargo-issues/issue-7380)
    Finished dev [unoptimized + debuginfo] target(s) in 3.28s

$ cargo package --allow-dirty
warning: manifest has no description, license, license-file, documentation, homepage or repository.
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
   Packaging issue-7380 v0.1.0 (/Users/stefan/Development/cargo-issues/issue-7380)
   Verifying issue-7380 v0.1.0 (/Users/stefan/Development/cargo-issues/issue-7380)
   Compiling issue-7380 v0.1.0 (/Users/stefan/Development/cargo-issues/issue-7380/target/package/issue-7380-0.1.0)
    Finished dev [unoptimized + debuginfo] target(s) in 0.53s

$ cargo  publish --allow-dirty --dry-run
    Updating crates.io index
warning: manifest has no description, license, license-file, documentation, homepage or repository.
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
   Packaging issue-7380 v0.1.0 (/Users/stefan/Development/cargo-issues/issue-7380)
   Verifying issue-7380 v0.1.0 (/Users/stefan/Development/cargo-issues/issue-7380)
   Compiling issue-7380 v0.1.0 (/Users/stefan/Development/cargo-issues/issue-7380/target/package/issue-7380-0.1.0)
    Finished dev [unoptimized + debuginfo] target(s) in 1.00s
   Uploading issue-7380 v0.1.0 (/Users/stefan/Development/cargo-issues/issue-7380)
warning: aborting upload due to dry run

cargo build doesn't raise any warnings. cargo package and cargo publish raise the same warnings.

There is still the point to stop the publishing process on (any?) warnings. I think that could be discussed what the desired behavior is.

@stefanhoelzl
Copy link

was trying to fix this issue and have a proposed solution here.

It denies a incomplete manifest during publishing, but it can be overwritten with --allow-incomplete-manifest

@epage
Copy link
Contributor

epage commented Nov 2, 2023

We'd likely want to do this on every invocation or on every lint invocation and be subject to #12235, rather than fail during publish

  • Gives users control over the process in case its intentional
  • Lets people know earlier in the process.

@epage epage added S-triage Status: This issue is waiting on initial triage. A-diagnostics Area: Error and warning messages generated by Cargo itself. labels Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself. Command-publish S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

4 participants