-
Notifications
You must be signed in to change notification settings - Fork 1.6k
clippy-driver has unnecessary couplings with cargo #3663
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
Comments
Rather than looking for a fixed --emit arg set, just check to see if we're emitting metadata at all. This makes it more robust to being invoked by tools other than cargo (or if cargo changes its invocation). Issue rust-lang#3663
If the user explicitly sets sysroot on the command line, then use that value. Issue rust-lang#3663
Rather than looking for a fixed --emit arg set, just check to see if we're emitting metadata at all. This makes it more robust to being invoked by tools other than cargo (or if cargo changes its invocation). Issue rust-lang#3663
If the user explicitly sets sysroot on the command line, then use that value. Issue rust-lang#3663
I think we should setup a somewhat realistic test scenario for non-cargo uses. Mostly this is covered by our compiletest suite but that one is very fine tuned to replicate some of cargo's quicks. We should just add a test script to travis that runs |
Thanks for the feedback - yeah I'm specifically looking for advice on how to test this. And I also want to actually deploy it locally to make sure these changes are necessary and sufficient. |
For testing I'd create a script (to run locally and on CI) that runs To really test a non-rustup system we'd probably need to compile a |
It did strike me as odd that setting compile-time env vars overrides all the runtime ways of setting things. The normal convention is to take these things in order of preference:
(that is, more specific to a particular invocation to least) Is there a specific reason for clippy-driver's order? |
Rather than looking for a fixed --emit arg set, just check to see if we're emitting metadata at all. This makes it more robust to being invoked by tools other than cargo (or if cargo changes its invocation). Issue rust-lang#3663
If the user explicitly sets sysroot on the command line, then use that value. Issue rust-lang#3663
Rather than looking for a fixed --emit arg set, just check to see if we're emitting metadata at all. This makes it more robust to being invoked by tools other than cargo (or if cargo changes its invocation). Issue rust-lang#3663
If the user explicitly sets sysroot on the command line, then use that value. Issue rust-lang#3663
Historically homegrown spaghetti code I think it would be totally fine to invert the order. |
Rather than looking for a fixed --emit arg set, just check to see if we're emitting metadata at all. This makes it more robust to being invoked by tools other than cargo (or if cargo changes its invocation). Issue rust-lang#3663
If the user explicitly sets sysroot on the command line, then use that value. Issue rust-lang#3663
CARGO_MANIFEST_DIR if it isn't set. If CARGO_MANIFEST_DIR isn't set, fall back "." rather than panicing. Issue rust-lang#3663
If the user explicitly sets sysroot on the command line, then use that value. Issue rust-lang#3663
CARGO_MANIFEST_DIR if it isn't set. If CARGO_MANIFEST_DIR isn't set, fall back "." rather than panicing. Issue rust-lang#3663
Rather than looking for a fixed --emit arg set, just check to see if we're emitting metadata at all. This makes it more robust to being invoked by tools other than cargo (or if cargo changes its invocation). Issue rust-lang#3663
If the user explicitly sets sysroot on the command line, then use that value. Issue rust-lang#3663
CARGO_MANIFEST_DIR if it isn't set. If CARGO_MANIFEST_DIR isn't set, fall back "." rather than panicing. Issue rust-lang#3663
@oli-obk OK, I tried adding a test but the last travis run fell over on unrelated problems. |
our CI works again (for now 😆 ) |
Rather than looking for a fixed --emit arg set, just check to see if we're emitting metadata at all. This makes it more robust to being invoked by tools other than cargo (or if cargo changes its invocation). Issue rust-lang#3663
If the user explicitly sets sysroot on the command line, then use that value. Issue rust-lang#3663
CARGO_MANIFEST_DIR if it isn't set. If CARGO_MANIFEST_DIR isn't set, fall back "." rather than panicing. Issue rust-lang#3663
@jsgf I think you resolved all the 3 points in the main post of this issue. Thus I'm closing the issue. Please open new issues with any problems in this direction that you encounter |
I'm trying to use clippy-driver in a non-cargo build system (Buck), by using it as a drop-in replacement for rustc. There are a few ways in which this could be improved:
clippy-driver
looks to see if its doing a check build by explicitly looking for the string--emit=dep-info,metadata
, which is the string that Cargo uses. This is brittle - for example, Buck's#check
builds don't usedep-info
. It should just check for the presence ofmetadata
.CARGO_MANIFEST_DIR
being set to find.?clippy.toml
, and panics if it isn't. It should at least fall back to a default dir like.
.SYSROOT
being set to find the compiler - it would be nice if there a way to deriveSYSROOT
from the path of the executable and inhibit the search for a rustup installation.The text was updated successfully, but these errors were encountered: