From 709b67f1ce29cfe6ca230d2989844ff8a0e34861 Mon Sep 17 00:00:00 2001 From: Andre Richter Date: Wed, 9 Dec 2020 21:36:54 +0100 Subject: [PATCH] Introduce rust-toolchain Make use of the new format, introduced in https://blog.rust-lang.org/2020/11/27/Rustup-1.23.0.html#new-format-for-rust-toolchain --- README.CN.md | 15 ++++----------- README.md | 18 ++++++------------ rust-toolchain | 4 ++++ 3 files changed, 14 insertions(+), 23 deletions(-) create mode 100644 rust-toolchain diff --git a/README.CN.md b/README.CN.md index ed767da6..9d82c8ad 100644 --- a/README.CN.md +++ b/README.CN.md @@ -52,26 +52,19 @@ _带上我最诚挚的问候,
Andre ([@andre-richter])_ 3. 安装正确的`Rust`工具链: 1. 如果你已经安装了一个版本的Rust: ```bash - rustup toolchain add nightly-2020-11-20 - rustup default nightly-2020-11-20 - rustup component add llvm-tools-preview - rustup target add aarch64-unknown-none-softfloat cargo install cargo-binutils rustfilt ``` - 2. 如果你想要全新安装: + 1. 如果你想要全新安装: ```bash - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ - --default-toolchain nightly-2020-11-20 \ - --component llvm-tools-preview + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source $HOME/.cargo/env - rustup target add aarch64-unknown-none-softfloat cargo install cargo-binutils rustfilt ``` -4. 如果你使用 `Visual Studio Code`,我强烈推荐你安装[Rust Analyzer 扩展]。 -5. 如果你使用的**不是**Linux,那么你还需要安装一些`Ruby` gems。 +1. 如果你使用 `Visual Studio Code`,我强烈推荐你安装[Rust Analyzer 扩展]。 +1. 如果你使用的**不是**Linux,那么你还需要安装一些`Ruby` gems。 ```bash sudo gem install bundler diff --git a/README.md b/README.md index 5af62a96..845aa87d 100644 --- a/README.md +++ b/README.md @@ -65,29 +65,23 @@ other Unix flavors such as **macOS**, but this is only _experimental_. 1. [Install Docker][install_docker]. 1. Ensure your user account is in the [docker group]. -1. Install a suitable `Rust` toolchain: +1. Prepare the `Rust` toolchain. Most of it will be handled on first use through the + [rust-toolchain](rust-toolchain) file. What's left for us to do is: 1. If you already have a version of Rust installed: ```bash - rustup toolchain add nightly-2020-11-20 - rustup default nightly-2020-11-20 - rustup component add llvm-tools-preview - rustup target add aarch64-unknown-none-softfloat cargo install cargo-binutils rustfilt ``` - 2. If you need a fresh install: + 1. If you need to install Rust from scratch: ```bash - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ - --default-toolchain nightly-2020-11-20 \ - --component llvm-tools-preview + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source $HOME/.cargo/env - rustup target add aarch64-unknown-none-softfloat cargo install cargo-binutils rustfilt ``` -3. In case you use `Visual Studio Code`, I strongly recommend installing the [Rust Analyzer extension]. -4. If you are **NOT** running Linux, some `Ruby` gems are needed as well: +1. In case you use `Visual Studio Code`, I strongly recommend installing the [Rust Analyzer extension]. +1. If you are **NOT** running Linux, some `Ruby` gems are needed as well: ```bash sudo gem install bundler diff --git a/rust-toolchain b/rust-toolchain new file mode 100644 index 00000000..9c4710ce --- /dev/null +++ b/rust-toolchain @@ -0,0 +1,4 @@ +[toolchain] +channel = "nightly-2020-12-08" +components = ["llvm-tools-preview"] +targets = ["aarch64-unknown-none-softfloat"]