Skip to content

Commit ae9a8dc

Browse files
bors[bot]chrysn
andauthored
Merge #19058
19058: rust: Use stable Rust [backport 2022.10] r=miri64 a=maribu # Backport of #18839 ### Contribution description Since Rust 1.65, we don't depend on anything nightly any more. This changes the examples and documentation to use stable. ### Testing procedure * Green CI with tests enabled * Look at changed documentation ([rendered](https://ci.riot-os.org/results/2923b30a4ba04dbface1ed38fb6aae12/doc-preview/using-rust.html#toolchain)) <del>Note that these will *not* pass yet: This needs a CI update (no PR associated: Any CI image built from now on will do).</del> ### Issues/PRs references A follow-up will simplify things a bit further, but that will depend on CI to have made stable the default, which is a later step in what is a bit of a lock-step game: * [x] CI rebuilds riotdocker -- no PR, then stable=1.65 * [ ] Use stable in examples -- this PR, then examples use stable * [ ] CI removes nightly and makes stable the default -- RIOT-OS/riotdocker#214, then default=stable * [ ] Use the new default to simplify makefiles -- #18840 Co-authored-by: chrysn <chrysn@fsfe.org>
2 parents 7ebbdc7 + ece93b8 commit ae9a8dc

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

doc/doxygen/src/using-rust.md

+6-11
Original file line numberDiff line numberDiff line change
@@ -106,26 +106,21 @@ Toolchain {#toolchain}
106106

107107
To install the necessary Rust components, it is easiest use [**rustup**, installed as described on its website].
108108

109-
Using Rust on RIOT needs the latest stable or nightly version of Rust,
110-
depending on the precise example used.
111-
(Currently, it's mainly the CoAP parts that use nightly features, and some native builds;
112-
until stable is universally available, only tests are run on stable by default).
109+
Using Rust on RIOT needs the latest stable version of Rust.
113110

114-
Make sure you have both the nightly and stable **toolchains**
111+
Make sure you have the stable **toolchain**
115112
and the core library for the CPU (**target**) of your choice available:
116113

117114
```
118-
$ rustup toolchain add nightly
119115
$ rustup toolchain add stable
120-
$ rustup target add thumbv7m-none-eabi --toolchain nightly
121116
$ rustup target add thumbv7m-none-eabi --toolchain stable
122117
```
123118

124119
Substitute thumbv7m-none-eabi with the value of `RUST_TARGET`
125-
in the output of `make info-build` of an application that has your current board selected,
126-
or just add it later whenever the Rust compiler complains about not finding the core library for a given target).
127-
Installing only nightly will work just as well,
128-
but you may need to remove the `CARGO_CHANNEL = stable` line to run tests.
120+
in the output of `make info-build` of an application that has your current board selected
121+
(or just add it later whenever the Rust compiler complains about not finding the core library for a given target).
122+
Using a beta or nightly will work just as well,
123+
but you may need to set `CARGO_CHANNEL=nightly` on your shell or in your Makefiles.
129124

130125

131126
While Rust comes with its own [cargo] dependency tracker for any Rust code,

examples/rust-gcoap/Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ BASELIBS += $(APPLICATION_RUST_MODULE).module
4141

4242
FEATURES_REQUIRED += rust_target
4343

44-
# This example requires a nightly version because of the CoAP dependencies
45-
CARGO_CHANNEL ?= ${CARGO_CHANNEL_NIGHTLY}
44+
CARGO_CHANNEL ?= stable
4645

4746
# Currently unknown, something related to the LED_PORT definition that doesn't
4847
# pass C2Rust's transpilation

examples/rust-hello-world/Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ BASELIBS += $(APPLICATION_RUST_MODULE).module
2121

2222
FEATURES_REQUIRED += rust_target
2323

24-
# While this example can be built with stable Rust on many platforms, the
25-
# nightly channel is selected to smoothly transition from running this example
26-
# to experimenting with it (which might easily lead into nightly territory).
27-
CARGO_CHANNEL ?= $(CARGO_CHANNEL_NIGHTLY)
24+
# All Rust components RIOT uses work on stable Rust. If any extra libraries
25+
# were to require a more recent version, switch to `CARGO_CHANNEL =
26+
# $(CARGO_CHANNEL_NIGHTLY)` to use whichever nightly version is available.
27+
CARGO_CHANNEL ?= stable
2828

2929
# Currently unknown, something related to the LED_PORT definition that doesn't
3030
# pass C2Rust's transpilation

0 commit comments

Comments
 (0)