-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Cargo does not handle +toolchain
directives.
#14363
Comments
This is expected, and as I said, you need to run
|
|
It looks like |
Yes. You have to install the rust toolchain correctly via rustup or some other installation method listed here: https://rust-lang.github.io/rustup/installation/index.html. Standalone installation method can be found here: https://forge.rust-lang.org/infra/other-installation-methods.html. The toolchain installation is out of scope of Cargo and I have limited time to support such kind of tickets. https://users.rust-lang.org/ is one place for user support. Close since this is not a bug in Cargo. Thank you. |
Problem
The documentation https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#script says:
script
Tracking Issue: #12207
Cargo can directly run
.rs
files as:where file.rs can be as simple as:
Steps
I just fetched the
rust-nightly-x86_64-unknown-linux-gnu.tar.xz
archive, extracted thecargo
folder to the same directory where I haverustc
andrust-std-x86_64-unknown-linux-gnu
folders extracted from the same archive.I have this for testing
script.rs
This is result
Possible Solution(s)
No idea. This is only my second time trying to use Rust.
Notes
It's basically impossible to download the entire Rust toolchain on a temporary file system running a live Linux session.
So I fetched the Nightly archive, immediately got rid of the 600+ MB documentation folder, and everything else except
rustc
andrust-std-x86_64-unknown-linux-gnu
folders.I'll re-fetch the nightly archive and extract
cargo
folder.Eventually I got this to run, using
-L
to I guess link torustlib/x86_64-unknown-linux-gnu/lib
What I'm really working on doing is using Rust
.rs
file as a Native Messaging host script.I converted a working C version to Rust using https://c2rust.com/.
Now I have to figure out how to link to
libc
in the resulting file https://gist.github.com/rust-play/92af6fefec0ea8bcc76a5b18be40005eJust to see what would happen if I was trying to compile the C to Rust code
This is my second time trying to use Rust to build something. My first time using Rust as a script. Thanks.
Version
The text was updated successfully, but these errors were encountered: