Skip to content

clippy-driver has unnecessary couplings with cargo #3663

Closed
@jsgf

Description

@jsgf

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:

  1. 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 use dep-info. It should just check for the presence of metadata.
  2. It also relies on 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 ..
  3. It relies on SYSROOT being set to find the compiler - it would be nice if there a way to derive SYSROOT from the path of the executable and inhibit the search for a rustup installation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-needs-testCall for participation: writing testsT-cargoType: cargo related

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions