"Build" calls rustc rather than cargo
See original GitHub issueSublime Text Version
Sublime Text 3 (Build 3126)
Rust Enhanced Version
1.1.1
Operating system
OS Name macOS Version 10.12.3
Description
Pressing Cmd+Shift+P and selecting “Build With: RustEnhanced” calls rustc
, rather than cargo
.
I’m getting the following output in the bottom pane:
error[E0463]: can't find crate for `rustc_serialize`
--> /net/sujin/home/ubuntu/src/rust-playground/src/ohai.rs:1:1
|
1 | extern crate rustc_serialize;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
error: aborting due to previous error
[Finished in 0.4s with exit code 101]
[shell_cmd: rustc /net/sujin/home/ubuntu/src/rust-playground/src/ohai.rs]
[dir: /net/sujin/home/ubuntu/src/rust-playground/src]
[path: /Users/primary/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/primary/bin]
Note that the shell_cmd
says rustc
. As a result of using rustc
, it fails to find the external crates we are using.
I believe it should call cargo
instead. The cargo
binary is in the search path at /Users/primary/.cargo/bin/cargo
, so I’m not sure why it’s not working.
If I select Tools -> Build System -> RustEnhanced, and then Tools -> Build, the same thing happens.
If I select Tools -> Build System -> Rust, and then Tools -> Build, the same thing happens.
If I select Tools -> Build System -> Automatic, and then Tools -> Build, it does call cargo
, but it doesn’t show build errors in the source code, so I’m having to hunt for line numbers. (I’m not sure if that’s calling the built-in Rust or the RustEnhanced plugin.)
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (3 by maintainers)
Yes, I have two Cargo entries in Tools -> Build System. They both seem to work fine.
Now when I select “Automatic” as the Build System it works as well. I’m not sure if it worked originally or if something changed in the meantime.
In any case, I think there might be a few usability issues at the root of this:
I wonder if “rustc without Cargo” is really at all a popular mode of compiling Rust code. It seems to me that almost everyone would be using Cargo these days. So perhaps we should be steering people towards the Cargo build option as a default.
Thanks!