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

'cargo check' and 'cargo clippy' share message cache #8075

Closed
Vlad-Shcherbina opened this issue Apr 6, 2020 · 3 comments
Closed

'cargo check' and 'cargo clippy' share message cache #8075

Vlad-Shcherbina opened this issue Apr 6, 2020 · 3 comments
Labels
C-bug Category: bug

Comments

@Vlad-Shcherbina
Copy link

Steps to reproduce

  1. Create a new project with the following content:
    fn main() {
        0;
    }
  2. Run
    cargo clean
    cargo check
    cargo clippy
    
  3. Run
    cargo clean
    cargo clippy
    cargo check
    

Expected result

Step 2 should produce the following output:

> cargo clean
> cargo check
    Checking zzz v0.1.0 (C:\temp\zzz)
    Finished dev [unoptimized + debuginfo] target(s) in 0.22s
> cargo clippy
    Checking zzz v0.1.0 (C:\temp\zzz)
warning: statement with no effect
 --> src\main.rs:2:5
  |
2 |     0;
  |     ^^
  |
  = note: `#[warn(clippy::no_effect)]` on by default
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect

    Finished dev [unoptimized + debuginfo] target(s) in 0.40s

Step 3 should produce the following output:

> cargo clean
> cargo clippy
    Checking zzz v0.1.0 (C:\temp\zzz)
warning: statement with no effect
 --> src\main.rs:2:5
  |
2 |     0;
  |     ^^
  |
  = note: `#[warn(clippy::no_effect)]` on by default
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect

    Finished dev [unoptimized + debuginfo] target(s) in 0.40s
> cargo check
    Checking zzz v0.1.0 (C:\temp\zzz)
    Finished dev [unoptimized + debuginfo] target(s) in 0.22s

Actual result

Step 2 produces the following output

> cargo clean
> cargo check
    Checking zzz v0.1.0 (C:\temp\zzz)
    Finished dev [unoptimized + debuginfo] target(s) in 0.22s
> cargo clippy
    Finished dev [unoptimized + debuginfo] target(s) in 0.06s

Step 3 produces the following output

> cargo clean
> cargo clippy
    Checking zzz v0.1.0 (C:\temp\zzz)
warning: statement with no effect
 --> src\main.rs:2:5
  |
2 |     0;
  |     ^^
  |
  = note: `#[warn(clippy::no_effect)]` on by default
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect

    Finished dev [unoptimized + debuginfo] target(s) in 0.40s
> cargo check
warning: statement with no effect
 --> src\main.rs:2:5
  |
2 |     0;
  |     ^^
  |
  = note: `#[warn(clippy::no_effect)]` on by default
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect

    Finished dev [unoptimized + debuginfo] target(s) in 0.09s

Version info

> cargo --version --verbose
cargo 1.44.0-nightly (6e07d2dfb 2020-03-31)
release: 1.44.0
commit-hash: 6e07d2dfb7fc87b1c9489de41da4dafa239daf03
commit-date: 2020-03-31

> cargo clippy --version
clippy 0.0.212 (23549a8c 2020-03-16)clippy 0.0.212 (7907abea 2020-04-03)
@Vlad-Shcherbina Vlad-Shcherbina added the C-bug Category: bug label Apr 6, 2020
@Vlad-Shcherbina
Copy link
Author

I think this was supposed to be fixed in #7635 (comment) , but it wasn't. Latest nightly already includes that commit, but the cache is still shared.

@ehuss
Copy link
Contributor

ehuss commented Apr 6, 2020

It still requires an update on the clippy side, which is rust-lang/rust-clippy#5363, and it will be opt-in until it is stabilized.

@ehuss ehuss closed this as completed Apr 6, 2020
@Vlad-Shcherbina
Copy link
Author

Ok, thank you.


Meanwhile, here is a workaround.
Put this in your Cargo.toml:

[features]
clippy = []

To use separate message caches run cargo check and cargo clippy --features clippy.

lf- added a commit to lf-/ical-filter that referenced this issue Sep 25, 2020
Socket activation is necessary to make it easier to use systemd to
sandbox this service, since it's basically one big SSRF vector if not
sandboxed away from localhost and any local services whatsoever.

Also adds a hack per
rust-lang/cargo#8075 (comment)
so you can run `cargo clippy --features clippy`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants