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

clippy options in .cargo/config causes constant rebuilds #412

Closed
jtracey opened this issue Jun 15, 2022 · 7 comments
Closed

clippy options in .cargo/config causes constant rebuilds #412

jtracey opened this issue Jun 15, 2022 · 7 comments
Labels

Comments

@jtracey
Copy link

jtracey commented Jun 15, 2022

I'm not sure if this is a bug in rustic, rust-analyzer, or lsp, and I haven't been very successful in tracking down what's going on, so feel free to point me elsewhere. When I open a file in the coreutils project, clippy is run as the linter. If I then run clippy from the command line, it treats it as a clean rebuild, and vice versa. It seems like the problem is the additional clippy flags in .cargo/config, like the cache is invalidated because they aren't being applied when run via rustic.

@brotzeit
Copy link
Owner

Can you show me your lsp-mode config please.

@brotzeit
Copy link
Owner

Can you try if it works when you add the config options to lsp-rust-analyzer-cargo-watch-args. But you're right it should pick up the config automatically.

@appetrosyan
Copy link

I would consider using the cargo lints package instead. https://lib.rs/crates/cargo-lints, it's supported by Rustic, and much more convenient.

@appetrosyan
Copy link

Additionally, the reason which causes a rebuild could be either one of the build.rs scripts.

https://github.com/uutils/coreutils/blob/70d8864fe146d2578ea100b3edeb17135d3e79c9/src/uu/factor/build.rs

@appetrosyan
Copy link

In fact, judging by how many scripts require you to ignore the build.rs I'd imagine that it's a little buggy and triggers a re-compilation when the dependencies haven't really changed.

@appetrosyan
Copy link

Update: cargo-lints is no longer maintained. The original workaround is not suitable anymore.

@jtracey
Copy link
Author

jtracey commented Sep 29, 2024

Turns out this was never an issue with any of rustic, rust-analyzer, or lsp, but a known behavior with cargo itself. See, e.g., rust-lang/cargo#14551

@jtracey jtracey closed this as completed Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants