-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
cargo publish --dry-run doesn't perform metadata checks #14249
Comments
I think Cargo has do the metada check in any case and warn
And the error is retured by createio api if you real publish without
This can be cc #3662 |
btw it would be good to include all of the information with your reproduction steps $ cargo new epage-dry-run-publish-test
Creating binary (application) `epage-dry-run-publish-test` package
note: see more `Cargo.toml` keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
$ cd epage-dry-run-publish-test/
$ 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 epage-dry-run-publish-test v0.1.0 (/home/epage/src/personal/dump/epage-dry-run-publish-test)
Verifying epage-dry-run-publish-test v0.1.0 (/home/epage/src/personal/dump/epage-dry-run-publish-test)
Compiling epage-dry-run-publish-test v0.1.0 (/home/epage/src/personal/dump/epage-dry-run-publish-test/target/packag
e/epage-dry-run-publish-test-0.1.0)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.10s
Packaged 4 files, 876.0B (684.0B compressed)
$ cargo publish -n --allow-dirty
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 epage-dry-run-publish-test v0.1.0 (/home/epage/src/personal/dump/epage-dry-run-publish-test)
Verifying epage-dry-run-publish-test v0.1.0 (/home/epage/src/personal/dump/epage-dry-run-publish-test)
Compiling epage-dry-run-publish-test v0.1.0 (/home/epage/src/personal/dump/epage-dry-run-publish-test/target/packag
e/epage-dry-run-publish-test-0.1.0)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.38s
Packaged 4 files, 876.0B (684.0B compressed)
Uploading epage-dry-run-publish-test v0.1.0 (/home/epage/src/personal/dump/epage-dry-run-publish-test)
warning: aborting upload due to dry run
$ cargo publish --allow-dirty
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 epage-dry-run-publish-test v0.1.0 (/home/epage/src/personal/dump/epage-dry-run-publish-test)
Verifying epage-dry-run-publish-test v0.1.0 (/home/epage/src/personal/dump/epage-dry-run-publish-test)
Compiling epage-dry-run-publish-test v0.1.0 (/home/epage/src/personal/dump/epage-dry-run-publish-test/target/packag
e/epage-dry-run-publish-test-0.1.0)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.33s
Packaged 4 files, 876.0B (684.0B compressed)
Uploading epage-dry-run-publish-test v0.1.0 (/home/epage/src/personal/dump/epage-dry-run-publish-test)
error: failed to publish to registry at https://crates.io
Caused by:
the remote server responded with an error (status 400 Bad Request): missing or empty metadata fields: description, l
icense. Please see https://doc.rust-lang.org/cargo/reference/manifest.html for more information on configuring these f
ields From this, we notice that Cargo is doing validation, via the warnings (see also #4840). The problem is coming from the server side response. #4377 is tracking Cargo's publish validation logic, closing in favor of that. If there is a reason we should keep this open separately, let us know! |
Problem
When running cargo publish --dry-run it doesn't perform all checks, as it says in the documentation. Namely it doesn't check that certain metadata fields such as license or license-file, description, homepage, repository and readme.
Steps
create a blank cargo project (cargo new foo)
login to crates.io (cargo login)
cargo publish --dry-run --allow-dirty (this should succeed)
cargo publish --allow-dirty (this will fail)
Possible Solution(s)
check for this metadata in the dry-release
Notes
would happy to implement this
Version
The text was updated successfully, but these errors were encountered: