Warn instead of error in cargo package on empty readme or license-file in manifest#12036
Merged
bors merged 3 commits intorust-lang:masterfrom Apr 25, 2023
Merged
Conversation
Collaborator
|
r? @epage (rustbot has picked a reviewer for you, use r? to override) |
kylematsuda
commented
Apr 25, 2023
| "\ | ||
| [WARNING] readme `` does not appear to exist (relative to `[..]/foo`). | ||
| Please update the readme setting in the manifest at `[..]/foo/Cargo.toml` | ||
| This may become a hard error in the future. |
Contributor
Author
There was a problem hiding this comment.
For the wording here, I just copied the existing warning when license-file doesn't exist. Not sure if it's appropriate for readme or if it needs to be tweaked. If I understand correctly, one of license or license-file is required for crates.io, but it's okay for the readme to be missing, so not sure that the "hard error" caution is accurate here
Contributor
There was a problem hiding this comment.
I think a hard error caution is warranted because the user told us to do something and we couldn't do it.
Contributor
|
@bors r+ |
Contributor
Contributor
Contributor
|
☀️ Test successful - checks-actions |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 26, 2023
Update cargo 17 commits in de80432f04da61d98dcbbc1572598071718ccfd2..9e586fbd8b931494067144623b76c37d213b1ab6 2023-04-21 13:18:32 +0000 to 2023-04-25 22:09:11 +0000 - Update home dependency (rust-lang/cargo#12037) - Warn instead of error in `cargo package` on empty `readme` or `license-file` in manifest (rust-lang/cargo#12036) - Clarify documentation around test target setting. (rust-lang/cargo#12032) - fix: apply `[env]` to target info discovery rustc (rust-lang/cargo#12029) - CI: ensure intra links for all members are checked (rust-lang/cargo#12025) - chore: make credential dependencies platform-specific (rust-lang/cargo#12027) - CI: use `-p` to specify workspace members instead of `--manifest-path` (rust-lang/cargo#12024) - ci: requires `test_gitoxide` and `lockfile` for both bors success and failure (rust-lang/cargo#12026) - Update windows-sys (rust-lang/cargo#12021) - Bump libc to 0.2.142 (rust-lang/cargo#12014) - Update openssl-src to 111.25.3+1.1.1t (rust-lang/cargo#12005) - Improve error message for empty dep (rust-lang/cargo#12001) - Remove wrong url in benchsuite manifest. (rust-lang/cargo#12020) - Bump versions of local crates (rust-lang/cargo#12019) - Add the Win32_System_Console feature since it is used (rust-lang/cargo#12016) - Update outdated crates.io URLs in publishing guide (rust-lang/cargo#12018) - Allow named debuginfo options in Cargo.toml (rust-lang/cargo#11958) r? `@ghost`
13 tasks
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.
What does this PR try to resolve?
Fixes #11522. The cause of the problem is that
cargo packageandcargo publishfail ifreadme = ""orlicense-file = ""in the manifest.This PR changes the
build_ar_listfunction to check that thereadmeandlicense-filepaths point to a file (instead of checking if the paths simply exist), and emits a warning if not. This should also catch the related failure case when either value is a valid path to a directory (e.g.,readme = "./src").Changes to warnings:
license-file: extends the existing warning whenlicense-filepoints to a non-existent path to also cover the case where it points to a directoryreadme: new warning whenreadmeis not a path to a fileHow should we test and review this PR?
Please see the new integration tests in
testsuite/package.rs. Thanks!