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

Build using Cargo #22

Closed
dutt opened this issue Oct 27, 2014 · 7 comments
Closed

Build using Cargo #22

dutt opened this issue Oct 27, 2014 · 7 comments

Comments

@dutt
Copy link

dutt commented Oct 27, 2014

I added a new issue for this seems it seems to be a different cause.

ST 3, Rust plugin, tried building using Cargo and I got this:

[Errno 2] No such file or directory: 'cargo'
[cmd: ['cargo', 'build']]
[dir: /Users/dutt/workspace/rust/gridwar/src/entities]
[path: /usr/bin:/bin:/usr/sbin:/sbin]
[Finished]

Which is understandable, since I get this:

dutt$ which cargo
/usr/local/bin/cargo

How do I edit the path used by the plugin?

@jhasse
Copy link

jhasse commented Dec 7, 2014

That's strange, the plugin should use the system path ... Don't know what's going wrong there.

@sirpalee
Copy link

sirpalee commented Dec 7, 2014

I got the exact same issue a few minutes ago (using the latest ST3), and fixed it by using shell_cmd rather than cmd and setting up the working dir to be the project's path. This is what I ended up with. (I don't have much experience in writing sublime plugins or build systems, so it might not be the best solution)

{
    "shell_cmd": "cargo build",
    "file_regex": "^(.*?):([0-9]+):([0-9]+):\\s[0-9]+:[0-9]+\\s(.*)$",
    "working_dir": "${project_path:${folder}}",

    "variants": [
        {
            "shell_cmd": "cargo run",
            "name": "Run"
        }
    ]
}

@hughes
Copy link

hughes commented Dec 17, 2014

The FixMacPath plugin fixed this for me instantly.

If you installed rust/cargo via brew/cask, then it lives in /usr/local/bin which is not on the $PATH set by launchctl. It's accessible from your shell because brew puts export PATH=/usr/local/sbin:$PATH in your .zshrc or .bashrc.

@rowlandrose
Copy link

Thanks @hughes ! I ran into the same problem on my Mac and that worked perfectly.

@pzol
Copy link

pzol commented Apr 27, 2016

Using rustup.rs I added

"env": {
    "PATH": "$HOME/.cargo/bin:$PATH"
},

@jasonwilliams
Copy link
Member

jasonwilliams commented Sep 30, 2016

Since moving to rustup this plugin has stopped working for me.
Can we add the Home path by default?

@pzol where did you add that?

@jasonwilliams
Copy link
Member

This has been fixed in #97

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

7 participants