-
Notifications
You must be signed in to change notification settings - Fork 105
syntax checking fails (silently) when cargo is not in default path #126
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
Comments
@conundrumer interesting, we don't hardcode the path, so looks like the script isn't picking up the system path |
Seems we do set the path but only on OSX https://github.com/rust-lang/sublime-rust/blob/master/Cargo.sublime-build#L8 |
@conundrumer what OS are you running this on? |
@Jayflux this is on OSX. I will also note that the path to |
I will run a couple of tests on my macbook and windows 10 later on, and see what the problem is. |
I have the same problem with Manjaro (ArchLinux based). "/home/jcag/.cargo/bin" is Cargo installation path, but when I try to build a rust file Sublime Text doesn't get the right value of the shell path and I get the message : |
@wbond is it possible to get the user's env variables into the context of a sublime plugin? |
This only occurs on OS X because all applications are launched from the dock, which does not execute your shell, and thus does not have the same environment. There is an enhancement that will be part of the next dev build that executes the user's default shell as a login shell and fetches their environment variables to get around this limitation of OS X. |
@wbond "[Errno 2] No such file or directory: 'cargo' But my shell path is : ".../usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/lib32/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/lib/go/bin:/home/jcag/.cargo/bin" and "/home/jcag/.cargo/bin" is my Cargo installation path. |
@jcagpir That means that your env for your DE isn't set properly. It isn't really up to Sublime Text to manage that for you. In fact, it seems you've gotten your env set properly for Go, Java and Perl. You just need to configure Rust also. We are adding the work-around for OS X since there isn't really a reasonable way to set the environment of the Dock process. There were some changes that worked on some versions of OS X, but it didn't work in many situations. |
@wbond Thanks for your answer. |
@conundrumer @jcagpir is this still a problem on the latest release? |
@conundrumer @jcagpir did the fix in #97 not address your issue? |
ok looks like the issue is still there.... I might give it a go as an experiment http://stackoverflow.com/questions/2231227/python-subprocess-popen-with-a-modified-environment |
Provided a fix here: #166 |
SyntaxCheckPlugin was not able to find cargo, but doesn't report not being able to find it, because the actual error message is
/bin/sh: cargo: command not found
, whereas the error checker looks for "error".I installed Rust through rustup, so cargo is in
$HOME/.cargo/bin
. But the path of SyntaxCheckPlugin is the default:/usr/bin:/bin:/usr/sbin:/sbin
. #92 did not address this plugin.The text was updated successfully, but these errors were encountered: