Conversation
|
Waiting for #21434 getting merged until I fix the merge conflicts 👍 |
|
This can now be rebased, as #21434 is merged :) |
|
The Rust guide is now rebased and (at least if I am not mistaken) ready for review with the modernized instructions 🫡 |
crasbe
left a comment
There was a problem hiding this comment.
Disclaimer: I know next to nothing about Rust (well, not the programming language that is. I have some experience with metalworking :) ).
| ------------ | ||
|
|
||
| The easy part of the story is that Rust code gets compiled into a static library | ||
| which is then linked together with the rest of the RIOT code; |
There was a problem hiding this comment.
I probably wouldn't use the semicolon here, also relevant for other sections.
There was a problem hiding this comment.
just fyi, rust_in_riot is not my text, its a direct port of the doxygen text
| and tested for in applications using the Makefile line | ||
| `FEATURES_REQUIRED += rust_target`. |
There was a problem hiding this comment.
As per @chrysn s review comment, this is not required anymore.
|
I applied the deprecation warning as per #21568 (comment) and updated the guide that was here to the latest version, this is now 1:1 the guide that is currently on doxygen. |
doc/doxygen/src/using-rust.md
Outdated
| [inline_cast]: https://github.com/RIOT-OS/rust-riot-wrappers/blob/db9d163e3eddcb7154edcf25db7207e4123964ee/src/lib.rs#L68 | ||
| [C2Rust's support for atomics has improved]: https://github.com/immunant/c2rust/issues/436 | ||
| [atomics workarounds]: https://github.com/RIOT-OS/rust-riot-sys/blob/525b2384a3541d4879a5f3845ee6241243c29a78/riot-c2rust.h#L79 | ||
| @deprecated Guides have moved to the [Guide Site](https://guide.riot-os.org/). This page will be removed in the future. |
There was a problem hiding this comment.
Should this also get a definitive date?
Also: long line.
| and tested for in applications using the Makefile line | ||
| `FEATURES_REQUIRED += rust_target`. |
|
Sorry for vanishing for a few weeks, I'm currently approaching my exams 😅 This should cover what you said in the reviews, I also did some minor spelling/formatting fixes for the rust_in_riot guide as you asked for. |
crasbe
left a comment
There was a problem hiding this comment.
I'll still have to look at the generated documentation in Starlight.
doc/doxygen/src/using-rust.md
Outdated
| [inline_cast]: https://github.com/RIOT-OS/rust-riot-wrappers/blob/db9d163e3eddcb7154edcf25db7207e4123964ee/src/lib.rs#L68 | ||
| [C2Rust's support for atomics has improved]: https://github.com/immunant/c2rust/issues/436 | ||
| [atomics workarounds]: https://github.com/RIOT-OS/rust-riot-sys/blob/525b2384a3541d4879a5f3845ee6241243c29a78/riot-c2rust.h#L79 | ||
| @deprecated Guides have moved to the [Guide Site](https://guide.riot-os.org/). This page will be removed after release 2025.11. |
There was a problem hiding this comment.
Should this file have an .mdx extension instead of .md?
There was a problem hiding this comment.
Nah, the tip section is """standard""" markdown syntax. MDX would only be interesting if we imported things or did JSX-related tomfoolery.
|
Is anything still blocking? |
crasbe
left a comment
There was a problem hiding this comment.
Apparently I started a review and did not publish it 👀
| (The latter is needed even after most `extern crate` was abolished in 2018, | ||
| because crates depended on but not used otherwise are usually not linked in). | ||
|
|
||
| ## Toolchain {#toolchain} |
There was a problem hiding this comment.
Fixed sorry for not noticing 😅
|
|
||
| <!-- The locked works around <https://github.com/dtolnay/proc-macro2/issues/475> as closed in <https://github.com/immunant/c2rust/pull/1197>, there is no newer release that could be tested. --> | ||
|
|
||
| ```shell |
There was a problem hiding this comment.
The "Create Project" page mostly uses the syntax highlighting, maybe you can make that consistent.
There was a problem hiding this comment.
Everything now uses syntax highlighting
| The PR is tested against current master in its CI (albeit not for the full set of boards). | ||
| To test whether it also works for the changed API, | ||
| a commit titled "REMOVEME Test with updated riot-wrappes" can be added to the original PR, | ||
| it alters `.cargo/config.toml` to point to the changed branch, | ||
| and removes any Cargo.lock files in the RIOT tree. | ||
|
|
||
| That PR is then merged. |
There was a problem hiding this comment.
There was a html comment within the list which the markdown parser did not like at all
|
As with the #21573 feel free to reach out if anything is missing and I will try to rebase (hah, you didnt expect me to change the pun 😛) it into my schedule |
crasbe
left a comment
There was a problem hiding this comment.
Looks good, please squash.
fix: update rust in riot to modern port, deprecate old guide fix: update deprecation notice to specify removal date
No matter the hour, crasbe is here with approval power 📖 ✍️ |
|
Good luck with your exams :) |



Contribution description
This PR introduces a basic Rust tutorial for RIOT. The idea is to give a very brief and simple overview into the great support RIOT has while still having a focus on the more advanced C tutorials.
Testing procedure
Currently Rust support is not integrated within the tutorial code check. However, this is based on the existing rust example and quite basic for the most part. I am still unsure how to proceed with a long term testing solution for this.
Issues/PRs references
This depends on #21434 which depends on #21436 which depends on #21404