rustup

VS code部署RUST运行环境

时光毁灭记忆、已成空白 提交于 2020-12-03 12:26:03
VS code部署RUST 开始之前 安装语言环境 搭建测试环境 结尾 开始之前 1、安装rust rust 安装地址 2、切换到 msvc toolchain by rustup default stable-x86_64-pc-windows-msvc 3、安装VSCODE VS Code 安装地址 安装语言环境 安装rls扩展 安装Native Debug扩展 扩展rust-analyzer 搭建测试环境 在工程目录下新建.vscode目录 在新建的 .vscode 文件夹里新建两个文件 tasks.json 和 launch.json,文件内容如下: tasks.json 文件 {     "version": "2.0.0",     "tasks": [         {             "label": "build",             "type": "shell",             "command":"cargo",             "args": ["build"]         }     ] } launch.json 文件(适用在 Windows 系统上) {     "version": "0.2.0",     "configurations": [         {             "name": "

[Rust] Setup Rust for WebAssembly

天涯浪子 提交于 2020-11-03 14:03:39
In order to setup a project we need to install the nightly build of Rust and add the WebAssembly target. For an improved workflow we also install the CLI tools wasm-pack and wasm-gc. Install: brew install rustup Run: rustup-init Setup nightly toolchain as default. rustup default nightly Then we add the target wasm32-unknown-unknown rustup target add wasm32-unknown-unknown In addition, we use cargo , Rust's package manager, to install wasm-pack cargo install wasm-pack This tool seeks to be the one-stop shop for building and working with Rust-generated WebAssembly that you would like to interop

How to remove Rust compiler toolchains with Rustup?

一曲冷凌霜 提交于 2020-07-18 03:28:27
问题 The Rustup documentation shows how to install Rust nightly, but not how to remove it. While the docs do show how to uninstall rustup entirely, I'd like to keep the stable branch. How can I uninstall Rust nightly? Note that I attempted to do the opposite of rustup install nightly ... ( rustup uninstall nightly , rustup remove nightly & rustup delete nightly ) to no avail. Even though I read the documentation it wasn't clear that nightly was a toolchain , a channel ... or something else. 回答1:

How to remove Rust compiler toolchains with Rustup?

会有一股神秘感。 提交于 2020-07-18 03:27:49
问题 The Rustup documentation shows how to install Rust nightly, but not how to remove it. While the docs do show how to uninstall rustup entirely, I'd like to keep the stable branch. How can I uninstall Rust nightly? Note that I attempted to do the opposite of rustup install nightly ... ( rustup uninstall nightly , rustup remove nightly & rustup delete nightly ) to no avail. Even though I read the documentation it wasn't clear that nightly was a toolchain , a channel ... or something else. 回答1:

How to switch between Rust toolchains?

我的未来我决定 提交于 2020-06-27 13:00:39
问题 rustup help toolchain lists the following sub-commands SUBCOMMANDS: list List installed toolchains install Install or update a given toolchain uninstall Uninstall a toolchain link Create a custom toolchain by symlinking to a directory help Prints this message or the help of the given subcommand(s) I have the following toolchains installed stable-x86_64-unknown-linux-gnu (default) nightly-2019-09-05-x86_64-unknown-linux-gnu nightly-x86_64-unknown-linux-gnu master I was trying to solve an issue

How to switch between Rust toolchains?

北城余情 提交于 2020-06-27 13:00:26
问题 rustup help toolchain lists the following sub-commands SUBCOMMANDS: list List installed toolchains install Install or update a given toolchain uninstall Uninstall a toolchain link Create a custom toolchain by symlinking to a directory help Prints this message or the help of the given subcommand(s) I have the following toolchains installed stable-x86_64-unknown-linux-gnu (default) nightly-2019-09-05-x86_64-unknown-linux-gnu nightly-x86_64-unknown-linux-gnu master I was trying to solve an issue

Win7 VSCode 离线安装Rust语言及环境配置

穿精又带淫゛_ 提交于 2020-05-04 06:45:35
前置依赖 装过Visual Studio或Visual Studio Build Tool 2015 下载Rust离线安装包 https://forge.rust-lang.org/other-installation-methods.html 写本文时使用的版本为1.37 https://static.rust-lang.org/dist/rust-1.37.0-x86_64-pc-windows-msvc.msi 安装时选Advanced 换下路径,如 E:\Rust stable MSVC 1.37\ 接下来把RLS选项勾上 装好后到Gayhub下载配置模板节省头发。 https://github.com/RoteErde/RustVSCodeTemplate 打开VSCode,菜单 File > Open Folder 打开下载的模板目录 然后VSCode扩展搜Gayhub中提到的3个扩展 Rust (rls) C/C++ Native Debug 装好后打开src/main.rs,修改为 fn main() { let mut a = 0 ; a = 3 ; a = 5 ; a = 10 ; println !( " Hello, world! " ); } 设置断点选项,菜单 File > Preferences > Setting中搜索break,勾选Allow

Win7 VSCode 在线安装Rust语言及环境配置

回眸只為那壹抹淺笑 提交于 2020-05-04 06:05:53
睡前彻底解决在VSCode中,按F12不跳转到标准库源码的问题。 首先,如果装过离线版,卸载掉。 然后去官网下载 rustup-init.exe https://www.rust-lang.org/tools/install 下好后别急着安装 新建4个环境变量 CARGO_HOME E:\Rust\cargo RUSTUP_HOME E:\Rust\rustup RUSTUP_DIST_SERVER https://mirrors.ustc.edu.cn/rust-static RUSTUP_UPDATE_ROOT https://mirrors.ustc.edu.cn/rust-static/rustup 前两个是你要自定义的cargo和rustup目录,后两个是切换rustup为国内源,不然只能挂代理。 搞定后双击rustup-init.exe,按1默认安装,也就是安装msvc版本。 慢长等待后,应该会显示安装成功。 接下来和之前一样,进入自定义的cargo目录,新建没有扩展名的config文件,内容同上一篇博客,也是切换为国内下载源。 [source.crates- io] registry = " https://github.com/rust-lang/crates.io-index " replace -with = ' ustc ' [source.ustc]

Win10—rust语言安装与环境变量配置(+VSCode)

橙三吉。 提交于 2020-05-04 02:08:41
(只记录了必须要内容,日后完善!) 1. rust的安装与环境变量: 要提前把下面两个环境变量配置好,这样是为了指定安装路径。否则会默认安装在 C 盘下。 CARGO_HOME:D:\Program Files\RUST\.cargo RUSTUP_HOME:D:\Program Files\RUST\.rustup 然后,在这个: https://www.rust-lang.org/zh-CN/learn/get-started 界面上下载 rustup-init.exe。下载完成后直接点击执行,会出现一个CMD窗口:仔细阅读上面的内容,如果没有安装Microsoft 2019 builder tools,就打开屏幕上的网址进行下载安装。可以从所给网址直接下载 Microsoft Visual Stdio 2019,或者在这个下在页面下拉,找到下图所示内容,只下载下图中红框标注的内容即可: 然后,在下面输入2,进行自定义安装: 按自己的要求设置好之后就开始安装吧! 执行下面的命令看是否安装成功: rustc --version cargo --version    执行如下命令安装工具链:可以选择其它版本(如nightly-i686-pc-windows-msvc) rustup toolchain install nightly-x86_64-pc-windows-gnu   

Alibaba Cloud Linux 2 中编译 Lotus

微笑、不失礼 提交于 2020-04-20 15:39:09
Filecoin 是一个开源的区块链项目, Lotus 是 Filecoin 的其中一个重要客户端。对于想尝鲜区块链这一热门技术的朋友来说,通常会选择 ArchLinux、Ubuntu 等相对易于折腾的发行版来使用。Alibaba Cloud Linux 2 (aka Aliyun Linux 2) 是基于 CentOS 7 的 RPM 生态构建的发行版系统,面对 Lotus 这样的先进生产力,能否老树发新芽呢?让我们开始折腾吧。 1. 购买一台 ECS 服务器。 在实例 购买页面 ,我们买了一台 Aliyun Linux 2.1903 LTS 版本的服务器。由于构建过程中需要频繁访问 GitHub 上的资源,我们选择了香港可用区以加快资源拉取速度。 2. 访问 Lotus 文档页面 Lotus 文档 页给出了常见的几个发行版的构建方式,离我们最近的就是 Fedora 了。然而直接执行 Fedora 页面上的步骤,并不能正确解决构建依赖。我们需要想想别的办法。 Fedora 文档页面上的依赖如下: These steps will install the following dependencies: go (1.13 or higher) gcc (7.4.0 or higher) git (version 2 or higher) bzr (some go dependency