I am currently working on a project that interfaces with parts of the Rust compiler. To do this, I am using the rustc_driver crate, along with a few other rustc crates like session and interface. When I go to build the executable, the compiler dynamically links libstd. Is there I way that I can force it to be statically linked instead?
Gotcha. I think I found something on the docs yesterday that says that I'm supposed to use rustc_interface in a library instead of rustc_driver. It just means that I have to do more work on my end I guess.
Yes, that is my fork of kythe/kythe. I am working with the team for my summer internship to bring Rust support to the tool. Our functionality is different than a language server, so we need to interface with the compiler ourselves. Thank you for the help!
Rust-analyzer isn't just a language server. It does everything from parsing to name resolution and type inference itself. It doesn't use rustc. The kind of information Kythe seems to provide to tools is pretty much what rust-analyzer has been optimized to quickly and lazily compute. Incremental recompilation in check mode with rustc can take several seconds where rust-analyzer does so in less than a second. rust-analyzer has been developed as replacement of rls, which does use rustc to compute all information. Rls is much slower however and is missing many nice features.
Ah gotcha! I was confused because I have seen it used in language server plugins before. The main reason we have been looking at using Rustc is because we receive source and .rlib files as inputs. But if rust-analyzer can produce analysis using those files as inputs, I will definitely work to use that API in the Rust indexer.