[RFC PATCH 1/3] docs: rust: quick-start: Add another way to install

Tiezhu Yang posted 3 patches 4 weeks, 1 day ago
There is a newer version of this series
[RFC PATCH 1/3] docs: rust: quick-start: Add another way to install
Posted by Tiezhu Yang 4 weeks, 1 day ago
When compiling with LLVM and CONFIG_RUST is set, there is build error on
LoongArch:

     --> rust/kernel/lib.rs:331:13
      |
  331 |         loc.file_with_nul()
      |             ^^^^^^^^^^^^^ method not found in `&'a Location<'a>`

  error: aborting due to 1 previous error

It seems that the latest version of rustc is not compatible, in order to
install the workable rustc version for LoongArch, there is another simple
and easy way, add it to the Quick Start guide.

Suggested-by: WANG Rui <wangrui@loongson.cn>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 Documentation/rust/quick-start.rst | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/Documentation/rust/quick-start.rst b/Documentation/rust/quick-start.rst
index 155f7107329a..fdd9f54f4fe4 100644
--- a/Documentation/rust/quick-start.rst
+++ b/Documentation/rust/quick-start.rst
@@ -21,6 +21,20 @@ Alternatively, the next two "Requirements" sections explain each component and
 how to install them through ``rustup``, the standalone installers from Rust
 and/or building them.
 
+Additionally, if you want to install a specified version, you can remove the
+exist packages from your Linux distribution first, e.g. for Fedora Linux::
+
+	dnf remove rust
+
+and run the following in your terminal::
+
+	curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
+
+then follow the onscreen instructions to install from the official release
+channels, enabling you to easily switch between stable, beta, and nightly
+compilers and keep them updated. Please see https://rustup.rs/ for more
+information.
+
 The rest of the document explains other aspects on how to get started.
 
 
-- 
2.42.0
Re: [RFC PATCH 1/3] docs: rust: quick-start: Add another way to install
Posted by Miguel Ojeda 4 weeks, 1 day ago
On Wed, Sep 3, 2025 at 11:53 AM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
>
> It seems that the latest version of rustc is not compatible, in order to

This is only in nightly Rust -- we have a couple commits in -next that
make Rust >= 1.91 work. Could you please try those? i.e. starting at
8851e27d2cb9 ("rust: support Rust >= 1.91.0 target spec"). They should
land in e.g. -rc5.

Regarding `rustup`: we could link to the install instructions, but I
don't think it is a good idea to replicate a particular `curl` line
that could change upstream (e.g. the domain changing hands),
especially one that installs something on the fly.

Thanks!

Cheers,
Miguel
Re: [RFC PATCH 1/3] docs: rust: quick-start: Add another way to install
Posted by Tiezhu Yang 4 weeks, 1 day ago
On 2025/9/3 下午6:11, Miguel Ojeda wrote:
> On Wed, Sep 3, 2025 at 11:53 AM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
>>
>> It seems that the latest version of rustc is not compatible, in order to
> 
> This is only in nightly Rust -- we have a couple commits in -next that
> make Rust >= 1.91 work. Could you please try those? i.e. starting at
> 8851e27d2cb9 ("rust: support Rust >= 1.91.0 target spec"). They should
> land in e.g. -rc5.

OK, will try.

> Regarding `rustup`: we could link to the install instructions, but I
> don't think it is a good idea to replicate a particular `curl` line
> that could change upstream (e.g. the domain changing hands),
> especially one that installs something on the fly.

I will drop this patch in the next version.

Thanks,
Tiezhu