深度系统rust开发环境搭建

栏目: 编程语言 · Rust · 发布时间: 6年前

内容简介:由于买了台 NUC 机子,开发环境由 MacOS 变成了 Deepin 也就是深度系统,重新折腾了 Rust 开发 环境。开发环境为 Deepin + vscode + lldb。linux 下 rust 安装非常简单,使用以下命令并遵循指导就好了

由于买了台 NUC 机子,开发环境由 MacOS 变成了 Deepin 也就是深度系统,重新折腾了 Rust 开发 环境。

开发环境为 Deepin + vscode + lldb。

安装 rust

linux 下 rust 安装非常简单,使用以下命令并遵循指导就好了

curl https://sh.rustup.rs -sSf | sh

建议使用 stable toolchain, 因为 vscode 使用的 rust 插件 rls server 不支持 nightly toolchain

由于国内使用 cargo 工具会被墙,所以这里需要改用中科大的源

mkdir ~/.cargo

# vim ~/.cargo/config
[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
replace-with = 'ustc'

[source.ustc]
registry = "git://mirrors.ustc.edu.cn/crates.io-index"

安装 vscode

深度系统的应用商店就有 vscode,进去搜索然后下载安装即可。安装完成后,点击 vscode 的插件市场,找到 Rust(rls) 插件安装即可

安装 LLDB

我使用 LLDB 作为 debugger, 他的安装也非常简单

sudo apt install lldb

接着为 vscode 安装 lldb 插件,在插件市场搜索 CodeLLDB ,确认并安装。

此时开发环境基本上就搭建好了。 如果想更新 rust

rustup update

增加 toolchain

rustup toolchain install nightly

将默认 toolchain 更换为 nightly

rustup default nightly

反之亦然


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Beautiful Code

Beautiful Code

Greg Wilson、Andy Oram / O'Reilly Media / 2007-7-6 / GBP 35.99

In this unique work, leading computer scientists discuss how they found unusual, carefully designed solutions to difficult problems. This book lets the reader look over the shoulder of major coding an......一起来看看 《Beautiful Code》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具