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

fix(toml): Convert warnings that licence and readme files do not exist into errors #13921

Merged
merged 1 commit into from
Jun 9, 2024

Conversation

heisen-li
Copy link
Contributor

What does this PR try to resolve?

In this PR:

  • Changed the warning to a hard error and modified the associated test function;
  • Removed what should have been a redundant test function:publish::publish_with_missing_readme
  • Since cargo publish is preceded by the execution of cargo package, the error message in the test function bad_license_file needs to be modified.

issue: #13629 (comment).

Additional information

It seems that this is not enough, the current situation is that cargo package warns if package.readme is an empty string or the wrong file location, but if I cancel package.readme, no warning is generated.

I'm wondering if I should judge package.readme&licence when executing cargo package and return an error if it doesn't exist?

As this has not been done before, your advice is sought.

@rustbot
Copy link
Collaborator

rustbot commented May 16, 2024

r? @epage

rustbot has assigned @epage.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added Command-package S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 16, 2024
@weihanglo
Copy link
Member

@bors try

@bors
Copy link
Collaborator

bors commented May 29, 2024

⌛ Trying commit 5c35e29 with merge 2faa4a0...

bors added a commit that referenced this pull request May 29, 2024
fix(toml): Convert warnings that `licence` and `readme` files do not exist into errors

### What does this PR try to resolve?

In this PR:
- Changed the warning to a hard error and modified the associated test function;
- Removed what should have been a redundant test function:`publish::publish_with_missing_readme`;
- Since `cargo publish` is preceded by the execution of `cargo package`, the error message in the test `function bad_license_file` needs to be modified.

issue: #13629 (comment).

### Additional information

It seems that this is not enough, the current situation is that `cargo package` warns if `package.readme` is an empty string or the wrong file location, but if I cancel `package.readme`, no warning is generated.

I'm wondering if I should judge `package.readme&licence` when executing `cargo package` and return an error if it doesn't exist?

As this has not been done before, your advice is sought.
@bors
Copy link
Collaborator

bors commented May 29, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 29, 2024
@weihanglo
Copy link
Member

@bors try

bors added a commit that referenced this pull request May 29, 2024
fix(toml): Convert warnings that `licence` and `readme` files do not exist into errors

### What does this PR try to resolve?

In this PR:
- Changed the warning to a hard error and modified the associated test function;
- Removed what should have been a redundant test function:`publish::publish_with_missing_readme`;
- Since `cargo publish` is preceded by the execution of `cargo package`, the error message in the test `function bad_license_file` needs to be modified.

issue: #13629 (comment).

### Additional information

It seems that this is not enough, the current situation is that `cargo package` warns if `package.readme` is an empty string or the wrong file location, but if I cancel `package.readme`, no warning is generated.

I'm wondering if I should judge `package.readme&licence` when executing `cargo package` and return an error if it doesn't exist?

As this has not been done before, your advice is sought.
@bors
Copy link
Collaborator

bors commented May 29, 2024

⌛ Trying commit 5c35e29 with merge 8c704a8...

@bors
Copy link
Collaborator

bors commented May 29, 2024

☀️ Try build successful - checks-actions
Build commit: 8c704a8 (8c704a85981cad6eaf25a0e12a6a290f6d234c5c)

src/cargo/ops/cargo_package.rs Outdated Show resolved Hide resolved
src/cargo/ops/cargo_package.rs Show resolved Hide resolved
tests/testsuite/package.rs Outdated Show resolved Hide resolved
@heisen-li heisen-li force-pushed the licence_readme_warning branch 2 times, most recently from 54e7613 to d780220 Compare June 4, 2024 03:18
Copy link
Member

@weihanglo weihanglo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Also schedule this to merge after 1.81 nightly comes out.

@weihanglo
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 9, 2024

📌 Commit 193319c has been approved by weihanglo

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. labels Jun 9, 2024
@bors
Copy link
Collaborator

bors commented Jun 9, 2024

⌛ Testing commit 193319c with merge ab85225...

@bors
Copy link
Collaborator

bors commented Jun 9, 2024

☀️ Test successful - checks-actions
Approved by: weihanglo
Pushing ab85225 to master...

@bors bors merged commit ab85225 into rust-lang:master Jun 9, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Command-package S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants