Artisan-Lab / RAP

Rust Analysis Platform
39 stars 14 forks source link

Does this tool must run on cargo environments and given toolchain version? #69

Open Yinwhe opened 2 weeks ago

Yinwhe commented 2 weeks ago

Hi, I got two questions about this tools:

  1. I notice that this tool use rustc_private feature and TyCtxt as the core structures for functionality. However, in some scenario we may not be able build the crates directly (for example, in FFI cases, we may use Makefile and rustc directly to build the projects), and thus, we can only have the MIR codes. Is it possible to use these MIR files for analysis?
  2. Similarly, if the target projects cannot be built using the given toolchain version, can this tool easily move to another version? What's the development overhead?
hxuhack commented 1 week ago

I notice that this tool use rustc_private feature and TyCtxt as the core structures for functionality. However, in some scenario we may not be able build the crates directly (for example, in FFI cases, we may use Makefile and rustc directly to build the projects), and thus, we can only have the MIR codes. Is it possible to use these MIR files for analysis?

Many projects with makefiles also employ Cargo build. You may search the Cargo.toml file within the project to run RAP. Can you give an example if this does not work for you?

Similarly, if the target projects cannot be built using the given toolchain version, can this tool easily move to another version? What's the development overhead?

Since Rustc maintains a good backward compatibility for existing Rust projects, we will continuously upgrade our tool based on the latest Rustc version.