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

How to cargo clean only a sub crate of a workspace? #5788

Closed
Boscop opened this issue Jul 25, 2018 · 4 comments · Fixed by #8210
Closed

How to cargo clean only a sub crate of a workspace? #5788

Boscop opened this issue Jul 25, 2018 · 4 comments · Fixed by #8210

Comments

@Boscop
Copy link

Boscop commented Jul 25, 2018

How to cargo clean only a sub crate of a workspace?
I tried cargo clean -p cratename but it didn't work..

I wanted to run clippy on the subcrate without having to clean & rebuild the main crate because rebuilding takes hours. But clippy just said Finished dev [optimized + debuginfo] target(s) in 7.01s but it didn't say "compiling ...", so I want to clean only the sub crate.

@ehuss
Copy link
Contributor

ehuss commented Jul 25, 2018

I tried cargo clean -p cratename but it didn't work..

It should work. Can you say more about what happened?

In particular for check, you should see this:

  1. Notice target/debug/deps/libNAME-*.rmeta exists from previous check runs.
  2. Run cargo clean -p NAME.
  3. Check if target/debug/deps/libNAME-*.rmeta has been removed.
  4. Running cargo check -p NAME should re-check the NAME package and regenerate the rmeta file.

@Boscop
Copy link
Author

Boscop commented Jul 25, 2018

Why check? I'm talking about clean :)

@ehuss
Copy link
Contributor

ehuss commented Jul 25, 2018

Oh...some reason my brain translated clippy to check (they use similar mechanisms underneath). Just substitute the word "clippy" for "check", it's the same (they both generate rmeta files).

Are you using "cargo clippy" from the command-line? Or maybe using the new integrated rls support?

@dwijnand
Copy link
Member

The other way to rerun Clippy is to touch the lib.rs/main.rs of the crate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants