I altered the linting messages in Clippy by forking the Clippy repo and changing for example "clippy_lints/no_panics.rs" to alter the message shown when clippy is not told what to do in the presence of panicking code. (my real use case requires more, but it also needs at least what I described now)
- I forked the Clippy repo to a folder called
clippy-clone
. - I run
cargo build
which creates two binariescargo-clippy.exe
andclippy-driver.exe
.
Now running this cargo-clippy
(with target\debug\cargo-clippy
) in the forked clippy folder seems to work as intended: it shows my changed lint message.
Now I want to use my own clippy version on some other folder.
- I traverse to that folder (sibling of the clippy clone)
- I run
..\clippy-clone\target\debug\cargo-clippy
It errors and gives:
PS C:\Users\sibling-dir> ..\clippy-clone\target\debug\cargo-clippy
error: failed to run `rustc` to learn about target-specific information
Caused by:
process didn't exit successfully: `C:\Users\clippy-clone\target\debug\clippy-driver.exe rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit code: 0xc0000135, STATUS_DLL_NOT_FOUND)
So how do I built this fork properly and run it as a standalone application from any cargo project folder on my pc? I'm assuming it has something to do with other files (besides cargo-clippy.exe
) not being present, but for example the real clippy can also be run from every folder, I want this same behaviour.