atom-racer
atom-racer copied to clipboard
racer returned a non-zero exit code: 1 null
Path to the Racer executable is /home/amos/custom/racer/target/release/racer
. It looks right to me:
➜ rust git:(master) which racer
/home/amos/custom/racer/target/release/racer
Path to the Rust source code directory is /home/amos/custom/rust
. Also looks right to me:
➜ rust git:(master) pwd
/home/amos/custom/rust
➜ rust git:(master) ls
AUTHORS.txt COPYRIGHT LICENSE-MIT README.md
config.mk dist Makefile RELEASES.md
config.stamp dl Makefile.in src
configure doc man tmp
CONTRIBUTING.md LICENSE-APACHE mk x86_64-unknown-linux-gnu
language-rust
is installed.
Do you recognize this error message, or is it a bug with racer? If so, how can I get more information so I can file it with the racer folks?
I ran into this same issue at first.
In the atom-racer
settings, try setting your "Path to the Rust source code directory" not to the root of the rust repo but to the src/
directory within it. So, in your case, try /home/amos/custom/rust/src/
.
Maybe the README.md
could be slightly clearer on this point.
I'd happily take a PR that fixed this to support both sets of paths :)
Also seeing this problem... is there a way I can see the output from racer
to try to work out what's going on?
I have this problem, but I don't see anything I may have configured wrong. I have the racerBinPath
pointing to the executable (/Users/CodenameLambda/.cargo/bin/racer
) and I have the rustSrcPath
pointing to the source directory in the Rust-Repository (/Users/CodenameLambda/rust/src
).
The best thing is: It does work under the shell with no problems (racer complete std::f
yields me the three modules fmt
, ffi
and fs
).
Any idea where this could come from?
The best thing about it is: It works if I start atom from the shell. I have no idea why.
(MacOS X, and I am not proud of it, put I have no choice. I want my linux back! Everything just works under linux, but I had so many problems under MacOS X now...)
Had the same issue on Windows, but setting the RUST_SRC_PATH
environment variable manually seems to have fixed it.
I can confirm that manually setting RUST_SRC_PATH
fixed the same issue on OS X as well.
same problem, also fixed by setting RUST_SRC_PATH
, which is linked to the rust repo cloned from github
Had the same problem, was fixed setting RUST_SRC_PATH
on Arch Linux
versions
rustc 1.14.0-nightly (a7bfb1aba 2016-10-09)
Atom : 1.10.2
Electron: 0.37.8
Chrome : 49.0.2623.75
Node : 5.10.0
> apm show racer
racer
├── 0.20.0
Mine was working for a few days, but suddenly it started failing with this error. Any hints to debug?
@aurabindo I fixed my installation using this method https://github.com/edubkendo/atom-racer/issues/61#issuecomment-272695463
I've tried @bunnybooboo's suggestion but am still getting non-zero exit code: 1 null
. My paths in atom are set to
/home/MYUSER/.cargo/bin/racer
and
/home/MYUSER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src
They don't contain any trailing whitespace, RUST_SRC_PATH
is set almost the same as in Atom but with an additional /rust/src
at the end (i.e.
/home/MYUSER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src
).
This all works beautifully from the command-line:
$ RUST_SRC_PATH=/home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src /home/$USER/.cargo/bin/racer complete std::io::B | wc -l
4
And completion does work to an extent in Atom as well (though only for entities in my source code and language keywords, use std
in contrast does not offer anything) but not without a lot of the non-zero exit code
messages.
This is on Debian Jessie, Atom 1.13.1, atom-racer 0.20.0.
I'm having this issue above. The real problem here is that it's not obvious at all what's causing the error. If the stdout/stderr output of the command was shown along with the exit code, we all might be able to figure this out for ourselves. :)
@NfNitLoop I remember that I found an earlier version of this issue where someone provided a PR to add the error message and that's what you are seeing coming through as "1 null".
In the end I installed VS Code, added the vscode-rust extension (a very active fork of the now unmaintained RustyCode, brilliantly maintained & developed by @KalitaAlexey) plus TOML Language Support and Native Debug (haven't used that one yet, actually).
I am really impressed with it all.
This is still happening for myself on Windows, my settings are the following:
C:\Users\snmalton.cargo\bin\racer.exe C:\Users\snmalton.rustup\toolchains\stable-x86_64-pc-windows-msvc
Reporting in as ticket is not closed, the plugin works 100%.
@Nokel81 Your second path is erroneous I'm afraid: It should read:
[your custom path]\toolchains\stable-x86_64-pc-windows-msvc/lib/rustlib/src/rust/src/
(Adapt the path to your case, I'm on linux and have a completely different path)
After that, restart Atom (important), and it should work without issue.
For me, it seems that the relevant difference was the slash at the end of the path:
-
Not working / getting error messages: /home/mine/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src
-
Working / no error messages with slash at the end of path: /home/mine/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/
This is rediculous. I am working on arch linux. Have set RUST_SRC_PATH (tried both with / and without) Tried start from terminal There is no src directory under /home/zj/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust There is Cargo.lock and a directory names library. SO I git clone https://github.com/rust-lang/rust.git and point the path to ~/rust/src (tried both with and without slash) None of these work!! Almost drive me CRAZY
This is rediculous. I am working on arch linux. Have set RUST_SRC_PATH (tried both with / and without) Tried start from terminal There is no src directory under /home/zj/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust There is Cargo.lock and a directory names library. SO I git clone https://github.com/rust-lang/rust.git and point the path to ~/rust/src (tried both with and without slash) None of these work!! Almost drive me CRAZY
Solved this problem. Just change the RUST_SRC_PATH=/home/$USER/rust/library(not src)
Reporting in as ticket is not closed, the plugin works 100%.
@Nokel81 Your second path is erroneous I'm afraid: It should read:
[your custom path]\toolchains\stable-x86_64-pc-windows-msvc/lib/rustlib/src/rust/src/
(Adapt the path to your case, I'm on linux and have a completely different path) After that, restart Atom (important), and it should work without issue.
I was just experiencing this issue on Atom for Windows and found the solution was in fact to use the path [*]\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\
That is, using library at the end, not src. Also, restarting Atom is necessary for the message to go away, as you noted.
This is implied on the racer-rust github repo, they wrote in their README, "Fetch the Rust sourcecode automatically via rustup and run rustup component add rust-src in order to install the source to $(rustc --print sysroot)/lib/rustlib/src/rust/library (or $(rustc --print sysroot)/lib/rustlib/src/rust/src in older toolchains"
So it appears in newer versions you need library, not src.