racer-rust / racer

Rust Code Completion utility
MIT License
3.36k stars 278 forks source link

Cannot build from source with system Rust install #1176

Closed muke101 closed 2 years ago

muke101 commented 2 years ago

I'm running Gentoo and have Rust installed via my package manager (nightly enabled). This means I can't use rustup to install racer, so I'm trying to build from source and install that. When building racer I get the following error:

error[E0463]: can't find crate for `rustc_ast`
  --> src/racer/lib.rs:16:1
   |
16 | extern crate rustc_ast;
   | ^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

For more information about this error, try `rustc --explain E0463`.

I definitely have the missing components installed with my systems Rust install, so I'm unsure why I'm getting this error. Can anyone provide some help on this or do I really have to be using rustup to get racer to work?

calebcartwright commented 2 years ago

This means I can't use rustup to install racer,

I'm not quite sure what you mean here, as rustup can never be used to install racer.

You must have the requisite components, including rustc-dev, available to compile racer, and I highly doubt rustc-dev is bundled with any package manager install

https://github.com/racer-rust/racer#current-nightly-rust

muke101 commented 2 years ago

Can you clarify a little on what rustc-dev is? Is that a separate binary? Gentoo doesn't have any -dev packages and should contain all the necessary build components in it's packages.

calebcartwright commented 2 years ago

https://rust-lang.github.io/rustup/concepts/components.html

muke101 commented 2 years ago

Ah, it's just another component ok. Rust doesn't have a use flag to enable this so will have to request it's added or something, but thanks for the help anyway.