Cannot install racer

On Debian 11.4
:~$ cargo --version
cargo 1.62.0 (a748cf5a3 2022-06-08)

~$ cargo +nightly install racer
Updating crates.io index
Installing racer v2.2.2
Compiling proc-macro2 v1.0.40
Compiling unicode-ident v1.0.1
Compiling quote v1.0.20
Compiling syn v1.0.98
Compiling serde_derive v1.0.139
Compiling serde v1.0.139
Compiling memchr v2.5.0
Compiling libc v0.2.126
Compiling serde_json v1.0.82
Compiling log v0.4.17
Compiling ryu v1.0.10
Compiling itoa v1.0.2
Compiling cfg-if v1.0.0
Compiling quick-error v1.2.3
Compiling unicode-width v0.1.9
Compiling regex-syntax v0.6.27
Compiling termcolor v1.1.3
Compiling strsim v0.8.0
Compiling ansi_term v0.12.1
Compiling convert_case v0.4.0
Compiling vec_map v0.8.2
Compiling bitflags v1.3.2
Compiling lazycell v1.3.0
Compiling lazy_static v1.4.0
Compiling humantime v2.1.0
Compiling humantime v1.3.0
Compiling textwrap v0.11.0
Compiling aho-corasick v0.7.18
Compiling atty v0.2.14
Compiling clap v2.34.0
Compiling regex v1.6.0
Compiling env_logger v0.7.1
Compiling derive_more v0.99.17
Compiling racer-interner v0.1.0
Compiling rls-span v0.5.4
Compiling racer-cargo-metadata v0.1.2
Compiling racer v2.2.2
error[E0463]: can't find crate for rustc_ast
--> /home/aurelien/.cargo/registry/src/github.com-1ecc6299db9ec823/racer-2.2.2/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

error[E0463]: can't find crate for rustc_ast_pretty
--> /home/aurelien/.cargo/registry/src/github.com-1ecc6299db9ec823/racer-2.2.2/src/racer/lib.rs:17:1
|
17 | extern crate rustc_ast_pretty;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
|
= help: maybe you need to install the missing components with: rustup component add rust-src rustc-dev llvm-tools-preview

error[E0463]: can't find crate for rustc_data_structures
--> /home/aurelien/.cargo/registry/src/github.com-1ecc6299db9ec823/racer-2.2.2/src/racer/lib.rs:18:1
|
18 | extern crate rustc_data_structures;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
|
= help: maybe you need to install the missing components with: rustup component add rust-src rustc-dev llvm-tools-preview

error[E0463]: can't find crate for rustc_errors
--> /home/aurelien/.cargo/registry/src/github.com-1ecc6299db9ec823/racer-2.2.2/src/racer/lib.rs:19:1
|
19 | extern crate rustc_errors;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
|
= help: maybe you need to install the missing components with: rustup component add rust-src rustc-dev llvm-tools-preview

error[E0463]: can't find crate for rustc_parse
--> /home/aurelien/.cargo/registry/src/github.com-1ecc6299db9ec823/racer-2.2.2/src/racer/lib.rs:20:1
|
20 | extern crate rustc_parse;
| ^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
|
= help: maybe you need to install the missing components with: rustup component add rust-src rustc-dev llvm-tools-preview

error[E0463]: can't find crate for rustc_session
--> /home/aurelien/.cargo/registry/src/github.com-1ecc6299db9ec823/racer-2.2.2/src/racer/lib.rs:21:1
|
21 | extern crate rustc_session;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
|
= help: maybe you need to install the missing components with: rustup component add rust-src rustc-dev llvm-tools-preview

error[E0463]: can't find crate for rustc_span
--> /home/aurelien/.cargo/registry/src/github.com-1ecc6299db9ec823/racer-2.2.2/src/racer/lib.rs:22:1
|
22 | extern crate rustc_span;
| ^^^^^^^^^^^^^^^^^^^^^^^^ 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.
error: could not compile racer due to 7 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile racer v2.2.2, intermediate artifacts can be found at /tmp/cargo-install7VvowJ

Have you tried running the suggested rustup component add command?

~$ cargo +nightly install rust-src rustc-dev llvm-tools-preview
Updating crates.io index
error: could not find rust-src in registry crates-io with version *
error: could not find rustc-dev in registry crates-io with version *
error: could not find llvm-tools-preview in registry crates-io with version *
Summary Failed to install rust-src, rustc-dev, llvm-tools-preview (see error(s) above).
error: some crates failed to install

You want to run rustup component add rust-src rustc-dev llvm-tools-preview, not cargo install.

1 Like

Why do you want to install racer at all? AFAIK, it's outdated for many versions of Rust already.

~$ rustup component add rust-src rustc-dev llvm-tools-preview
info: component 'rust-src' is up to date
info: downloading component 'rustc-dev'
info: installing component 'rustc-dev'
116.4 MiB / 116.4 MiB (100 %) 13.3 MiB/s in 8s ETA: 0s
info: downloading component 'llvm-tools-preview'
23.2 MiB / 23.2 MiB (100 %) 9.6 MiB/s in 2s ETA: 0s
info: installing component 'llvm-tools-preview'
23.2 MiB / 23.2 MiB (100 %) 14.5 MiB/s in 1s ETA: 0s
~$ cargo +nightly install racer
Updating crates.io index
Installing racer v2.2.2
Compiling proc-macro2 v1.0.40
Compiling unicode-ident v1.0.1
Compiling quote v1.0.20
Compiling syn v1.0.98
Compiling serde_derive v1.0.139
Compiling serde v1.0.139
Compiling libc v0.2.126
Compiling memchr v2.5.0
Compiling log v0.4.17
Compiling serde_json v1.0.82
Compiling regex-syntax v0.6.27
Compiling itoa v1.0.2
Compiling unicode-width v0.1.9
Compiling cfg-if v1.0.0
Compiling quick-error v1.2.3
Compiling ryu v1.0.10
Compiling convert_case v0.4.0
Compiling ansi_term v0.12.1
Compiling vec_map v0.8.2
Compiling termcolor v1.1.3
Compiling strsim v0.8.0
Compiling bitflags v1.3.2
Compiling lazy_static v1.4.0
Compiling lazycell v1.3.0
Compiling humantime v2.1.0
Compiling humantime v1.3.0
Compiling textwrap v0.11.0
Compiling aho-corasick v0.7.18
Compiling atty v0.2.14
Compiling clap v2.34.0
Compiling regex v1.6.0
Compiling env_logger v0.7.1
Compiling derive_more v0.99.17
Compiling racer-interner v0.1.0
Compiling rls-span v0.5.4
Compiling racer-cargo-metadata v0.1.2
Compiling racer v2.2.2
error[E0463]: can't find crate for rustc_ast
--> /home/aurelien/.cargo/registry/src/github.com-1ecc6299db9ec823/racer-2.2.2/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

error[E0463]: can't find crate for rustc_ast_pretty
--> /home/aurelien/.cargo/registry/src/github.com-1ecc6299db9ec823/racer-2.2.2/src/racer/lib.rs:17:1
|
17 | extern crate rustc_ast_pretty;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
|
= help: maybe you need to install the missing components with: rustup component add rust-src rustc-dev llvm-tools-preview

error[E0463]: can't find crate for rustc_data_structures
--> /home/aurelien/.cargo/registry/src/github.com-1ecc6299db9ec823/racer-2.2.2/src/racer/lib.rs:18:1
|
18 | extern crate rustc_data_structures;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
|
= help: maybe you need to install the missing components with: rustup component add rust-src rustc-dev llvm-tools-preview

error[E0463]: can't find crate for rustc_errors
--> /home/aurelien/.cargo/registry/src/github.com-1ecc6299db9ec823/racer-2.2.2/src/racer/lib.rs:19:1
|
19 | extern crate rustc_errors;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
|
= help: maybe you need to install the missing components with: rustup component add rust-src rustc-dev llvm-tools-preview

error[E0463]: can't find crate for rustc_parse
--> /home/aurelien/.cargo/registry/src/github.com-1ecc6299db9ec823/racer-2.2.2/src/racer/lib.rs:20:1
|
20 | extern crate rustc_parse;
| ^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
|
= help: maybe you need to install the missing components with: rustup component add rust-src rustc-dev llvm-tools-preview

error[E0463]: can't find crate for rustc_session
--> /home/aurelien/.cargo/registry/src/github.com-1ecc6299db9ec823/racer-2.2.2/src/racer/lib.rs:21:1
|
21 | extern crate rustc_session;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
|
= help: maybe you need to install the missing components with: rustup component add rust-src rustc-dev llvm-tools-preview

error[E0463]: can't find crate for rustc_span
--> /home/aurelien/.cargo/registry/src/github.com-1ecc6299db9ec823/racer-2.2.2/src/racer/lib.rs:22:1
|
22 | extern crate rustc_span;
| ^^^^^^^^^^^^^^^^^^^^^^^^ 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.
error: could not compile racer due to 7 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile racer v2.2.2, intermediate artifacts can be found at /tmp/cargo-install15PnEd

I try to have a correct configuration for Emacs ...

Most people use Rust Analyzer nowadays. Their website includes installation instructions for emacs.

2 Likes

Sadly, racer is essentially abandoned. I tried to use it with GNU Emacs for a time (it's packaged in my Linux distro — is it not in Debian?), because I'm unwilling to pay the cost (in memory, mainly) of rust-analyzer, but, although racer worked well enough for types in the standard library, it seemed unable to complete anything from other crates, even if run outside of Emacs, on the command line, and I eventually gave up on poor old racer.

2 Likes

Thanks for your response, I have use the @Michael-F-Bryan link with success ... it works like a charm, and let the user free to make some change ...
M-x works vertically ... but I will find a way or maybe change my habits for that design.
Thanks once again for your help!

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.