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

Add ui_cargo_toml_metadata test #9216

Merged
merged 1 commit into from
Jul 21, 2022
Merged

Add ui_cargo_toml_metadata test #9216

merged 1 commit into from
Jul 21, 2022

Conversation

smoelius
Copy link
Contributor

@smoelius smoelius commented Jul 20, 2022

This PR adds a test to check the metadata of packages in the ui_cargo directory.

A recent change to Cargo causes it to warn when it finds multiple packages with the same name in a git dependency (the issue is described here).

Many (if not all) Dylint libraries depend upon clippy_utils. As a result of the change, one now sees the following when building a Dylint library:

warning: skipping duplicate package `fail` found at `/home/smoelius/.cargo/git/checkouts/rust-clippy-4b72815e96774b3d/0cb0f76/tests/ui-cargo/module_style/pass_mod`
warning: skipping duplicate package `fail` found at `/home/smoelius/.cargo/git/checkouts/rust-clippy-4b72815e96774b3d/0cb0f76/tests/ui-cargo/module_style/fail_no_mod`
warning: skipping duplicate package `cargo_common_metadata` found at `/home/smoelius/.cargo/git/checkouts/rust-clippy-4b72815e96774b3d/0cb0f76/tests/ui-cargo/cargo_common_metadata/fail_publish_true`
warning: skipping duplicate package `fail-cargo` found at `/home/smoelius/.cargo/git/checkouts/rust-clippy-4b72815e96774b3d/0cb0f76/tests/ui-cargo/cargo_rust_version/pass_cargo`
warning: skipping duplicate package `fail-clippy` found at `/home/smoelius/.cargo/git/checkouts/rust-clippy-4b72815e96774b3d/0cb0f76/tests/ui-cargo/cargo_rust_version/fail_clippy`
warning: skipping duplicate package `fail-both-same` found at `/home/smoelius/.cargo/git/checkouts/rust-clippy-4b72815e96774b3d/0cb0f76/tests/ui-cargo/cargo_rust_version/fail_both_same`
warning: skipping duplicate package `fail-file-attr` found at `/home/smoelius/.cargo/git/checkouts/rust-clippy-4b72815e96774b3d/0cb0f76/tests/ui-cargo/cargo_rust_version/fail_file_attr`

There appear to be two contributing factors:

  • Some packages in ui_cargo could have a publish = false added to them.
  • Some packages in ui_cargo seem to be inconsistently named.

The new test checks that each package in the ui_cargo directory has a name matching one of its parent directories, and publish = false in its metadata (with a few exceptions).

Note that the packages in cargo_common_metadata require special care because publish is the subject of some of the cargo_common_metadata tests.

Also note that this PR adds walkdir as a dev dependency to the clippy package. However, it was already a dependency of clippy_dev and lintcheck. So hopefully this is acceptable.

Our continued thanks for making clippy_utils available, BTW. :)

r? @flip1995

changelog: none

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jul 20, 2022
@flip1995
Copy link
Member

Oh wow, the ui_cargo tests were a total mess. Thanks for fixing this and ensuring that it stays this way!

@bors r+

@bors
Copy link
Contributor

bors commented Jul 21, 2022

📌 Commit 5b3300d has been approved by flip1995

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jul 21, 2022

⌛ Testing commit 5b3300d with merge bc903cd...

@bors
Copy link
Contributor

bors commented Jul 21, 2022

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: flip1995
Pushing bc903cd to master...

@bors bors merged commit bc903cd into rust-lang:master Jul 21, 2022
smoelius added a commit to trailofbits/dylint that referenced this pull request Aug 2, 2022
Upgrade examples to `nightly-2022-07-28` and `clippy_utils` `3c7e7db` to
eliminate Cargo-emitted warning.

See: rust-lang/rust-clippy#9216
smoelius added a commit to trailofbits/dylint that referenced this pull request Aug 2, 2022
Upgrade examples to `nightly-2022-07-28` and `clippy_utils` `3c7e7db` to
eliminate Cargo-emitted warning.

See: rust-lang/rust-clippy#9216
smoelius added a commit to trailofbits/dylint that referenced this pull request Aug 3, 2022
Upgrade examples to `nightly-2022-07-28` and `clippy_utils` `3c7e7db` to
eliminate Cargo-emitted warning.

See: rust-lang/rust-clippy#9216
smoelius added a commit to trailofbits/dylint that referenced this pull request Aug 5, 2022
Upgrade examples to `nightly-2022-07-28` and `clippy_utils` `3c7e7db` to
eliminate Cargo-emitted warning.

See: rust-lang/rust-clippy#9216
smoelius added a commit to trailofbits/dylint that referenced this pull request Aug 5, 2022
Upgrade examples to `nightly-2022-07-28` and `clippy_utils` `3c7e7db` to
eliminate Cargo-emitted warning.

See: rust-lang/rust-clippy#9216
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants