Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

racer returned a non-zero exit code: 1 null #57

Open
amosjyng opened this issue Sep 16, 2015 · 19 comments
Open

racer returned a non-zero exit code: 1 null #57

amosjyng opened this issue Sep 16, 2015 · 19 comments

Comments

@amosjyng
Copy link

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?

@dwtj
Copy link

dwtj commented Sep 19, 2015

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.

@edubkendo
Copy link
Owner

I'd happily take a PR that fixed this to support both sets of paths :)

@charleskorn
Copy link

Also seeing this problem... is there a way I can see the output from racer to try to work out what's going on?

@CNLambda
Copy link

CNLambda commented Jun 7, 2016

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...)

@isomorpheme
Copy link

Had the same issue on Windows, but setting the RUST_SRC_PATH environment variable manually seems to have fixed it.

@chriskrycho
Copy link

I can confirm that manually setting RUST_SRC_PATH fixed the same issue on OS X as well.

@fanyer
Copy link

fanyer commented Aug 24, 2016

same problem, also fixed by setting RUST_SRC_PATH, which is linked to the rust repo cloned from github

@White-Oak
Copy link

White-Oak commented Oct 11, 2016

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

@aurabindo
Copy link

Mine was working for a few days, but suddenly it started failing with this error. Any hints to debug?

@bunnybooboo
Copy link

@aurabindo I fixed my installation using this method #61 (comment)

@thomanski
Copy link

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.

@NfNitLoop
Copy link

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. :)

@thomanski
Copy link

@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.

@Nokel81
Copy link

Nokel81 commented May 19, 2017

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

@Emka877
Copy link

Emka877 commented Oct 1, 2018

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.

@troglodyt
Copy link

troglodyt commented May 20, 2019

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/

@jasex
Copy link

jasex commented Dec 16, 2020

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

@jasex
Copy link

jasex commented Dec 17, 2020

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)

@vmhazoglou
Copy link

vmhazoglou commented Aug 23, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests