Skip to content
This repository was archived by the owner on Apr 19, 2021. It is now read-only.

Commit dd8e48f

Browse files
authored
[docs] Update the Rust guide (a few infos were outdated) (#751)
1 parent e4f03b4 commit dd8e48f

File tree

1 file changed

+28
-54
lines changed

1 file changed

+28
-54
lines changed

src/docs/languages/rust.md

Lines changed: 28 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,18 @@ Rust is a first-class language in Gitpod, and we believe that Gitpod is a great
88
* The blazing-fast workspace search is powered by [ripgrep](https://github.com/BurntSushi/ripgrep)
99

1010
## Rust Version
11-
Both Rust `v1.39.0 stable` and `nightly` are pre-installed in Gitpod. Stable is the default, but you can switch to the nightly version of Rust by running `rustup default nightly` in a terminal.
1211

13-
Note: If you try to use `rustup` in your Dockerfile, you might get the following error:
12+
Gitpod always comes with the latest available Rust toolchain pre-installed using [rustup](https://rustup.rs/). (As of 11 Sep 2020, the Rust version is `1.46.0`, and it's updated [semi-automatically](https://github.com/gitpod-io/workspace-images/pull/282/files) on every official Rust release.)
13+
14+
You can also use `rustup` yourself in Gitpod in order to switch to a different Rust version, or to install extra components. See the [the rustup book](https://rust-lang.github.io/rustup/index.html) to learn more about `rustup` itself.
15+
16+
Note: If you try to use `rustup` in your repository's [.gitpod.Dockerfile](/docs/config-docker/), you might get the following error:
1417

1518
```
1619
/bin/sh: rustup command not found
1720
```
1821

19-
To fix this you'll need to wrap the `rustup` command in a login shell, like so:
22+
To fix this, simply wrap the `rustup` command in a login Bash shell, like so:
2023

2124
```Dockerfile
2225
RUN bash -cl "rustup toolchain install nightly"
@@ -38,83 +41,54 @@ Here are a few Rust example projects that are already automated with Gitpod:
3841
|---------|------------|-----|
3942
|[MathLang](https://github.com/JesterOrNot/mathlang) | Basic maths language in Rust | [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/JesterOrNot/MathLang) |
4043
|[NuShell](https://github.com/nushell/nushell/) | A next-gen shell for the GitHub era | [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/nushell/nushell) |
41-
|[Servo](https://github.com/servo/servo) | The Servo Browser Engine | [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/servo/servo)
44+
|[Servo](https://github.com/servo/servo) | The Servo Browser Engine | [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/servo/servo) |
4245

4346
</div>
4447

45-
## Workspace Configuration
48+
## VSCode Extensions
4649

47-
### VSCode Extensions
50+
The most popular Rust VSCode extensions are already pre-installed in Gitpod. But here are a few "nice to have" extensions you may choose to install as well.
4851

49-
The most popular Rust VSCode extensions come prebuilt in Gitpod but here are some "nice to have" extensions:
52+
In order to install one of these extensions for your repository, simply head to Gitpod's [Extensions panel](/docs/vscode-extensions/) (find it in the IDE's left vertical menu), then search for the desired extension by name, and install it for your project. This will add an entry to your [.gitpod.yml](/docs/config-gitpod-file/) file that ensures all future Gitpod workspaces for your repository will already have this extension pre-installed.
5053

51-
#### Rust Test Explorer
54+
### Rust Test Explorer
5255
![Rust test explorer example](../images/rustTest.png)
5356
<br>
5457
<br>
55-
The Rust Test Explorer makes it easy to run Rust tests. To install this extension to your repository, add the following to your [.gitpod.yml](https://www.gitpod.io/docs/41_config_gitpod_file/):
56-
```yaml
57-
vscode:
58-
extensions:
59-
- [email protected]:koqDUMWDPJzELp/hdS/lWw==
60-
- [email protected]:Xg+YeZZQiVpVUsIkH+uiiw==
61-
```
62-
#### Crates
58+
The Rust Test Explorer makes it easy to run Rust tests.
59+
60+
### Crates
6361
> ***Note: This extension outputs emojis by default if the crate version is set at the latest. You can disable this by using `crates.upToDateDecorator` option in your preferences***
6462
<br>
6563
6664
![A crates extension demo](../images/cratesDemo.gif)
67-
The VSCode extension Crates makes it easier to manage your Cargo dependency versions. To install this extension to your repository add the following to your [.gitpod.yml](https://www.gitpod.io/docs/41_config_gitpod_file/)
65+
The VSCode extension Crates makes it easier to manage your Cargo dependency versions.
6866

69-
```yaml
70-
vscode:
71-
extensions:
72-
- [email protected]:HMkoguLcXp9M3ud7ac3eIw==
73-
```
74-
#### <p>Search Crates.io</p>
67+
### <p>Search Crates.io</p>
7568
![An example of search crates.io extension](../images/searchCratesio.gif)
7669

77-
Do you have an idea of a library you want to use but don't know the version well just type in the name of the library and Search Crates.io will get the version. To install this extension to your repository add the following to your [.gitpod.yml](https://www.gitpod.io/docs/41_config_gitpod_file/)
78-
```yaml
79-
vscode:
80-
extensions:
81-
- [email protected]:kSLnyrOhXtYPjQpKnMr4eQ==
82-
```
70+
Do you have an idea of a library you want to use but don't know the version well just type in the name of the library and Search Crates.io will get the version.
8371

84-
#### Better TOML
72+
### Better TOML
8573
![TOML Syntax highlighting example](../images/feature_syntax_highlight.png)
8674

87-
Better TOML adds syntax highlighting to your `Cargo.toml`. To install Better TOML to your repository, add the following to your [.gitpod.yml](https://www.gitpod.io/docs/config-gitpod-file/) file:
75+
Better TOML adds syntax highlighting to your `Cargo.toml`.
8876

89-
```yaml
90-
vscode:
91-
extensions:
92-
- [email protected]:3QfgGxxYtGHfJKQU7H0nEw==
93-
```
77+
## Cross-compiling with MUSL
78+
79+
TODO. See also [MUSL support for fully static binaries](https://doc.rust-lang.org/edition-guide/rust-2018/platform-and-target-support/musl-support-for-fully-static-binaries.html).
9480

9581
## Debugging
9682

9783
In this section we will show you how to configure your project for debugging in Gitpod.
9884

99-
First, before we get to that we need to get some prerequisites set-up first we'll add the needed extension
100-
101-
If you haven't added extensions to your repository already add the following snippet to your [.gitpod.yml](https://www.gitpod.io/docs/config-gitpod-file/) file:
85+
First, before we get to that we need to get some prerequisites set-up.
10286

103-
```yaml
104-
vscode:
105-
extensions:
106-
- [email protected]:1zVcRsAhewYEX3/A9xjMNw==
107-
```
108-
109-
If you already added a extension just add the following below your other extensions.
110-
111-
```yaml
112-
- [email protected]:1zVcRsAhewYEX3/A9xjMNw==
113-
```
87+
First we'll install the needed extension. If you haven't already, head over to Gitpod's [Extensions panel](/docs/vscode-extensions/) (left vertical menu in the IDE) and search for an extension called `Native Debug` by webfreak. When you see it, click to install it for your project.
11488

115-
The last prerequisite is a docker configuration.
89+
The next prerequisite is a Docker configuration.
11690

117-
If you already have a [.gitpod.Dockerfile](https://www.gitpod.io/docs/config-docker/) just add the following:
91+
If you already have a [.gitpod.Dockerfile](/docs/config-docker/) just add the following:
11892

11993
```Dockerfile
12094
RUN sudo apt-get -q update \
@@ -126,7 +100,7 @@ RUN sudo apt-get -q update \
126100
ENV RUST_LLDB=/usr/bin/lldb-8
127101
```
128102

129-
If not there are two steps first create a file called `.gitpod.Dockerfile` with the following content:
103+
If not there are two steps. First, create a file called `.gitpod.Dockerfile` with the following content:
130104

131105
```Dockerfile
132106
FROM gitpod/workspace-full
@@ -142,7 +116,7 @@ RUN sudo apt-get -q update \
142116
ENV RUST_LLDB=/usr/bin/lldb-8
143117
```
144118

145-
Next add the following to your [.gitpod.yml](https://www.gitpod.io/docs/config-gitpod-file/) file:
119+
Next, add the following to your [.gitpod.yml](/docs/config-gitpod-file/) file:
146120

147121
```yaml
148122
image:

0 commit comments

Comments
 (0)